Last active
May 17, 2018 18:51
-
-
Save igorepst/78ad49271112950ebf6db3e10255a2f1 to your computer and use it in GitHub Desktop.
various
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
SVN ignore: | |
svn propedit svn:ignore . | |
PostgreSQL: | |
Copy data from your CSV file to the table | |
COPY zip_codes FROM '/path/to/csv/ZIP_CODES.txt' WITH (FORMAT csv); | |
Save select to CSV | |
Copy (Select * From foo) To '/tmp/test.csv' With CSV DELIMITER ','; | |
Recursive find/replace of text: | |
grep -rl oldtext . --exclude-dir=.svn | xargs sed -i 's/oldtext/newtext/g' | |
Find PID of process bound on port X: | |
fuser X/tcp | |
Check in script whether connected output is terminal (or pipe/redirection, etc.) | |
if [ -t 1 ]; then | |
# Output is tty | |
... | |
fi | |
Strip colors from output: | |
sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g" | |
yum: download all dependencies: | |
yum install --downloadonly --installroot=/var/tmp/httpd-installroot --releasever=7 --downloaddir=/var/tmp/httpd httpd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment