This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://16951708` # max size ~= 8.68 GB (how ?) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
ssh -L 5555:localhost:5432 vagrant@localhost -p 2222 -i ~/.vagrant.d/insecure_private_key -fNg # local port 5555 <-> Vagrant port 5432 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
pg_dump --clean --create --file db.out --format p --verbose --host $DBHOST --port $DBPORT -U $DBUSER $DBNAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psql -d $DBNAME --host $DBHOST --port $DBPORT -U $DBUSER -f db.out |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git update-index --assume-unchanged my.file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TABLE="DROP TABLE public.timeseries_metriccomment;" | |
echo $TABLE | perl -ne 's/(^DROP TABLE.*);/$1 CASCADE;/, print' | |
# -> DROP TABLE public.timeseries_metriccomment CASCADE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_name | |
FROM information_schema.tables | |
WHERE table_name LIKE 'prefix_%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use \033 if you need OS X compatibility | |
# e.g. RED='\033[0;31m' && echo -e ${RED}"My red text"... | |
# Reset | |
Color_Off='\e[0m' # Text Reset | |
# Regular Colors | |
Black='\e[0;30m' # Black | |
Red='\e[0;31m' # Red | |
Green='\e[0;32m' # Green |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# return unix timestamp for file or 0 if it doesn't exist | |
[ `uname` == "Darwin" ] && STAT_FORMAT_FLAG='-f' || STAT_FORMAT_FLAG='-c' | |
file_modified () { | |
file=$1 | |
if [ -f "$file" ] && [ -n "$file" ]; then # make sure filename is non-empty, -f will return true otherwise | |
echo `stat $STAT_FORMAT_FLAG "%a" $file` | |
else | |
echo "0"; | |
fi |
OlderNewer