Skip to content

Instantly share code, notes, and snippets.

@fallwith
fallwith / figleter.sh
Last active May 18, 2018 01:31
Call figlet with every font using the same input string
#!/usr/bin/env bash
string="$*"
if [ -z "$string" ]; then
echo "Usage: $0 <string>"
exit -1
fi
fonts="3-d 3x5 5lineoblique acrobatic alligator alligator2 alphabet avatar banner banner3 banner3-D banner4 barbwire basic bdffonts/ bell big bigchief binary block broadway bubble bulbhead calgphy2 caligraphy catwalk chunky coinstak colossal computer contessa contrast cosmic cosmike crawford cricket cursive cyberlarge cybermedium cybersmall decimal diamond digital doh doom dotmatrix double drpepper dwhistled eftichess eftifont eftipiti eftirobot eftitalic eftiwall eftiwater epic fender fourtops fraktur fuzzy goofy gothic graceful gradient graffiti hex hollywood invita isometric1 isometric2 isometric3 isometric4 italic ivrit jazmine jerusalem katakana kban l4me larry3d lcd lean letters linux lockergnome madrid marquee maxfour mike mini mirror mnemonic morse moscow mshebrew210 nancyj nancyj-fancy nancyj-underlined nipples ntgreek nvscript o8 octal ogre os2 pawp peaks pebbles pepper poison puffy pyramid rectangle
@fallwith
fallwith / gist:b2d51706747937cbf5ea
Created September 25, 2014 22:30
Upgrade Bash from source in response to shellshock
#!/bin/sh
# build and install a fully patched bash 4.3 to mitigate shellshock
#
# to determine vulnerability:
# %> env x='() { :;}; echo vulnerable' bash -c "echo this is a test"
mkdir bash_src
cd bash_src
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
@fallwith
fallwith / vim_guide.md
Last active May 18, 2018 03:56
Fallwith's Vim Guide

Vim Guide

2014-2018 by fallwith

Legend

sequence meaning
<C-a> Ctrl + a
\ Shift + v
@fallwith
fallwith / gist:9383650
Created March 6, 2014 06:37
rubyctags - Bash script for generating an Exuberant Ctags file for a Ruby project
#!/usr/bin/env bash
# Generate an Exuberant Ctags file for a Ruby project
#
# - Accepts an optional argument of the starting search directory or file.
# - The starting path will be walked up until either a tags file or other
# project root indicating file/dir can be found.
tags_file=.tags
declare -a root_markers=(.git .hg .svn .bzr _darcs)
@fallwith
fallwith / .agignore
Created June 21, 2013 18:30
The Silver Searcher ~/.agignore file
/log/
/logs/
/images/
/javascripts/
/stylesheets/
/tmp/
/vendor/
*.sql
*.tags*
*.gemtags*
@fallwith
fallwith / shortcuts.txt
Created March 4, 2013 09:29
Windows 8 keyboard shortcuts
Windows 8 keyboard shortcuts
=
Win + 1...0 = launch the 1st...10th taskbar app
Win + B = select tray notification area
Win + C = charms overlay (non-touch style)
Win + D = show desktop (switch to Desktop, hide all apps)
Win + E = windows explorer
Win + F = search
Win + I = settings pane
Win + L = lock screen
@fallwith
fallwith / gist:4269687
Created December 12, 2012 17:15
Shell method to clean up source code
# Clean up source code by converting tabs to 2 spaces, Windows newlines to
# unix ones, and by stripping away trailing whitespace. Pass in a list of
# files to clean, or let ack find a list of suitable candidates.
clean() {
if [ $1 ]; then
files=$@
else
files=`ack " +$|\t|\r" -l`
fi
echo $files|xargs perl -pi -e "s/\r\n?/\n/g;s/\t/ /g;s/[ ]*$//g"
@fallwith
fallwith / gist:2728143
Created May 18, 2012 23:36
Bash: Echo a random word
alias word='d=/usr/share/dict/words; rand=$[($RANDOM % `wc -l $d|sed "s/[^0-9]//g"`)+1]; sed $rand"q;d" $d'
@fallwith
fallwith / gist:2571974
Created May 1, 2012 22:30
OS X keyboard shortcuts
Here are a few OS X keyboard shortcuts I can think of now that I'm in front of a keyboard:
text editing
-
cmd + right arrow = end of line
cmd + left arrow = start of line
alt + right arrow = right one word
alt + left arrow = left one word
(add shift to the above to add highlighting)
@fallwith
fallwith / gist:2473228
Created April 23, 2012 19:23
Enable write support for NTFS flash drives in OS X
$> brew install ntfs-3g
# The exact syntax for the following commands for your system will be available in the "Caveats" section of the documentation if you run "brew info ntfs-3g"
$> sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig
$> sudo ln -s /usr/local/Cellar/ntfs-3g/2012.1.15/sbin/mount_ntfs /sbin/mount_ntfs
# The exact syntax for the following commands for your system will be available in the "Caveats" section of the documentation if you run "brew info fuse4x-kext"
$> sudo cp -rfX /usr/local/Cellar/fuse4x-kext/0.10.0/Library/Extensions/fuse4x.kext /Library/Extensions
$> sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x