View download_subreddit_wiki.sh
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
#! /bin/bash | |
set -x | |
# Requires: bash coreutils curl jq | |
USER_AGENT='superagent/1.0' | |
EXPORTDIR="exports" | |
while read -r line; do | |
SUBREDDIT="$line" | |
SUBREDDIT=`echo $SUBREDDIT | sed 's/\\r//g'` |
View sync_script.sh
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
#!/bin/bash | |
cd storage/shared/LifeWiki | |
git pull && git add -A && git commit -a -m "android vault backup: `date +'%Y-%m-%d %H-%M-%S'`" && git pull |
View compare_loop_in_list.py
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
master=''' | |
data=[2*x for x in range(10000)] | |
''' | |
test1=''' | |
for i in range(len(data)): | |
data[i]=data[i]*5 | |
''' | |
test2=''' |
View list_of_list_initialisation_problem.py
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
# Storing every csv found in PATH dir (including subfolders) in a list | |
EXT = "*.csv" | |
all_csv_path = [file | |
for path, subdir, files in os.walk(PATH) | |
for file in glob(os.path.join(path, EXT))] | |
# Creating the poteau/lisse couple we ran Ansys analysis on | |
couple = [ | |
"port_4_lis_1_pot_IPE360_lis_IPE120", | |
"port_4_lis_1_pot_IPE360_lis_IPE180", |
View replace_space_by_underscore.sh
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
for file in * | |
do | |
mv "${file}" "${file// /_}" | |
done |
View copy_and_rename_files_by_ext.sh
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
for file in *.ans.txt | |
do | |
cp "$file" "${file%.ans.txt}.dat" | |
done |
View ANSYS_KILLER.bat
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
taskkill /F /IM ANSYS.exe |
View clean_by_ext.sh
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
myExt="bat page tmp DSP esav ldhi mntr rdb rst err log r001 out full s01 s02 rsx mlv XML lock bak" | |
for ext in $myExt; | |
do | |
find . -name "*.$ext" -type f | |
done | |
echo | |
read -p "Do you want to remove these ? (y/n)" -n 1 -r | |
echo | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then |