View on GitHub

Sirius' blog

黄沙百战穿金甲,不破楼兰誓不还

Scripts

There will be some scripts I think may be useful in this repository, and new scripts will be added when I got useful ones

change.sh

  • An simple script to change log-in background of gnome in archlinux

This change will be overwritten on subsequent updates of gnome-shell

usage:

./change.sh path-of-image 

and after execute the script, tab Alt+F2 and enter ‘restart’(in Xorg, and wayland do not apply restart without reboot)

str2bin.py

  • An simple python3 script to convert ascii character to 0,1 string

usage

python str2bin.py string(or filename)

if use string as parameter, you will get the result of this string; if filename was used, you will get the result of the contents in file filename

or after execute python str2bin.py, type the string you want to convert.

you can also use ./str2bin.py, and if default python of your system is not python3, please change the head of script to python3

curl.sh

  • An simple shell script to get wallpaper of bing today

Caution! This script is based on string handling, extract the url begin with /az, so it may not always work properly

you can put it in cron, and execute it every reboot (@reboot) or use if [[ -z $BING_WALLPAPER ]]; then ./curl.sh && export BING_WALLPAPER=1; fi execute every certain time in crontab, and if executed successfully, it will not execute after one successful download in one reboot.

attach-download.py

  • An simple shell script to download mail attach and name it with content

change the arguments such as the download directory, your email address, your email password, subject filter and so on, and then execute it, it will download all attachments in the letters of subject appointed.

You can also use it in cron, and then you can check the attachments regularly. However, it seems use sql and may not able to use regular expressions, so it can only use in assured subject.