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 | |
# path to the wallpaper directory | |
rep="$HOME/wallpapers" | |
# list of files (assumed images) | |
images=("${rep}/"*) | |
# Random position | |
choice=$((${RANDOM} % ${#images[@]})) |
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 | |
for f in *.pdf ; do | |
convert -verbose -density 300 "${f}" "${f%.*}".png | |
done |
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/sh | |
cat /proc/cpuinfo | grep -i 'processor' | wc -l |
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
ssh -ND 1080 <user>@<host> | |
chromium --proxy-server="socks5://localhost:1080" |
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
# Export matplotlib plots to custom formats in Jupyter | |
from matplotlib.pyplot import * | |
%matplotlib inline | |
from IPython.display import set_matplotlib_formats | |
set_matplotlib_formats('png', 'pdf') |
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
#!/usr/bin/env bash | |
export DATA="username/dataset" | |
export KERNEL="username/kernel-name" | |
kaggle datasets download --unzip -p input $DATA | |
kaggle kernels pull -p kernel $KERNEL | |
jupyter nbconvert --to notebook --execute --allow-errors --inplace kernel/*.ipynb | |
jupyter nbconvert kernel/*.ipynb --to pdf | |
mv kernel/*.pdf . |
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
#!/usr/bin/env python3 | |
import pandas as pd | |
original_format='%Y-%m-%d %H:%M:%S' | |
target_format='%d-%m-%y %H:%M' | |
attribute_name='Date' | |
file_path='ACertainFile.csv' | |
df=pd.read_csv(file_path) | |
df[attribute_name]=pd.to_datetime(df[attribute_name], format=original_format).apply(lambda x: x.strftime(target_format)) |
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
#!/usr/bin/env bash | |
# Fix the desktop wallpaper for mate+i3 | |
dconf write /org/mate/desktop/background/show-desktop-icons "false" | |
dconf write /org/mate/desktop/background/show-desktop-icons "true" | |
dconf write /org/mate/desktop/background/show-desktop-icons "false" |
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 | |
# Update a pdf from an Overleaf project cloning it with git | |
# pdflatex + bibtex used for compilation | |
PROJECTID=12345678my-secret-id | |
FILENAME=main | |
pushd . | |
cd /tmp && git clone https://git.overleaf.com/$PROJECTID && cd $PROJECTID && pdflatex $FILENAME.tex && bibtex $FILENAME && pdflatex $FILENAME.tex && pdflatex $FILENAME.tex |
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 | |
for i in {1..174} # Change number of pages. | |
do | |
# Change URL to that of the book. | |
wget "http://dl.ndl.go.jp/view/jpegOutput?itemId=info%3Andljp%2Fpid%2F971654&contentNo=$i&outputScale=1" -O $i.jpeg | |
# They kindly ask for waiting 30s between requests. Don't be an ass and do so. | |
sleep 30 | |
done |
NewerOlder