Last active
November 17, 2016 16:20
-
-
Save mirskiy/be36dc4c60a9250b522f to your computer and use it in GitHub Desktop.
commanding lines
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
## history | |
# Quick substitution. Repeat the last command, replacing string1 with string2. Equivalent to ``!!:s/string1/string2/'' (see Modifiers below). | |
^string1^string2^ | |
# Swap usage | |
vmstat | |
# display in hex | |
echo 'test' | hd | |
# battery info | |
cat /sys/class/power_supply/BAT1/capacity | |
cat /sys/class/power_supply/BAT1/energy_now /sys/class/power_supply/BAT1/energy_full | |
# mongo | |
db.getCollection('processedpdfs').find({$text: {$search: 'pfg'}}).sort({'_id': -1}) | |
# postgres | |
pg_restore backupfile | grep olduser | grep ALTER | sed 's/olduser/newuser/' | psql --dbname dbname | |
# Env vars from .env | |
while read line; do [[ $line != \#* ]] && [[ $line ]] && echo $line | sed 's/=/="/' | sed 's/$/"/' ; done < <(cat .env) > .env.exported | |
heroku addons:open bonsai |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment