<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0" xml:base="http://www.shell-fu.org">
<channel>
<title>shell-fu</title>
<link>http://www.shell-fu.org</link>
<description />
<language>en</language><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Shell-fu" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
<title>Tip #850: Checksum directory recursively</title>
<link>http://www.shell-fu.org/lister.php?id=850</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=850</guid>
<pubDate>Mon, 29 Jun 2009 15:35:41 +0000</pubDate><description>Do a sha256sum of an entire directory name directory and check for integrity.
&lt;br /&gt;Modifying the IFS variable is necessary for filename with space.
&lt;br /&gt;
&lt;br /&gt;&lt;pre&gt;
$ IFS='
'
$ for i in $(find directory -type f -print);do sha256sum "$i";done &amp;gt; directory.SHA256SUM
$ sha256sum -c directory.SHA256SUM
&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YhGgfwDOmL_Ew03M-ll3hxqrIjg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YhGgfwDOmL_Ew03M-ll3hxqrIjg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YhGgfwDOmL_Ew03M-ll3hxqrIjg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YhGgfwDOmL_Ew03M-ll3hxqrIjg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
<title>Tip #846: Replace expr by other recursively</title>
<link>http://www.shell-fu.org/lister.php?id=846</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=846</guid>
<pubDate>Tue, 23 Jun 2009 13:22:42 +0000</pubDate><description>&lt;pre&gt;find . -name *whatyouwant* -exec perl -pi.bak -e 's/toto/foo/g' {} \;&lt;/pre&gt;

&lt;br /&gt;Replace toto by foo in all file found by find.
&lt;br /&gt;It make a backup $file.bak
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2ql8lT_PBqnq-o_6FO18SAxhSlA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2ql8lT_PBqnq-o_6FO18SAxhSlA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2ql8lT_PBqnq-o_6FO18SAxhSlA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2ql8lT_PBqnq-o_6FO18SAxhSlA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
<title>Tip #844: Hide files in an image</title>
<link>http://www.shell-fu.org/lister.php?id=844</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=844</guid>
<pubDate>Mon, 22 Jun 2009 12:33:46 +0000</pubDate><description>It is possible to hide a rar archive inside a png image file and then retrieve the files from this image.
&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;cat picture.png archive.rar &amp;gt; hidden_archive_in_pic.png&lt;/pre&gt;
&lt;br /&gt;This can also be done on Windows:
&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;copy picture.png + archive.rar hidden_archive_in_pic.png&lt;/pre&gt;
&lt;br /&gt;
When you want to retrieve the hidden files, download the image, rename to .rar and extract.
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CSWpHDSOZBTAiL2KrW8GOftI4qE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CSWpHDSOZBTAiL2KrW8GOftI4qE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CSWpHDSOZBTAiL2KrW8GOftI4qE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CSWpHDSOZBTAiL2KrW8GOftI4qE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
<title>Tip #843: Backup delicious bookmarks</title>
<link>http://www.shell-fu.org/lister.php?id=843</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=843</guid>
<pubDate>Fri, 19 Jun 2009 10:26:15 +0000</pubDate><description>Use this command to backup your del.icio.us bookmarks from the commandline with curl.
&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;curl -u username -o bookmarks.xml https://api.del.icio.us/v1/posts/all&lt;/pre&gt;
&lt;br /&gt;
Or, using wget
&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;wget --user=username --password=password https://api.del.icio.us/v1/posts/all -O bookmarks.xml&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Zf_wDgPp2wF7QmXxfQGQSeJuGfI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Zf_wDgPp2wF7QmXxfQGQSeJuGfI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Zf_wDgPp2wF7QmXxfQGQSeJuGfI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Zf_wDgPp2wF7QmXxfQGQSeJuGfI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
<title>Tip #840: Making vim oneliners</title>
<link>http://www.shell-fu.org/lister.php?id=840</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=840</guid>
<pubDate>Thu, 18 Jun 2009 12:18:03 +0000</pubDate><description>We can use vim to make changes to a file all in one command, for example
&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;vim -c "5,10s/a/b/g | wq" filename&lt;/pre&gt;
&lt;br /&gt;
This will open the file 'filename' and replace all occurances of 'a' with 'b' on lines 5-10. The file will then be written and closed. To edit the file after the change, just remove the ' | wq' from the end of the command.
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uVU_wpzT1SdrPw-BsiIqszeDfrI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uVU_wpzT1SdrPw-BsiIqszeDfrI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uVU_wpzT1SdrPw-BsiIqszeDfrI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uVU_wpzT1SdrPw-BsiIqszeDfrI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
<title>Tip #839: Shutdown a windows PC from linux</title>
<link>http://www.shell-fu.org/lister.php?id=839</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=839</guid>
<pubDate>Wed, 17 Jun 2009 11:08:52 +0000</pubDate><description>A remote Windows PC can easily be shutdown, assuming you have Samba installed on your Linux box, and you have a user account on the Windows PC that has the necessary rights.
&lt;br /&gt;
&lt;br /&gt;Just enter the following command, where 'thehostname' is the hostname of the remote PC, and 'theusername' is a valid user account on the remote PC:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;net rpc shutdown -S thehostname -U theusername&lt;/pre&gt;

&lt;br /&gt;If the hostname is not known, or cannot be resolved, then use the following instead, replacing '111.111.111.111' with the IP address of the remote PC:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;net rpc shutdown -I 111.111.111.111 -U theusername&lt;/pre&gt;

&lt;br /&gt;Additionally, the parameters that can be used with Windows' own shutdown command such as '-f' to force or '-t' to set a timeout, can also be applied to the net rpc shutdown command as well. For example the following will wait 60 seconds, and then force all running programs to terminate before shutting down:
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;net rpc shutdown -S thehostname -U theusername -f -t 60&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5ig6P1dovkHKqKzdCjTQvdZYEBw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5ig6P1dovkHKqKzdCjTQvdZYEBw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5ig6P1dovkHKqKzdCjTQvdZYEBw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5ig6P1dovkHKqKzdCjTQvdZYEBw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
<title>Tip #838: Record a screencast as an mpeg </title>
<link>http://www.shell-fu.org/lister.php?id=838</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=838</guid>
<pubDate>Tue, 16 Jun 2009 10:36:58 +0000</pubDate><description>Use the command below to record a screencast and save it as an mpeg:
&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;ffmpeg -f x11grab -s 800x600 -i :0.0 /tmp/screencast.mpg&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-aLH-ZRvKrtJiGo0osUM3vbcB3Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-aLH-ZRvKrtJiGo0osUM3vbcB3Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-aLH-ZRvKrtJiGo0osUM3vbcB3Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-aLH-ZRvKrtJiGo0osUM3vbcB3Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
<title>Tip #837: Move a file and link to the new location</title>
<link>http://www.shell-fu.org/lister.php?id=837</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=837</guid>
<pubDate>Mon, 15 Jun 2009 09:33:00 +0000</pubDate><description>Use the one liner below to relocate a file or directory, but keep it accessible on the old location through a symlink. 
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;lmv() { [ -e "$1" -a -d "$2" ] &amp;&amp; mv "$1" "$2"/ &amp;&amp; ln -s "$2"/"$(basename "$1")" "$(dirname "$1")"; }&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JKVMqhkM-Gq0obGekfH6fwpOCQs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JKVMqhkM-Gq0obGekfH6fwpOCQs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JKVMqhkM-Gq0obGekfH6fwpOCQs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JKVMqhkM-Gq0obGekfH6fwpOCQs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
<title>Tip #836: Find symbolic links </title>
<link>http://www.shell-fu.org/lister.php?id=836</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=836</guid>
<pubDate>Fri, 12 Jun 2009 12:19:21 +0000</pubDate><description>Use this command to find all the links in the current directory and below
&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;find . -lname "*"&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MbrbntSazeLQhwHD0ql1n4fu9Rw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MbrbntSazeLQhwHD0ql1n4fu9Rw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MbrbntSazeLQhwHD0ql1n4fu9Rw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MbrbntSazeLQhwHD0ql1n4fu9Rw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
<item>
<title>Tip #835: Quickly empty a file in vi</title>
<link>http://www.shell-fu.org/lister.php?id=835</link>
<guid isPermaLink="true">http://www.shell-fu.org/lister.php?id=835</guid>
<pubDate>Thu, 11 Jun 2009 11:51:27 +0000</pubDate><description>A few quick ways to empty a file of text in vi (all of these are done in command mode):
&lt;br /&gt;&lt;br /&gt;
&lt;pre&gt;:1,$d
--
:1[enter]dG
--
ggdG&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2iyjC-oV-UvUV0WDFYxKUPjvaIA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2iyjC-oV-UvUV0WDFYxKUPjvaIA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2iyjC-oV-UvUV0WDFYxKUPjvaIA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2iyjC-oV-UvUV0WDFYxKUPjvaIA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
</item>
</channel>
</rss>
