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
END="" | |
trap 'increment && END=1' 2 | |
increment() { | |
ls / | |
echo "Cleaned up" | |
} |
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
import os | |
import ipdb; ipdb.set_trace() | |
# other codes.. |
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
import glob | |
import pandas as pd | |
files = glob.glob('out-*.json') | |
def remove_unicode_char(file_name): | |
f = open(file_name, 'rb').read() | |
with open(file_name, 'w') as nf: | |
nf.write(f.decode(encoding="ascii", errors="ignore")) | |
print ("=> ", file_name) |
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
import json | |
def read_json_lines(fname, filed_name): | |
num = 0 | |
doc_size = [] | |
error_docs = [] | |
with open(fname) as f: | |
while True: | |
line = f.readline() | |
if not line: | |
break |
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
# Add the new password | |
sudo adduser $1 | |
# Add the user to labs group. | |
sudo usermod -aG labs $1 | |
# Force user to change password. | |
sudo chage -d 0 $1 |
OlderNewer