<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Wed, 10 Jun 2026 03:19:41 +0000</lastBuildDate>
    <item>
      <title>(Bash) Replace colour range - deepsoul</title>
      <link>https://snipplr.com/view/26010/replace-colour-range</link>
      <description>&lt;p&gt;This snippet shows how to replace the colours in a monochrome image, i.e. one which only contains two colours and the range of hues between them.&lt;/p&gt;</description>
      <pubDate>Wed, 06 Jan 2010 07:44:53 UTC</pubDate>
      <guid>https://snipplr.com/view/26010/replace-colour-range</guid>
    </item>
    <item>
      <title>(Bash) Retrieve administrator excuse - deepsoul</title>
      <link>https://snipplr.com/view/23540/retrieve-administrator-excuse</link>
      <description>&lt;p&gt;Jeff Ballard provides excuses in the style of the Bastard Operator From Hell via telnet.  The following should be defined as an alias (such as `excuse`) for easy access:&lt;/p&gt;</description>
      <pubDate>Sat, 21 Nov 2009 15:58:34 UTC</pubDate>
      <guid>https://snipplr.com/view/23540/retrieve-administrator-excuse</guid>
    </item>
    <item>
      <title>(Bash) Thumbnail table with date/time - deepsoul</title>
      <link>https://snipplr.com/view/23113/thumbnail-table-with-datetime</link>
      <description>&lt;p&gt;This script creates thumbnail images containing 25 thumbs each and display the EXIF time and date if your version of ImageMagick supports that (some do not).&lt;/p&gt;</description>
      <pubDate>Sat, 14 Nov 2009 08:41:57 UTC</pubDate>
      <guid>https://snipplr.com/view/23113/thumbnail-table-with-datetime</guid>
    </item>
    <item>
      <title>(Bash) copy, but never overwrite - deepsoul</title>
      <link>https://snipplr.com/view/23111/copy-but-never-overwrite</link>
      <description>&lt;p&gt;Useful if some files already exist at the destination and are newer or would take too long to copy again.&lt;/p&gt;</description>
      <pubDate>Sat, 14 Nov 2009 07:48:11 UTC</pubDate>
      <guid>https://snipplr.com/view/23111/copy-but-never-overwrite</guid>
    </item>
    <item>
      <title>(Bash) Replace background colour - deepsoul</title>
      <link>https://snipplr.com/view/22290/replace-background-colour</link>
      <description>&lt;p&gt;When you put an image in a printable document, you don't want it to have black (or coloured) background.  ImageMagick allows to replace colours even when the coloured regions are non-contiguous.  Arbitrary colour values can be specified with `\#123456` (the backslash is for escaping the #).  If you want to replace similar colours as well, use the `-fuzz` option.&lt;/p&gt;</description>
      <pubDate>Sun, 01 Nov 2009 13:53:25 UTC</pubDate>
      <guid>https://snipplr.com/view/22290/replace-background-colour</guid>
    </item>
    <item>
      <title>(Bash) Find newest file and its modification time - deepsoul</title>
      <link>https://snipplr.com/view/22289/find-newest-file-and-its-modification-time</link>
      <description>&lt;p&gt;Find the most recently modified file in a directory tree and output its name and modification time.  Use index 8 or 10 instead of 9 for access and inode modification time, respectively (see perlfunc manual page - function stat).&#13;
&#13;
This is great for deciding what directories to backup.&lt;/p&gt;</description>
      <pubDate>Sun, 01 Nov 2009 13:25:08 UTC</pubDate>
      <guid>https://snipplr.com/view/22289/find-newest-file-and-its-modification-time</guid>
    </item>
    <item>
      <title>(Bash) Cygwin: recursive copy with ACLs - deepsoul</title>
      <link>https://snipplr.com/view/21820/cygwin-recursive-copy-with-acls</link>
      <description>&lt;p&gt;Cygwin's `cp` discards ACLs (complex windoze permissions).  You have to copy them separately as follows:&lt;/p&gt;</description>
      <pubDate>Sun, 25 Oct 2009 12:23:47 UTC</pubDate>
      <guid>https://snipplr.com/view/21820/cygwin-recursive-copy-with-acls</guid>
    </item>
    <item>
      <title>(Bash) Get / set CPU affinity (Linux) - deepsoul</title>
      <link>https://snipplr.com/view/19878/get--set-cpu-affinity-linux</link>
      <description>&lt;p&gt;Start jobs bound to certain CPU(s), or find the number of available CPUs.&lt;/p&gt;</description>
      <pubDate>Thu, 17 Sep 2009 15:38:09 UTC</pubDate>
      <guid>https://snipplr.com/view/19878/get--set-cpu-affinity-linux</guid>
    </item>
    <item>
      <title>(Bash) Fix BibTeX URLs and long lines - deepsoul</title>
      <link>https://snipplr.com/view/18473/fix-bibtex-urls-and-long-lines</link>
      <description>&lt;p&gt;The tetex implementation of BibTeX, LaTeX's bibliography tool, forcibly breaks lines above a certain length (79 chars) by inserting % signs and line feeds, unless they can be broken between words.  This is a problem when URLs are referenced, or if control sequences without spaces between them are used.&#13;
&#13;
The following solution using sed improves on the one given in the post above in that it works if a line is broken twice or more times.  It can be used as an example on how to concatenate lines ending with a specific character indicating continuation.&lt;/p&gt;</description>
      <pubDate>Tue, 18 Aug 2009 17:34:56 UTC</pubDate>
      <guid>https://snipplr.com/view/18473/fix-bibtex-urls-and-long-lines</guid>
    </item>
    <item>
      <title>(Bash) Gapless playback for mplayer (Linux) - deepsoul</title>
      <link>https://snipplr.com/view/18353/gapless-playback-for-mplayer-linux</link>
      <description>&lt;p&gt;`mplayer` (or its GUI cousin, `gmplayer`) does not natively support [gapless playback](http://en.wikipedia.org/wiki/Gapless_playback), which is what you want when playing sources which have songs crossing track boundaries (classical and some modern music).  In my experience the buffering Linux provides for named pipes is sufficient to bridge the gaps.&#13;
&#13;
So the idea is to make `mplayer` output PCM data to a named pipe and use `aplay` to play the result.  The sample rate and format have to be known, because we have to disable wav headers which otherwise cause clicks.  There is a noticeable delay if you try to use the controls to skip forward or backward.&lt;/p&gt;</description>
      <pubDate>Sat, 15 Aug 2009 17:23:37 UTC</pubDate>
      <guid>https://snipplr.com/view/18353/gapless-playback-for-mplayer-linux</guid>
    </item>
    <item>
      <title>(Bash) Creating links in different directories (Linux/UNIX) - deepsoul</title>
      <link>https://snipplr.com/view/18350/creating-links-in-different-directories-linuxunix</link>
      <description>&lt;p&gt;When using `ln` to create a link in a different directory, the semantics of creating hard and symbolic links differ.  That is because a hard link contains a direct reference to its target's data, while a symbolic link is just a string containing a (possibly relative) path.  You can get around this by using absoute paths, but then moving a subtree will break the symlink.&#13;
&#13;
Just to recap, the other main differences between hard and symbolic links: Symbolic links can be left dangling when their target is removed; hard links cannot.  Symbolic links can point to files on other partitions or disks, while hard links cannot.&lt;/p&gt;</description>
      <pubDate>Sat, 15 Aug 2009 16:35:51 UTC</pubDate>
      <guid>https://snipplr.com/view/18350/creating-links-in-different-directories-linuxunix</guid>
    </item>
    <item>
      <title>(Bash) Query LEO dictionary from shell - deepsoul</title>
      <link>https://snipplr.com/view/18105/query-leo-dictionary-from-shell</link>
      <description>&lt;p&gt;The script below looks up its first argument on the LEO German-English dictionary.  It is really just a dump of the rendered result page by `lynx` followed by a grep.  But grep cannot handle the possible umlauts in the result page, so Perl is used for that.  The first paragraph constructs a regular expression which replaces umlauts and their two-character aliases with partial regexes matching anything.  The regex fraction `$onetwo` also matches two arbitrary characters, so it still works if the two-char sequence did not denote an umlaut.&lt;/p&gt;</description>
      <pubDate>Sun, 09 Aug 2009 11:27:05 UTC</pubDate>
      <guid>https://snipplr.com/view/18105/query-leo-dictionary-from-shell</guid>
    </item>
    <item>
      <title>(Bash) Filter files in place - deepsoul</title>
      <link>https://snipplr.com/view/18032/filter-files-in-place</link>
      <description>&lt;p&gt;URLs:  &#13;
&lt;http://www.chiark.greenend.org.uk/~sgtatham/utils/&gt;    &lt;http://kitenet.net/~joey/code/moreutils/&gt;&#13;
&#13;
Use one of these nifty utilities to automatically process files in-place.  Both store the results of programs which write to stdout until they are done, and then write the result.  See also `sed`'s `-i` option.  Be aware that this may clobber your files if an error occurs during processing, so it is best to back them up (though `reservoir` refuses to truncate files to nothing by default).&lt;/p&gt;</description>
      <pubDate>Fri, 07 Aug 2009 13:30:47 UTC</pubDate>
      <guid>https://snipplr.com/view/18032/filter-files-in-place</guid>
    </item>
    <item>
      <title>(Bash) Get / set X windows selection from shell - deepsoul</title>
      <link>https://snipplr.com/view/18031/get--set-x-windows-selection-from-shell</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 07 Aug 2009 13:09:40 UTC</pubDate>
      <guid>https://snipplr.com/view/18031/get--set-x-windows-selection-from-shell</guid>
    </item>
    <item>
      <title>(Bash) Blank display from shell (X windows) - deepsoul</title>
      <link>https://snipplr.com/view/18028/blank-display-from-shell-x-windows</link>
      <description>&lt;p&gt;Puts your display in power-saving standby mode:&lt;/p&gt;</description>
      <pubDate>Fri, 07 Aug 2009 12:22:03 UTC</pubDate>
      <guid>https://snipplr.com/view/18028/blank-display-from-shell-x-windows</guid>
    </item>
    <item>
      <title>(Bash) Canonical absolute path - deepsoul</title>
      <link>https://snipplr.com/view/18026/canonical-absolute-path</link>
      <description>&lt;p&gt;The following shell function returns the canonicalised abolute path of a file.  It resolves symbolic links, /./ and /../ as applicable.  This was adapted from various sources.  Related snippets on snipplr are [Find absolute path of Bash script](http://snipplr.com/view/16715/find-absolute-path-of-bash-script/) and [Get current script name and absolute paths](http://snipplr.com/view/9508/get-current-script-name-and-absolute-paths/).&lt;/p&gt;</description>
      <pubDate>Fri, 07 Aug 2009 12:05:00 UTC</pubDate>
      <guid>https://snipplr.com/view/18026/canonical-absolute-path</guid>
    </item>
    <item>
      <title>(Bash) Set display to standby from shell script - deepsoul</title>
      <link>https://snipplr.com/view/17815/set-display-to-standby-from-shell-script</link>
      <description>&lt;p&gt;Use the following command to blank your screen and save power:&lt;/p&gt;</description>
      <pubDate>Sun, 02 Aug 2009 18:18:38 UTC</pubDate>
      <guid>https://snipplr.com/view/17815/set-display-to-standby-from-shell-script</guid>
    </item>
    <item>
      <title>(Bash) Linux: Drop disk cache - deepsoul</title>
      <link>https://snipplr.com/view/17811/linux-drop-disk-cache</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 02 Aug 2009 16:49:40 UTC</pubDate>
      <guid>https://snipplr.com/view/17811/linux-drop-disk-cache</guid>
    </item>
    <item>
      <title>(Bash) Combined make/remove and change directory - deepsoul</title>
      <link>https://snipplr.com/view/17810/combined-makeremove-and-change-directory</link>
      <description>&lt;p&gt;Has saved me no end of typing over the years.&lt;/p&gt;</description>
      <pubDate>Sun, 02 Aug 2009 16:40:57 UTC</pubDate>
      <guid>https://snipplr.com/view/17810/combined-makeremove-and-change-directory</guid>
    </item>
    <item>
      <title>(Bash) Add readline editing and history capability to commandline interfaces - deepsoul</title>
      <link>https://snipplr.com/view/17471/add-readline-editing-and-history-capability-to-commandline-interfaces</link>
      <description>&lt;p&gt;You can use socat (http://www.dest-unreach.org/socat/) to add readline editing and history capability to command shells which do not themselves support it.  Each command line will be edited in the plain, so beware of password prompts.  Commands are printed again as they are passed on.&lt;/p&gt;</description>
      <pubDate>Sun, 26 Jul 2009 16:11:27 UTC</pubDate>
      <guid>https://snipplr.com/view/17471/add-readline-editing-and-history-capability-to-commandline-interfaces</guid>
    </item>
  </channel>
</rss>
