This file contains 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 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 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 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 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 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 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 |
This file contains 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
docker attach expa_data | perl -ne 'if (!m/^\s*$/ && !m/stdout/) { s/^\[[^\]]+\]\s*(.*$)/$1/m; print; }' |
This file contains 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
pbcopy < ~/.ssh/id_rsa.pub | |
git remote set-url origin git@github.com:cammsaul/lein-instant-cheatsheet.git |
OlderNewer