Some useful (or not) scripts
Go to file
Jeremy Gardais 003bf25c09 Add turtl symlink. 2017-01-16 16:30:42 +01:00
dmenu Add some scripts for dmenu. To rewrite :) 2014-10-21 23:18:29 +02:00
greasemonkey Add some useful greasemonkey scripts. 2014-09-25 23:38:43 +02:00
update-motd.d firewall: set OUTPUT Policy to DROP and translate some comments. 2015-09-16 22:04:12 +02:00
.gitignore Add some other scripts from Ivan Tikhonov. 2014-09-26 00:42:26 +02:00
README.md Add turtl symlink. 2017-01-16 16:30:42 +01:00
SoustitreDownloader.php Change screen position 2016-10-14 09:40:07 +02:00
TODO.md Add Bash_quote, firewall and Flac_to_mp3 documentation. 2015-11-20 10:20:21 +01:00
actions Add some scripts for dmenu. To rewrite :) 2014-10-21 23:18:29 +02:00
apt-fast Add apt-fast script. 2015-11-20 10:03:42 +01:00
backup_config.sh Change screen position 2016-10-14 09:40:07 +02:00
backup_pirate_usb.sh Change screen position 2016-10-14 09:40:07 +02:00
bash_quote bash_quote: correct shebang and check if lynx is available. 2015-09-08 02:14:15 +02:00
bashblock Change screen position 2016-10-14 09:40:07 +02:00
bepo_azerty.sh A script to switch my keyboard and WM configuration bépo <-> azerty 2014-10-20 15:26:16 +02:00
bkp_cluster_file Change screen position 2016-10-14 09:40:07 +02:00
change_git_user.sh Use github script to change commit's author 2016-07-06 14:27:41 +02:00
commandes_utiles Change screen position 2016-10-14 09:40:07 +02:00
compile_latex Change screen position 2016-10-14 09:40:07 +02:00
dl_plowshare.sh Change screen position 2016-10-14 09:40:07 +02:00
doku2moin.sh Change screen position 2016-10-14 09:40:07 +02:00
download_lirescan.sh Change screen position 2016-10-14 09:40:07 +02:00
download_online_manga.sh Change screen position 2016-10-14 09:40:07 +02:00
droopy Add Droopy: Tiny webserver. 2015-11-25 16:25:53 +01:00
ecran Change screen position 2016-10-14 09:40:07 +02:00
emy_sms.py Change screen position 2016-10-14 09:40:07 +02:00
explorer.exe explorer.exe: LOL :D (… symlink to nemo ^^). 2015-11-12 03:45:01 +01:00
firewall Firewall: Add a rule for HP printers on port 9100 2015-10-10 01:42:21 +02:00
flac_to_mp3 Correct variables name in flac_to_mp3 script: error if the variable 2014-12-09 14:04:26 +01:00
fpm Change screen position 2016-10-14 09:40:07 +02:00
git-loc Add some other scripts from Ivan Tikhonov. 2014-09-26 00:42:26 +02:00
idok-x86_64 Change screen position 2016-10-14 09:40:07 +02:00
jolla_connect Change screen position 2016-10-14 09:40:07 +02:00
jolla_mount Change screen position 2016-10-14 09:40:07 +02:00
jolla_usb_tethering.sh Change screen position 2016-10-14 09:40:07 +02:00
launch_thyme Add a tiny script to launch Thyme in some case 2017-01-12 11:48:32 +01:00
log_zenity_generator.log Change screen position 2016-10-14 09:40:07 +02:00
make_win_usb make_win_usb: Need a FAT32 FS on the USB key to be able to install 2015-11-18 00:30:19 +01:00
manette360 Add scripts to manage Wii and Xbox 360 gamepad. 2014-09-26 00:27:42 +02:00
ms-sys Change screen position 2016-10-14 09:40:07 +02:00
netboot.c Add some other scripts from Ivan Tikhonov. 2014-09-26 00:42:26 +02:00
num_circle Add num_circle script to transform a number into a digit with a circle. 2015-11-20 09:27:47 +01:00
pomodoro pomodoro: Also toggle the sound after the break 2015-11-25 16:27:01 +01:00
printscreen Tiny script to screen capture. 2015-05-11 23:41:56 +02:00
procstat.c Add a script to show informations of a process. 2014-09-26 00:33:44 +02:00
pubkey.sh Change screen position 2016-10-14 09:40:07 +02:00
qutebrowser Add link for qutebrowser 2016-06-07 16:31:26 +02:00
remount Change screen position 2016-10-14 09:40:07 +02:00
remove_pdf_watermark.sh Ensure to remove temp files. 2016-11-02 11:41:54 +01:00
rename_meurice_podcast rename_meurice_podcast : now also manage file as first argument. 2016-11-02 10:25:07 +01:00
resize_img A script to resize images with convert. 2014-09-23 23:54:24 +02:00
rubygems-cabin-test Change screen position 2016-10-14 09:40:07 +02:00
scdl Change screen position 2016-10-14 09:40:07 +02:00
script_shell Change screen position 2016-10-14 09:40:07 +02:00
sed_expression.exemple Change screen position 2016-10-14 09:40:07 +02:00
seeksinglucky.py Change screen position 2016-10-14 09:40:07 +02:00
send_to_kodi Change screen position 2016-10-14 09:40:07 +02:00
shell_color.sh Add shell_color.sh a tiny script to show how to use color with a shell 2015-01-28 10:12:01 +01:00
sms.py An old script to send sms from a gmail account. Probably not working but 2014-09-26 00:54:30 +02:00
snapsend.sh Snapsend: 2014-11-20 14:30:29 +01:00
sync_config_file.sh Change screen position 2016-10-14 09:40:07 +02:00
synchro_wiki.sh Change screen position 2016-10-14 09:40:07 +02:00
tag_photo.sh New script to add the directory name as an exif tag to images 2016-10-05 16:47:45 +02:00
tagmail Add two script to automate tagging mail with notmutch 2016-01-14 09:43:58 +01:00
tagmail2 Add two script to automate tagging mail with notmutch 2016-01-14 09:43:58 +01:00
test_ssl3 Add test_ssl3 script to check if an LDAP server support SSLv3. 2015-11-20 09:32:20 +01:00
thyme Add Thyme bin https://github.com/sourcegraph/thyme 2017-01-12 10:32:41 +01:00
turtl Add turtl symlink. 2017-01-16 16:30:42 +01:00
update_iso.sh Update debian stable version and add mini.iso for Debian Unstable 2016-11-06 19:37:14 +01:00
update_repo_git.sh Change screen position 2016-10-14 09:40:07 +02:00
veille.sh Ensure to kill all gpg-agent 2016-09-14 12:16:56 +02:00
vimmanpager Add a "vim" pager (need a less.vim macro). 2015-01-30 12:00:39 +01:00
virtualenv Change screen position 2016-10-14 09:40:07 +02:00
weblink Add weblink script to easily share some files with a small webserver. 2015-11-20 09:41:42 +01:00
wget_list Change screen position 2016-10-14 09:40:07 +02:00
wiimote Add scripts to manage Wii and Xbox 360 gamepad. 2014-09-26 00:27:42 +02:00
winboot Ensure to define grub's default entry with grub- 2016-12-20 18:52:25 +01:00
wol Small script for wakeonlan. 2014-10-21 10:51:09 +02:00
youtube-dl Change screen position 2016-10-14 09:40:07 +02:00
zenity_generator.sh Add a script to generate windows with zenity and bash. 2014-10-21 23:21:09 +02:00
zfSnap.sh Add zfSnap script from the legacy branch of the github project: 2014-11-18 15:49:57 +01:00
zsh_doc Change screen position 2016-10-14 09:40:07 +02:00

README.md

Scripts

Description:

Some useful scripts (for me) that can be added to $PATH :)

List:

  • apt-fast: Script for faster package downloading with 'axel'.
  • bash_quote: Get a random quote from http://danstonchat.com
  • droopy: Small webserver to allow upload on your machine.
  • firewall: A script shell to set some iptables rules.
  • update-dynmotd.d/: scripts to update the motd (via the /etc/update-motd.d directory).
  • flac_to_mp3: convert all flac files of a directory into mp3.
  • launch_thyme: Launch Thyme - apps tracker.
  • num_circle: Transform a number into a digit with a circle.
  • pomodoro: Print a task and a timer in a file. Try to apply Pomodoro Technique!
  • snapsend.sh: Send a ZFS snapshot to a remote host.
  • tag_photo.sh: Add an exif tag to images.
  • test_ssl3: Test if a website supportes the SSLV3 protocol.
  • thyme: Automatically track which applications you use and for how long.
  • turtl: Symlink to my Turtl app (evernote alternative).
  • veille.sh: Kill every sensitive process and files then lock the screen.
  • vimmanpager: Tiny script can be used as PAGER, it will call VIM!
  • weblink: Tiny Python script that run a small webserver to share files.
  • winboot: Reboot the system to a windaube partition.
  • wol: Send WakeOnLan/magic packets to remote host.
  • zenity_generator: Script to generate zenity window.
  • zfSnap.sh: Take snapshot of a ZFS pool.

Apt-fast

Speed-up APT packages downloading with 'axel' (light command line download accelerator). Juste use it like aptitude/apt/apt-get.

sudo apt-fast full-upgrade

Bash_quote

Get a random quote from http://danstonchat.com with 'lynx'.

Droopy

Run a small webserver and allow user to upload files to a local directory:wq

### Firewall A shell script to apply some Iptables rules.

  • Rules are automatically apply only for the UP interfaces.
  • If it's detect some softwares (eg. Apache2), Iptables rules for ports 80/443 are automatically apply.
  • Special rules allow all traffic throught a VPN:
firewall vpn
  • If a local file exists (firewall.local) it will also apply it. For personnal rules for example.

Flac_to_mp3

Convert FLAC audio files to MP3 with 'avconv'.

  • Convert a directory:
flac_to_mp3 /media/data/bisounours_land_v2
  • Convert a file:
flac_to_mp3 /media/data/makarena.flac

Launch_thyme

A tiny script to launch Thyme (apps tracker) to be sure to avoid recording when the screen is lock,…

Num_circle

Tiny Bash script that take a number between 0 and 20 as argument and transform it into a digit with into a circle.

num_circle 18

Pomodoro

My implementation of the Pomodoro Technique (https://en.wikipedia.org/wiki/Pomodoro_Technique).

You can simply launch it with:

pomodoro "Work my french kiss"

Then the script will:

  • Create a ~/.pomodoro directory to store current task (current.task) and a summary of each week (eg week-42-2015.txt).
  • First, it's put task name and a timer (for $WORK_TIME) to the current task file.
  • Once the $WORK_TIME has been reached:
    1. Log task name and worked time to the weekly log file
    2. Toggle the sound to mark a pause
    3. It's put a pause/break message for 5/20 minutes as current task
    4. Delete the current task file

Disavantages

  • Must run the script every ~30 minutes
  • …?

Advantages

  • I can display my current task and it's timer wherever i want (tmux, herbstluftwm, …)
  • Written to work with /bin/sh

rename_meurice_podcast

I download some podcast from a RSS flux (http://www.franceinter.fr/emission-le-moment-meurice) but i don't like:

  • the filename
  • the title tag

So it's a tiny script to correct this. I get the date and the "real" title from the "title" tag and:

  • The filename become "$date_$realtitle.mp3"
  • The title tag become "$date_$realtitle"

"Le moment Meurice": http://www.franceinter.fr/emission-le-moment-meurice

The script manage both a directory and a file as first argument.

tag_photo.sh

The main goal is to have a solution to know the "subject" of a picture without to open it and no really good name. It can happen if you delete your pictures and get it back with photorec or foremost. For this i use the Exif metadata.

You can simply launch the script with your pictures directory:

tag_photo.sh /tmp/Images

Then the script will:

  • List all subdirectories.
  • Get the basename of each directory and add it as the value of the Exif "description" tag for each images.

To see the result, you can display the tags "File Name" and "Description" of you images:

find /tmp/Images -type f -iregex '.*\.\(jpg\|gif\|png\|jpeg\)$' -exec exiftool {} -FileName -Description \;

Test_ssl3

Redhat's script to test if an LDAP server support SSLv3.

You could also use a nmap command:

nmap --script ssl-enum-ciphers -p 443 ldap.tld.org | grep "SSLv3: No supported ciphers found"

Thyme

A tracker to know which applications you use and for how long. It's just the binary from the Github's repository.

I launch it with launch_thyme to avoid to record when the screen is lock. Everything is called with a Systemd unit (service and timer).

Turtl

Simple symlink to my turtl app.

See Turtl's official website for more informations.

Python program that run a small webserver (BaseHTTPServer) to easily share some files.

  • eg:
weblink /tmp/goodbye.file
HTTP server running at http://localhost:8888/
^C^C received, shutting down server
  • With a password:
weblink --pass=die /tmp/kitty.file
HTTP server running at http://localhost:8888/die

Winboot

Tiny script to reboot the system to a windaube partition.

Be sure to set the correct value to WIN_GRUB variable which must be the number of the windoze partition in Grub. Be careful, the grub's entries start at 0.

  • The script will also modify the grub configuration:
    • Set Grub in "saved" mode.
    • Ensure to set the previous default entry with grub-set-default.
  • Then for the reboot:
    • Choose the grub entry for the next reboot.
      • Reboot the system with systemctl.