Miscellaneous small utils, mainly for the Bash shell.
Python Perl Shell Java Go D
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
assets to_utf8.py added Dec 16, 2017
dictionary update Jan 12, 2017
dropbox moved to Python 3 Jan 9, 2017
firefox dump session cookies May 17, 2017
lib base64 added Jan 23, 2017
mouse nim added Jun 17, 2018
radio ctrl+c works Feb 13, 2017
replace_accents moved to Python 3 Jan 9, 2017
templates nim added Jun 17, 2018
tests tests added Jan 12, 2017
LICENSE license added Jan 6, 2017
README.md README updated Dec 16, 2017
alarm.py tests added Jan 12, 2017
cb.py update Jan 12, 2017
config.py to_utf8.py added Dec 16, 2017
copy_current_ff_tab_url_to_clipboard.sh copy_current_ff_tab_url_to_clipboard.sh added Apr 15, 2017
fftabs.py fftabs -f LAST May 5, 2017
focus_on_last_browser_tab.sh fftabs -f LAST May 5, 2017
from_base64.py 4k input limit solved Jan 23, 2017
get_alap.py nim added Jun 17, 2018
get_images.py moved to Python 3 Jan 9, 2017
get_links.py better usage info Jan 11, 2017
github_user_email.py moved to Python 3 Jan 9, 2017
here.py moved to Python 3 Jan 9, 2017
here.sh here.sh added Jan 4, 2016
img_to_base64.py better usage info Jan 11, 2017
inout.py patch to work with dir. names that contain spaces Sep 8, 2017
install.txt requirements Jan 9, 2017
is_net_back.py is_net_back.py added Jan 10, 2017
myip.py myip added Jan 9, 2017
ocr.py update Jan 12, 2017
open_current_ff_tab_in_palemoon.sh open_current_ff_tab_in_palemoon.sh added Apr 15, 2017
open_in_tabs.py moved to Python 3 Jan 9, 2017
prettify.py better usage info Jan 11, 2017
prettyjson.py prettyjson.py added May 2, 2017
py2rtf.py better usage info Jan 11, 2017
pytest.ini base64 added Jan 23, 2017
redirect_to.py better usage info Jan 11, 2017
rep.py better usage info Jan 11, 2017
requirements.txt update Jan 12, 2017
run_tests.sh ocr.py added; a test is added Jan 11, 2017
slogan.py slogan added Jan 10, 2017
sp.py ocr.py added; a test is added Jan 11, 2017
to_base64.py 4k input limit solved Jan 23, 2017
to_md5.py 4k input limit solved Jan 23, 2017
to_utf8.py to_utf8.py added Dec 16, 2017
tocb.py moved to Python 3 Jan 9, 2017
top10.py moved to Python 3 Jan 9, 2017
twitch2mp3.py nicer output Jan 17, 2017
us.py ocr.py added; a test is added Jan 11, 2017
userpass.py userpass added Jan 10, 2017
xml2json.py better usage info Jan 11, 2017
youtube2mp3.py nim added Jun 17, 2018


Bash Utils (miscellaneous small utils for the Bash shell)

New (Jan 9, 2017)! All scripts were updated to Python 3. The original Python 2 version (which is not maintained anymore) is tagged as "v0.1". You can find that under the "release" link.

Here I collect some small command-line utils.


  • Look up the meaning of a word.
  • Usage: meaning pen
  • Meaning: what does the word pen mean?


  • Set directory/file permissions in your Dropbox folder in an intelligent way.
  • Intended audience: Linux users who also use Windows sometimes.
  • Usage: put the script in the root of your Dropbox folder and launch it.
  • blog post


  • Show the public Dropbox link(s) of one (or several) file(s).
  • Dropbox made some changes in 2017, so it doesn't work anymore.
  • Usage: get_public_link [<file> | -a]
  • blog post


  • This script extracts cookies from Firefox's cookies.sqlite that are specific to a given host. The exported cookies are saved in cookies.txt. New! It also exports session cookies from Firefox's recovery.js file. The exported cookies are saved to session_cookies.txt.
  • The original script was written by Dirk Sohler.
  • Usage: export_firefox_cookies.py <host>
  • blog post



  • A minimalistic radio player.
  • Available stations: Slay Radio, goa, trance, chillout, etc.
  • Usage: radio.py


  • This script allows you to write special Hungarian and French characters in a simple way (using the ISO-8859-1 (Latin-1) charset), then convert them to their LaTeX-equivalents.
  • Example: La'szlo' => L'{a}szl'{o}
  • blog post


  • This script converts a French accented text to LaTeX replacing the funny characters with their LaTeX equivalents.
  • Example: é => '{e}
  • blog post


  • A simple alarm script that plays a list of MP3s at a given time. Very useful if you leave your computer switched on during the night.
  • Usage:
$ alarm -p
    Play music first to adjust volume.
$ alarm -t 7h5
    Set alarm time (5 past 7 in this example).


  • Print the content of the clipboard to the standard output.
  • Usage: cb.py


  • A command line program for manipulating Firefox tabs.
  • Requirements: Firefox + MozRepl add-on.
  • Help: fftabs -h


  • Ask a base64 string and convert it back to a normal string (decode).
  • Usage: from_base64


  • An interactive program to generate a skeleton source code.
  • Supported languages: Python, Go, Java, C, D.
  • Usage: get_alap.py


  • Extract image links from a web page.
  • Usage: get_images URL [URL]... [-l]


  • Extract all links from a web page.
  • Usage: get_links.py <URL>
  • blog post


  • An interactive program that figures out the email address of a GitHub user.
  • Usage: github_user_email.py

here.py and here.sh

  • Print just the name of the current directory. For instance, if you are in /home/students/solo, then this script will print just solo.
  • here.sh simply prints the output, while here.py, in addition, copies the output to the clipboards.
  • Usage: here


  • Take an image file and encode it with BASE64. Put the encoded data in an "img" HTML tag.
  • Usage: img_to_base64 <image_file>
  • blog post


  • An interactive script for 1) compressing a folder to another directory, and 2) uncompressing an archive file to a destination directory.
  • Rationale: I always forget the order of parameters...
  • Usage: inout


  • Play a sound when the Internet connection is back.
  • Usage: is_net_back


  • My external IP address.
  • Usage: myip


  • A wrapper script around the Tesseract OCR engine. Convert an image to string.
  • Usage: ocr <image_file>


  • Read URLs from the standard input and open them in separated browser tabs.
  • Usage: cat url_list.txt | open_in_tabs
  • blog post


  • Prettify an HTML page, i.e. pretty print its HTML source.
  • The script prints the HTML source that is built by BeautifulSoup (BS). Idea: if you want to manipulate a page with BS, analyze the prettified source instead of the original because this is how BS stores it.
  • Usage: prettify <URL>
  • blog post


  • Prettify a JSON file.
  • Usage: prettyjson ugly.json


  • Transform a python source file to RTF.
  • Usage: py2rtf [-f] hello.py
  • Meaning: the output is written to hello.rtf
  • blog post


  • This script tells you where a webpage redirects.
  • Usage: redirect_to.py <URL>
  • blog post


  • Repeat a bash command several times.
  • Usage: rep <rep> <cmd>
  • Example: rep 3 echo hello
  • Meaning: print the text "hello" three times.


  • Generate some slogans from a keyword.
  • Usage: slogan <keyword>


  • Print the absolute path of a file. If no parameter is passed, show the current path. The name stands for "show path".
  • This is one of my most useful scripts :) I use it every day.
  • Usage: sp [<filename>]
  • blog post


  • Ask a string and convert it to a base64 string (encode).
  • Usage: to_base64


  • This scripts reads a text interactively and prints its md5-encoded version. The output is a 32-character long hexa string.
  • Usage: to_md5


  • Convert a text file to an UTF-8-encoded text. The output is printed to the screen.
  • Usage: to_utf8 input.txt


  • Copy the text from the standard input to ALL clipboards. Thus, you can use any paste method to insert your text (middle mouse button or Shift+Insert). The name stands for "to clipboard(s)".
  • Usage: cat file.txt | tocb
  • Options: with -t you can trim the text first (remove whitespaces from both ends of the text).
  • blog post


  • Show the top 10 largest files in the current directory. Filesizes can be shown in a human-readable format with the -h option.
  • Usage: top10 [-h]


  • Grab a twitch video in mp3.
  • Usage: twitch2mp3 TWITCH_VIDEO_URL


  • Username and password generator.
  • Usage: userpass


  • Change spaces to underscores. Pass a string as a parameter OR pass it on the standard input.
  • Example #1: us "How to Think Like a Computer Scientist.pdf"
  • Result #1: How_to_Think_Like_a_Computer_Scientist.pdf
  • Example #2: echo "he he" | us
  • Result #2: he_he


  • Convert an XML file to JSON.
  • This is a wrapper around the excellent xmltodict library.
  • Usage: xml2json <input.xml>