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
| # replace blank line, even line contains spaces | |
| s/^ *$/.LP/ | |
| # replace spaces at begin of the line | |
| s/^ *// | |
| # replace spaces at end of the line | |
| s/ *$// | |
| # replace spaces more than one to just one space | |
| s/ */ /g | |
| # extract outline from latex files |
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
| # there are many subdirectories, and each file has a .tgz file in it. | |
| # run this to check path, test first | |
| for d in ./*/ | |
| do (cd $d && echo $PWD) | |
| done | |
| # run this to extrat files to its directory. | |
| for d in ./*/ | |
| do (cd $d && find . -name '*.tgz' -not -name '.*' -exec tar xvzf {} -C $PWD \;) |
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
| certutil -hashfile filename MD5 | |
| certutil -hashfile filename SHA1 | |
| certutil -hashfile filename SHA256 |
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
| # chmod [OPTION] [MODE] [FILE] | |
| # mode: '[ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+' | |
| # [ugoa] user, group, others(not in group), all | |
| # [-+=] remove, add, | |
| # [rwxXst] read, write, execute, | |
| chmod u+x filename |
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
| import pandas as pd | |
| import xlsxwriter | |
| # an example dict | |
| table_result = [] | |
| table_row = {} | |
| element = 3.14 | |
| table_row['col_1'] = 1000 | |
| table_row['col_2'] = 3e-5 | |
| table_row['col_3'] = 2.242 |