Skip to content

Instantly share code, notes, and snippets.

dragon788 dragon788

  • Midwest, USA
Block or report user

Report or block dragon788

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1704ac03dd3b8b49cb30
# Set your cygwin home from /home/$USER to Windows %APPDATA aka /cygdrive/c/Users/$USER
mkpasswd -c -p "$(cygpath -H)" > /etc/passwd
# Can also use -l (local) or -d (domain) but domain takes a LONG time on a large domain, and local adds ALL local users to the /etc/passwd file.
View gist:e42397eacc568d75549b
Insert the following code into the *.VMX file:
sched.mem.pshare.enable = "FALSE"
mainMem.useNamedFile = "FALSE"
prefvmx.minVmMemPct = "100"
prefvmx.useRecommendedLockedMemSize = "TRUE"
mainMem.partialLazySave = "FALSE"
mainMem.partialLazyRestore = "FALSE"
priority.grabbed = "high"
priority.ungrabbed = "normal"
@dragon788
dragon788 / install-vmware-tools.sh
Created Jan 30, 2015
post-build Packer provisioning
View install-vmware-tools.sh
#!/bin/bash -x
mkdir /mnt/cdrom
mount -o loop linux.iso /mnt/cdrom
cp /mnt/cdrom/VMwareTools*.gz /tmp/
cd /tmp
tar -zxvf VMwareTools*
cd vmware-tools-distrib
./vmware-install.pl --default EULA_AGREED=yes
umount /mnt/cdrom
cd
View tmux.bash
# Brett Terpstra 2014
# <http://brettterpstra.com>
#
# tmux wrapper
# tm session-name [window-name]
# Names can be partial from the beginning and first match will connect.
# If no match is found a new session will be created.
# If there's a second argument, it will be used to attach directly to a
# window in the session, or to name the first window in a new session.
tm() {
View tm.completion.bash
_tm_complete() {
local rx
local token=${COMP_WORDS[$COMP_CWORD]}
local IFS=$'\t'
local words
if [ $COMP_CWORD -eq 2 ]; then
words=$(tmux list-windows -t ${COMP_WORDS[1]} 2> /dev/null | awk '{print $2}' | tr -d '*-' | tr "\n" "\t")
elif [ $COMP_CWORD -eq 1 ]; then
words=$(tmux -q list-sessions 2> /dev/null | cut -f 1 -d ':' | tr "\n" " ")
fi
@dragon788
dragon788 / stayunlocked
Last active Aug 29, 2015
Tweaks for Vagrant boxes to prevent locking in the VM
View stayunlocked
# Disable screensaver (by setting time to never)
gsettings set org.gnome.desktop.session idle-delay 0
# Disable lock screen entirely
gsettings set org.gnome.desktop.lockdown disable-lock-screen true
gsettings list-recursively
View .bashrc-history
$ grep -ri hist ~/.bashrc | grep -v alias
# don't put duplicate lines or lines starting with space in the history.
#HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
#HISTSIZE=1000
#HISTFILESIZE=2000
export HISTSIZE=100000
export HISTFILESIZE=50000
View gist:cba0c40f4983cd0b6a47
# Need to set 'git config core.filemode false' because Windows sucks.
git config core.filemode false
# This was causing issues with .oh-my-zsh not wanting to update due to
# broken/loose permissions on various files.
# Running this in the .oh-my-zsh folder broke git aliasing for some reason
# Set this to enable windows native symlinks (On XT3)
CYGWIN="${CYGWIN} winsymlinks:nativestrict"
@dragon788
dragon788 / fix_ssh.sh
Created Mar 12, 2015
Fixing SSH permissions issues
View fix_ssh.sh
cd
chmod 700 .ssh
cd .ssh
chmod 600 *
chmod 644 *.pub
@dragon788
dragon788 / gist:fb023aaa727041e84f58
Created Mar 16, 2015
Nexus Q ball hacks and tweaks
View gist:fb023aaa727041e84f58
as root
setprop persist.sys.ringcolor "16711680 16744192 16776960 65280 255 6684927 9109759"
You can’t perform that action at this time.