Skip to content

Instantly share code, notes, and snippets.

View dragon788's full-sized avatar

dragon788 dragon788

View GitHub Profile
@dragon788
dragon788 / gist:1704ac03dd3b8b49cb30
Last active August 29, 2015 14:14
Babun customizations
# 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.
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 January 30, 2015 23:25
post-build Packer provisioning
#!/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
@dragon788
dragon788 / tmux.bash
Last active August 29, 2015 14:14 — forked from ttscoff/tm.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() {
_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 August 29, 2015 14:14
Tweaks for Vagrant boxes to prevent locking in the VM
# 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
$ 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
@dragon788
dragon788 / gist:cba0c40f4983cd0b6a47
Last active August 29, 2015 14:15
Babun customizations
# 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 March 12, 2015 15:10
Fixing SSH permissions issues
cd
chmod 700 .ssh
cd .ssh
chmod 600 *
chmod 644 *.pub
@dragon788
dragon788 / gist:fb023aaa727041e84f58
Created March 16, 2015 01:02
Nexus Q ball hacks and tweaks
as root
setprop persist.sys.ringcolor "16711680 16744192 16776960 65280 255 6684927 9109759"