Skip to content

Instantly share code, notes, and snippets.

@coliver
coliver / describe_security_groups
Created November 14, 2012 22:58
Example xml returned from fog with juicy info removed.
<?xml version="1.0" encoding="UTF-8"?>
<DescribeSecurityGroupsResponse xmlns="http://ec2.amazonaws.com/doc/2012-07-20/">
<requestId>REDACTED</requestId>
<securityGroupInfo>
<item>
<ownerId>REDACTED</ownerId>
<groupId>REDACTED</groupId>
<groupName>REDACTED</groupName>
<groupDescription>REDACTED</groupDescription>
<ipPermissions/>
@coliver
coliver / ubuntu14.04-command-line-install-android-sdk
Last active January 28, 2016 22:17 — forked from wenzhixin/ubuntu14.04-command-line-install-android-sdk
Ubuntu 14.04 command line install android sdk
# install openjdk
sudo apt-get install openjdk-7-jdk
# download android sdk
http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools
# install all sdk packages
# Install genymotion
https://www.genymotion.com/
# Install Android SDK
# Download Genymotion-ARM-Translation v1.1
# Google it
# Genymotion:
# Using Google Nexus 7 - 4.3 - API 18 VM
# I use RubyMine. In the find and replace box:
find: expect\((.*)\)\.to receive\((.*)\)(\.with\(.*\))?.and_return
replace: $1.expects($2).returns(
# This does most of the work.
@coliver
coliver / HowToGetAWebcamWorkingInAVM.md
Last active April 26, 2016 21:07
How to get a webcam working in a Windows 10 VM

Tested in VirtualBox 5.0.18

Linux Mint 17 Qiana host

Win10 guest

Ensure the VM boots up, windows update, install guest additions, shut down

  • Open VirtualBox
@coliver
coliver / rubyntlm_with_net_http.rb
Created February 20, 2019 18:20 — forked from rodrei/rubyntlm_with_net_http.rb
Example: NTLM Authentication with NetHTTP
uri = URI('https://host.com/ews/exchange.asmx')
user = ''
passwd = ''
Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
request = Net::HTTP::Get.new(uri.request_uri)
t1 = Net::NTLM::Message::Type1.new()
request['Authorization'] = 'NTLM ' + t1.encode64
response = http.request(request)
@coliver
coliver / net_ntlm_monkeypatch.rb
Created February 27, 2019 21:33 — forked from antoniusostermann/net_ntlm_monkeypatch.rb
A monkey patch to solve the problem described in https://github.com/savonrb/httpi/issues/139. This monkey patch prioritizes ntlm over negotiate and makes it possible to use the httpi gem if server supports both / sends header including both arguments.
# A monkey patch concerning this issue: https://github.com/savonrb/httpi/issues/139
# Basically, this monkey patch priors NTLM over Negotiate and not vice-versa
# All monkey patched spots are marked with "## MONKEY PATCHED"
# All in all, there are 2 monkey patched spots, both in private method "negotiate_ntlm_auth"
# Compare it with: https://github.com/savonrb/httpi/blob/d6a3825a8e896f794e54b634c39521e6956f72ff/lib/httpi/adapter/net_http.rb
require "uri"
require "httpi/adapter/base"
require "httpi/response"
/* This file goes in ~/Library/KeyBindings */
{
/* Remap Home / End keys */
/* Home Button*/
"\UF729" = "moveToBeginningOfLine:";
/* End Button */
"\UF72B" = "moveToEndOfLine:";
/* Shift + Home Button */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
/* Shift + End Button */
@coliver
coliver / Gemfile-lock-fix.md
Created March 23, 2020 14:01 — forked from carlflor/Gemfile-lock-fix.md
This fixes the Gemfile.lock conflict when doing git rebase

If both the upstream and your feature branch have made changes to Gemfile, you will likely receive merge conflicts on Gemfile.lock when you rebase your feature branch. Don't try to resolve these manually; you'll probably just screw it up. Instead do this:

    git checkout --ours Gemfile.lock
    bundle
    git add Gemfile.lock
    git rebase --continue

This ensures that you get a correct Gemfile.lock at each step along the way.

@coliver
coliver / global-gitignore.md
Created April 21, 2020 21:23 — forked from subfuzion/global-gitignore.md
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file. Create a file called .gitignore in your home directory and add anything you want to ignore. You then need to tell git where your global gitignore file is.

Mac

git config --global core.excludesfile ~/.gitignore

Windows

git config --global core.excludesfile %USERPROFILE%\.gitignore