Skip to content

Instantly share code, notes, and snippets.

View dragon788's full-sized avatar

dragon788 dragon788

View GitHub Profile
@dragon788
dragon788 / DW5800GPS.md
Created October 18, 2015 19:38 — forked from kaizhao86/DW5800GPS.md
Enabling Dell Wireless 5800 (DW5800) Novatel E362 Verizon 4G PCI-E card's GPS

Use the following Hayes AT command through the diag com port:

AT$NWGPSSTART=3,1,4,250,50,255

@dragon788
dragon788 / CapsLockCtrlEscape.ahk
Created December 12, 2015 18:25 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own, and Ctrl when used in combination with another key, à la Steve Losh. Adapted from the one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281).
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}
@dragon788
dragon788 / vm-resize-hard-disk.md
Created January 11, 2016 22:12 — forked from christopher-hopper/vm-resize-hard-disk.md
Resize a Hard Disk for a Virtual Machine provisioned using Vagrant from a Linux base box to run using VirutalBox.

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@dragon788
dragon788 / gist:eb42335db2886639e099
Created January 27, 2016 01:22 — forked from lamw/gist:bae9687faa14c7d7ee18
Automate silent install of VMware Tools including enabling Automatic Kernel Module Update
#!/bin/bash
# Create temp workign directory
mkdir -p /mnt/vmw-tools
# Mount VMware Tools ISO
mount /dev/cdrom /mnt/vmw-tools
# Retrieve the VMware Tools package name from the directory
VMW_TOOLS=$(ls /mnt/vmw-tools/ | grep .gz)
@dragon788
dragon788 / replace-debian-with-arch.txt
Created January 28, 2016 22:11 — forked from m-ou-se/replace-debian-with-arch.txt
Instructions to replace a live Debian installation with Arch
# Download latest archlinux bootstrap package, see https://www.archlinux.org/download/
wget http://ftp.nluug.nl/os/Linux/distr/archlinux/iso/2016.01.01/archlinux-bootstrap-2016.01.01-x86_64.tar.gz
# Make sure you'll have enough entropy for pacman-key later.
apt-get install haveged
# Install the arch bootstrap image in a tmpfs.
mount -t tmpfs none /mnt
cd /mnt
tar xvf ~/archlinux-bootstrap-2016.01.01-x86_64.tar.gz --strip-components=1
@dragon788
dragon788 / msys2-here-uninstall.reg
Created February 28, 2016 17:45 — forked from elieux/msys2-here-uninstall.reg
MSYS2 here context menu items
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MSYS here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW64 here]
[-HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\MINGW32 here]
@dragon788
dragon788 / dump_stats.py
Created March 29, 2016 23:25 — forked from durden/dump_stats.py
Dump Python pstats file to stdout sorted by cumulative stat
if __name__ == "__main__":
import sys
import pstats
stats = pstats.Stats(sys.argv[1])
stats.strip_dirs()
stats.sort_stats('cumulative')
stats.print_stats()
// ==UserScript==
// @id [email protected]
// @name Github MD5 Hashes
// @version 1.0
// @namespace github-md5-hashes
// @author Erik Vold
// @description
// @include http*//github.com*
// @run-at document-end
// ==/UserScript==
@dragon788
dragon788 / remotemd5.py
Created March 31, 2016 23:53 — forked from brianewing/remotemd5.py
Python MD5 of remote file (URL)
import os, hashlib, urllib2, optparse
def get_remote_md5_sum(url, max_file_size=100*1024*1024):
remote = urllib2.urlopen(url)
hash = hashlib.md5()
total_read = 0
while True:
data = remote.read(4096)
total_read += 4096
key=ENV['key']
vars = Hash.new
vars["key"]=ENV['key']
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.provision "shell", inline: "echo var key=#{key}"
config.vm.provision "shell", path: "provision.sh", args: "arg1", env: vars
end