Bash Utils (miscellaneous small utils for the bash shell) ========================================================= Here I collect some small command-line utils. Author: Laszlo Szathmary, 2011 (jabba.laci@gmail.com) Github: https://github.com/jabbalaci/Bash-Utils redirect_to.py Website: http://pythonadventures.wordpress.com/2010/12/21/where-does-a-page-redirect-to/ This script tells you where a webpage redirects. Usage: ./redirect_to.py <URL> mouse/mousepos_gui.py Website: https://ubuntuincident.wordpress.com/2011/09/11/gui-to-monitor-mouse/ Monitor the mouse position in real-time. I made it to facilitate the usage of autopy (http://www.autopy.org). Usage: ./mousepos_gui.py firefox/export_firefox_cookies.py Website: https://ubuntuincident.wordpress.com/2011/09/05/download-pages-with-wget-that-are-protected-by-cookies/ Original script written by Dirk Sohler (https://old.0x7be.de/2008/06/19/firefox-3-und-cookiestxt/). This script extracts cookies from Firefox's cookies.sqlite file hat are specific to a given host. The exported cookies are saved in the file cookies.txt. Usage: ./export_firefox_cookies.py <host> reddit/reddit_get_all_pages.py Website: https://ubuntuincident.wordpress.com/2011/08/27/browse-all-pages-of-a-subreddit/ This script allows you to browse all the older pages of a subreddit. Limitation: since reddit.com lists only the last 1000 posts, the script will only list 40 pages. Usage: ./reddit_get_all_pages.py reddit/reddit_get_posts.py Website: https://ubuntuincident.wordpress.com/2011/08/11/browse-your-favorite-subreddits-painlessly/ This script can extract links to posts in a subreddit. You can get links to comments (-c switch) or to direct URLs (-u switch). Basic usage: ./reddit_get_posts.py -c /r/earthporn Advanced usage: ./reddit_get_posts.py -u /r/earthporn | open_in_tabs -s replace_accents/ Website: https://ubuntuincident.wordpress.com/2011/07/01/replace-accents-for-latex/ Here you find two scripts for replacing accents for LaTeX. (1) replace_latex_accents.pl 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} (2) replace_french_accents_to_latex.pl This script converts a French accented text to LaTeX replacing the funny characters with their LaTeX equivalents. Example: é => \'{e} get_public_link.py Website: https://ubuntuincident.wordpress.com/2011/06/01/get-the-public-dropbox-links-of-several-files/ Show the public Dropbox link(s) of one (or several) file(s). Usage: get_public_link <file> | -a dropbox/dropbox_permissions.py Website: https://ubuntuincident.wordpress.com/2011/05/08/setting-file-permissions-in-your-dropbox-folder-recursively/ 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. get_images.py Extract image links from a web page. Usage: get_images URL [URL]... [-l] get_links.py Website: https://pythonadventures.wordpress.com/2011/03/10/extract-all-links-from-a-web-page/ Extract all links from a web page. Usage: get_links <URL> open_in_tabs.py Website: https://ubuntuincident.wordpress.com/2011/03/09/open-urls-in-browser-tabs-simultaneously/ Read URLs from the standard input and open them in separated tabs. Usage: cat url_list.txt | open_in_tabs markdown.py Website: https://ubuntuincident.wordpress.com/2011/05/05/readme-markdown-on-github/ Preview markdown files in a browser. Usage: markdown.py <file.markdown> [-u] img_to_base64.py Website: https://ubuntuincident.wordpress.com/2011/04/17/embed-images-in-html-pages/ Take an image file and encode it with BASE64. Put the encoded data in an "img" HTML tag. Usage: img_to_base64 <image_file> alarm.py Website: https://ubuntuincident.wordpress.com/2011/04/17/alarm-script/ 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). prettify.py "prettify an HTML page" Website: https://pythonadventures.wordpress.com/2011/04/03/prettify-html-with-beautifulsoup/ 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> sp.py "show path" Website: https://ubuntuincident.wordpress.com/2011/03/17/show-the-absolute-path-of-a-file/ Print the absolute path of a file. If no parameter is passed, show the current path. Usage: sp <filename> tocb.py "to clipboard(s)" Website: https://pythonadventures.wordpress.com/2011/03/05/copy-string-to-x-clipboards/ 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). Usage: cat file.txt | tocb