<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>wp &#124; anoopdotnet &#187; tips</title>
	<atom:link href="http://wp.anoop.net/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://wp.anoop.net</link>
	<description>yet another meaningless wordpress blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 08:47:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
			<item>
		<title>My vim settings</title>
		<link>http://wp.anoop.net/2010/11/my-vim-settings/</link>
		<comments>http://wp.anoop.net/2010/11/my-vim-settings/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 15:44:36 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
				<category><![CDATA[Meaningless]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://wp.anoop.net/?p=2039</guid>
		<description><![CDATA[From time to time, I find some settings for vi on remote systems that really kind of freak me out. The one I found recently was &#8216;incsearch&#8217; so I decided to use this opportunity to note down the settings I use on a daily basis. Hope you find some of these useful. syntax on   [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time, I find some settings for vi on remote systems that really kind of freak me out. The one I found recently was &#8216;incsearch&#8217; so I decided to use this opportunity to note down the settings I use on a daily basis. Hope you find some of these useful.</p>
<p><code><br />
syntax on  <br />
set hlsearch<br />
set incsearch<br />
set ruler<br />
set showmatch<br />
</code></p>
<p><strong>syntax on</strong> is pretty obvious. If you&#8217;re writing code, it&#8217;s pretty smart about highlighting the code so it&#8217;s easier to read. It can be odd at first but I find it really useful and after a while, it becomes second nature.</p>
<p><strong>set hlsearch</strong> highlights your search terms so they&#8217;re easy to see. I like this option a lot. not everyone does. </p>
<p><strong>set incsearch</strong> searches as you type. It&#8217;s new to me so I&#8217;m still getting used to it but I think I can already see some uses for it.</p>
<p><strong>set ruler</strong> shows you where your cursor is at all times. I like this option a lot if only to tell me what line number I&#8217;m on. <strong>set number</strong> will also do this but I also find it irritating because it also interferes with my copy/paste habits.</p>
<p><strong>set showmatch</strong> is really useful if you&#8217;re a coder. If you&#8217;ve got somewhat complicated conditional statements or loops, this feature will show you where brackets match so you can find missing brackets and close the proper blocks.</p>
<p>Hope these help. I&#8217;ll update these as I find more. </p>
]]></content:encoded>
			<wfw:commentRss>http://wp.anoop.net/2010/11/my-vim-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get yesterday&#8217;s date using &#8216;date&#8217; in linux</title>
		<link>http://wp.anoop.net/2009/06/how-to-get-yesterdays-date-using-date-in-linux/</link>
		<comments>http://wp.anoop.net/2009/06/how-to-get-yesterdays-date-using-date-in-linux/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 18:52:15 +0000</pubDate>
		<dc:creator>Anoop</dc:creator>
				<category><![CDATA[Technobabble]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://wp.anoop.net/?p=13</guid>
		<description><![CDATA[A while back, I was asked to come up with a logrotation script. This script would rotate all logs into a tarball and move it somewhere for archival purposes. The problem was that I couldn&#8217;t just rotate today&#8217;s logs because it would be incomplete. I had to intelligently find a way to rotate the previous [...]]]></description>
			<content:encoded><![CDATA[<p>A while back, I was asked to come up with a logrotation script.</p>
<p>This script would rotate all logs into a tarball and move it somewhere for archival purposes.</p>
<p>The problem was that I couldn&#8217;t just rotate today&#8217;s logs because it would be incomplete. I had to intelligently find a way to rotate the previous days logs (which would be complete) and then tar them up.</p>
<p>It turns out that you can do this with the &#8220;date&#8221; command in linux.</p>
<p style="padding-left: 30px;"><code><br />
YESTERDAY=$(date -d "yesterday" '+%Y-%m-%d')<br />
echo $YESTERDAY<br />
</code></p>
<p>This little snippet came in very handy and so I thought would share it.</p>
<p>The whole script is very small actually. Here it is. All you want to do is direct the output to a log file so you can review it later if need be. It&#8217;s chatty but you want chatty when you&#8217;re backing up and deleting log files.</p>
<p style="padding-left: 30px;"><code><br />
#!/bin/bash<br />
if [ $# -lt 3 ];  then<br />
echo "USAGE: backup_logs.sh ORIGINAL FILE-PREFIX- DESTINATION"<br />
exit<br />
fi<br />
# get command line variables<br />
FILE=$2<br />
ORIG=$1<br />
DEST=$3<br />
# get current time for log files.<br />
NOW=$(date)<br />
# get yesterdays date<br />
YESTERDAY=$(date -d "yesterday" '+%Y-%m-%d')<br />
# beginning entry in the log file<br />
echo "$NOW Backing up $FILE from $ORIG for $YESTERDAY to $DEST/$FILE-$YESTERDAY.tgz"<br />
echo "$NOW Command is /bin/tar -zcvf $DEST/$FILE$YESTERDAY.tgz $ORIG/$FILE$YESTERDAY*"<br />
/bin/tar -zcvf $DEST/$FILE$YESTERDAY.tgz $ORIG/$FILE$YESTERDAY*<br />
echo $NOW Done backing up logfiles to $DEST/$FILE-$YESTERDAY.tgz<br />
echo "$NOW removing files that were backed up."<br />
/bin/rm -vf $ORIG/$FILE$YESTERDAY*<br />
echo "$NOW done removing backuped up files."<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://wp.anoop.net/2009/06/how-to-get-yesterdays-date-using-date-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

