2015-02-06 23:28:31 +01:00
|
|
|
|
# Scripts
|
|
|
|
|
|
2014-09-23 11:36:56 +02:00
|
|
|
|
## Description:
|
|
|
|
|
Some useful scripts (for me) that can be added to $PATH :)
|
|
|
|
|
|
|
|
|
|
## List:
|
2015-11-20 10:03:42 +01:00
|
|
|
|
* apt-fast: Script for faster package downloading with 'axel'.
|
2015-02-06 23:28:31 +01:00
|
|
|
|
* bash_quote: Get a random quote from http://danstonchat.com
|
2015-11-25 16:25:53 +01:00
|
|
|
|
* droopy: Small webserver to allow upload on your machine.
|
2015-09-16 23:02:23 +02:00
|
|
|
|
* firewall: A script shell to set some iptables rules.
|
|
|
|
|
* update-dynmotd.d/: scripts to update the motd (via the /etc/update-motd.d directory).
|
2015-02-06 23:28:31 +01:00
|
|
|
|
* flac_to_mp3: convert all flac files of a directory into mp3.
|
2015-11-20 09:27:47 +01:00
|
|
|
|
* num_circle: Transform a number into a digit with a circle.
|
2015-10-18 02:54:44 +02:00
|
|
|
|
* pomodoro: Print a task and a timer in a file. Try to apply Pomodoro Technique!
|
2015-02-06 23:28:31 +01:00
|
|
|
|
* snapsend.sh: Send a ZFS snapshot to a remote host.
|
|
|
|
|
* test_ssl3: Test if a website supportes the SSLV3 protocol.
|
2014-09-23 11:36:56 +02:00
|
|
|
|
* veille.sh: Kill every sensitive process and files then lock the screen.
|
2015-02-06 23:28:31 +01:00
|
|
|
|
* vimmanpager: Tiny script can be used as PAGER, it will call VIM!
|
2015-11-20 09:41:42 +01:00
|
|
|
|
* weblink: Tiny Python script that run a small webserver to share files.
|
2015-02-06 23:28:31 +01:00
|
|
|
|
* wol: Send WakeOnLan/magic packets to remote host.
|
|
|
|
|
* zenity_generator: Script to generate zenity window.
|
|
|
|
|
* zfSnap.sh: Take snapshot of a ZFS pool.
|
|
|
|
|
|
2015-11-20 10:03:42 +01:00
|
|
|
|
### Apt-fast
|
|
|
|
|
Speed-up APT packages downloading with 'axel' (light command line download accelerator). Juste use it like aptitude/apt/apt-get.
|
|
|
|
|
```sh
|
|
|
|
|
sudo apt-fast full-upgrade
|
|
|
|
|
```
|
|
|
|
|
|
2015-11-20 10:20:21 +01:00
|
|
|
|
### Bash_quote
|
|
|
|
|
Get a random quote from http://danstonchat.com with 'lynx'.
|
|
|
|
|
|
2015-11-25 16:25:53 +01:00
|
|
|
|
### Droopy
|
|
|
|
|
Run a small webserver and allow user to upload files to a local directory:wq
|
|
|
|
|
|
|
|
|
|
|
2015-11-20 10:20:21 +01:00
|
|
|
|
### 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:
|
|
|
|
|
```sh
|
|
|
|
|
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:
|
|
|
|
|
```sh
|
|
|
|
|
flac_to_mp3 /media/data/bisounours_land_v2
|
|
|
|
|
```
|
|
|
|
|
* Convert a file:
|
|
|
|
|
```sh
|
|
|
|
|
flac_to_mp3 /media/data/makarena.flac
|
|
|
|
|
```
|
|
|
|
|
|
2015-11-20 09:27:47 +01:00
|
|
|
|
### 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.
|
|
|
|
|
```sh
|
|
|
|
|
num_circle 18
|
|
|
|
|
⑱
|
|
|
|
|
```
|
2015-10-27 13:27:16 +01:00
|
|
|
|
|
|
|
|
|
### Pomodoro
|
|
|
|
|
My implementation of the Pomodoro Technique (https://en.wikipedia.org/wiki/Pomodoro_Technique).
|
|
|
|
|
|
|
|
|
|
You can simply launch it with:
|
|
|
|
|
```sh
|
|
|
|
|
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
|
|
|
|
|
|
2015-11-20 09:32:20 +01:00
|
|
|
|
## Test_ssl3
|
|
|
|
|
Redhat's script to test if an LDAP server support SSLv3.
|
|
|
|
|
|
|
|
|
|
You could also use a nmap command:
|
|
|
|
|
```sh
|
|
|
|
|
nmap --script ssl-enum-ciphers -p 443 ldap.tld.org | grep "SSLv3: No supported ciphers found"
|
|
|
|
|
```
|
|
|
|
|
|
2015-11-20 09:41:42 +01:00
|
|
|
|
## Weblink
|
|
|
|
|
Python program that run a small webserver (BaseHTTPServer) to easily share some files.
|
|
|
|
|
* eg:
|
|
|
|
|
```sh
|
|
|
|
|
weblink /tmp/goodbye.file
|
|
|
|
|
HTTP server running at http://localhost:8888/
|
|
|
|
|
^C^C received, shutting down server
|
|
|
|
|
```
|
|
|
|
|
* With a password:
|
|
|
|
|
```sh
|
|
|
|
|
weblink --pass=die /tmp/kitty.file
|
|
|
|
|
HTTP server running at http://localhost:8888/die
|
|
|
|
|
```
|
|
|
|
|
|