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
| head -1 file1.csv > final.csv | |
| IFS=$(echo -en "\n\b") | |
| for filename in $(ls file*.csv); do sed 1d $filename >> final.csv; done |
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
| ### repair working tree after an accidental sudo | |
| sudo chown -R $USER:$USER "$(git rev-parse --show-toplevel)/.git" |
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 pg_get_serial_sequence(TABLENAME,'id'); //check sequence id | |
| select MAX(id) from TABLENAME; //Check current max for id | |
| select nextval(RESULTOFPG_GET_SERIAL_SEQUENCE); //Increment sequence id | |
| INSERT INTO TABLENAME(NONPKCOLUMN) VALUES(null); //test insert | |
| SELECT setval(RESULTOFPG_GET_SERIAL_SEQUENCE, (SELECT MAX(id) FROM TABLENAME)); |
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
| CREATE TABLE new_table as | |
| SELECT * FROM old_table WHERE 1 GROUP BY [column to remove duplicates by]; |
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
| Rubygems: https://ruby.taobao.org/ | |
| NPM: http://npm.taobao.org/ | |
| Pypi: http://pypi.douban.com/ | |
| NodeJS: http://registry.cnpmjs.org/ |
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
| To change the mode | |
| This can be done in two ways: | |
| Open your "my.ini" file within the MySQL installation directory, and look for the text "sql-mode". | |
| Find: | |
| Code: | |
| # Set the SQL mode to strict | |
| sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" | |
| Replace with: | |
| Code: | |
| # Set the SQL mode to strict |
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
| sudo rm -f /var/cache/apt/partial/* | |
| sudo rm -R /var/lib/apt/lists/partial/* | |
| sudo rm -R /var/lib/apt/lists/* |
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
| https://ronaldduncan.wordpress.com/2009/10/31/text-file-formats-ascii-delimited-text-not-csv-or-tab-delimited-text/ | |
| MySQL, IIRC, choked cuz these are 2-character not 1-char separators. | |
| ^\ ␜ File Separator | |
| ^] ␝Group Separator | |
| ^^ ␞Record Separator | |
| ^_ ␟Unit Separator |
NewerOlder