<?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>Technology Associates Group &#187; Linux</title>
	<atom:link href="http://tagfl.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://tagfl.com</link>
	<description>"Serve wholeheartedly, as if you were serving the LORD, not men." - Ephesians 6:7</description>
	<lastBuildDate>Wed, 10 Jun 2009 20:52:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Help! My social account has been hacked.</title>
		<link>http://tagfl.com/2009/06/10/help-my-social-account-has-been-hacked/</link>
		<comments>http://tagfl.com/2009/06/10/help-my-social-account-has-been-hacked/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:52:36 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[habit]]></category>
		<category><![CDATA[identity protection]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://tagfl.com/?p=58</guid>
		<description><![CDATA[It's one thing to have your Twitter account hacked; its a whole different story to have someone clean out your bank account.]]></description>
			<content:encoded><![CDATA[<p>I large number of people I know have recently had their Facebook or Twitter (or both) <a href="http://www.kaspersky.com/news?id=207575670">account hacked</a>. Often times, they don&#8217;t even know until friends who&#8217;ve been receiving their tweets or updates start asking them if they really meant to post pornography. Of course the real downside to having one account hacked is that most people use the same password for different sites, including their online banking. It&#8217;s one thing to have your Twitter account hacked; its a whole different story to have someone clean out your bank account.</p>
<p>In truth, some accounts are actually hacked by viruses, but that&#8217;s a <a href="http://tagfl.com/2008/09/28/how-to-crash-your-pc-part-3/">subject</a> I&#8217;ve <a href="http://tagfl.com/2008/09/06/how-to-crash-your-pc-part-2/">already</a> <a href="http://tagfl.com/2008/09/02/how-to-crash-your-pc-part-1/">handled</a>.</p>
<p>So what are we to do? The good news is there&#8217;s an easy process to protect your accounts:</p>
<ol>
<li>Never use the same password for more than one site</li>
<li>Use passwords that contain upper and lowercase letters, numbers and symbols</li>
<li>Use the above in a random fashion</li>
<li>Never type your password on a computer that has any possibility of infection</li>
</ol>
<p>There, now that you know what you need to do, practice safe computing and have a nice day.</p>
<p>What? That&#8217;s too hard? You can&#8217;t remember T$d63Fes% as a password? Thankfully, there&#8217;s an easier solution &#8211; use a password manager.</p>
<p>Password managers have been around for as long as there have been passwords. My first was a little black book that got washed one too many times. My second was a Palm Pilot, that I lost, and that probably got washed too. Fortunately, today&#8217;s solutions don&#8217;t risk the possibility of loss or accidentally getting washed. There are many to choose from, but the one I want to detail today is from <a href="http://lastpass.com">Lastpass.com</a>.</p>
<p>Lastpass is a browser plug-in for <a href="http://www.mozilla.com/firefox/">Firefox</a> and Microsoft browsers. By default, it replaces the insecure (yes, they are) password managers built-in to those browsers. Your passwords are actually saved on the Lastpass servers, freeing you from the possibility of losing all your passwords because of a computer failure. I know what you&#8217;re thinking &#8211; &#8220;But that gives somebody else my information!&#8221; Actually, no. Before any of your passwords are sent to Lastpass, they are encrypted with your master password. Lastpass uses <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard">256-bit AES encryption</a> which is as good (or better in most cases) as the federal government uses. Maybe that&#8217;s a bad example. How about &#8220;Its what geeks use.&#8221; There, that&#8217;s better.</p>
<p>There&#8217;s a whole lot of techno-babble I could <a href="https://lastpass.com/technology.php">detail and explain</a>, but suffice it to say that Lastpass gives you secure access to really secure passwords. I&#8217;m not going to explain how to install it either, find out at their <a href="https://lastpass.com">website</a>.</p>
<p>The real beauty of Lastpass is the password generator, which will give you all of the requirements above. When you use the password generator, you can pretty much guarantee you have a secure password. The design of passwords is customizable for websites that support one style of password but not another (upper/lowercase OK, symbols not OK).</p>
<p>Since Lastpass stores EjaJ9LQ$z%Y^ for you, you don&#8217;t have to remember it. Simply visit the site you want and Lastpass will automatically fill in your username and password for you (HINT: If it doesn&#8217;t automatically fill in your password, press ALT-PGUP which is the key combination to cycle through all passwords for that site).</p>
<p>You&#8217;ll still need to go back through sites and generate new passwords to be secure, but Lastpass should automatically detect the password change and prompt you to save it.</p>
<p>&#8220;But, what about when I&#8217;m not on my PC?&#8221;</p>
<p>The lastpass.com website allows you to login and access your passwords from any PC, also granting you the ability to sign-in to a website directly from lastpass.com without ever typing anything.</p>
<p>Lastly, if you don&#8217;t trust the PC you&#8217;re using &#8211; maybe a internet cafe or hotel computer &#8211; you can use one-time passwords. These passwords are exactly what they sound like &#8211; they allow you to login <em>one time</em> with that password. So, even if somehow, someone captures your password, its useless once you&#8217;ve used it. Of course, you do have to set these up in advance.</p>
<p>There really is no excuse for bad passwords anymore. With the Lastpass plug-in and the lastpass.com website, you have secure password management, offsite storage and one-time use protection when you&#8217;re not at your PC.</p>
<p>Just remember to use a secure password for your Lastpass password. By the way, Bible verses make excellent passwords (Ephesians6:7, 1Corithians13:4-8).</p>
]]></content:encoded>
			<wfw:commentRss>http://tagfl.com/2009/06/10/help-my-social-account-has-been-hacked/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Automating Mondo</title>
		<link>http://tagfl.com/2008/04/10/automating-mondo/</link>
		<comments>http://tagfl.com/2008/04/10/automating-mondo/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 14:25:37 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Mondo]]></category>

		<guid isPermaLink="false">http://tagfl.com/?p=5</guid>
		<description><![CDATA[Backing up your Linux system using Mondo and an external USB hard drive]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure at some point I&#8217;ll get around to expounding the various virtues of backups and how those who don&#8217;t ensure that their clients are backing-up should be burned at the stake, but that&#8217;s another post. What I really want to talk about is <a href="http://www.mondorescue.org/">Mondo</a>.<span id="more-5"></span></p>
<p>If you&#8217;ve never heard of Mondo, I&#8217;m not surprised. Mondo is a Linux backup program designed to be reliable, easy and comprehensive &#8211; which all backup suites should be. Here are some excerpts from the about page:</p>
<blockquote><p>&#8230; backs up your GNU/Linux server or workstation to tape, CD-R, CD-RW, DVD-R[W], DVD+R[W], NFS or hard disk partition. &#8230; you will be able to restore all of your data, from bare metal if necessary. Mondo is in use by Lockheed-Martin, Nortel Networks, Siemens, HP, IBM, NASA&#8217;s JPL, the US Dept of Agriculture, &#8230;</p>
<p>Mondo supports LVM 1/2, RAID, ext2, ext3, JFS, XFS, ReiserFS, VFAT, UFS, and can support additional filesystems easily: &#8230; software raid as well as most hardware raid controllers. &#8230; Mondo runs on all major Linux distributions &#8230; You may even use it to backup non-Linux partitions, such as NTFS.</p>
<p><strong>Mondo is free!</strong> It has been published under the GPL v2 (GNU Public         License), &#8230;</p></blockquote>
<p>A few of things you might have noticed there:</p>
<ol>
<li>Mondo is a Linux backup program. I stated this before, but I want to make sure all the Windows users out there know what they&#8217;re missing. You can use Mondo to backup a Windows-only workstation, but that&#8217;s another post too.</li>
<li>Large companies (probably larger than you deal with) use this software. You probably don&#8217;t have the resources to test every configuration that you&#8217;ll run into, but they most likely have.</li>
<li>This is FREE software. Everyone will know before long that I&#8217;m a huge proponent of free software. Best of all, should you need commercial support, it&#8217;s there!</li>
</ol>
<p>Now, let&#8217;s get started.</p>
<p>I&#8217;m going to assume your distribution already has Mondo in their repositories or that you already know how to download and install a package. If not, maybe I&#8217;ll cover <em>that</em> in another post. I&#8217;ll also assume that you can read documentation and that you can figure out the command-line options for Mondo. The intention of this post is to help you automate Mondo so you can use it for a daily backup.</p>
<p>My particular need of this solution came at the time a client&#8217;s 10/20 Travan drive failed, and the purchase of a new one combined with maintenance of tapes was more than finding a modern solution. I had used Mondo once before to backup up my own personal system before moving to a larger drive, so I had some experience with it.</p>
<p>I know very little about BASH scripting, just enough to get myself in trouble, so if there are huge glaring errors in my script, feel free to point them out in the comments and I will feel free to ignore them as I rewrite the script in Perl. <img src='http://tagfl.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  I called my script <strong>makemondobackup</strong>; inventive I know.</p>
<blockquote><p><code>#!/bin/bash</code></p>
<p>#Setup some static variables<br />
DATABASE=/etc/mondo/database<br />
MNT_POINT=/backup<br />
SCRIPT=&#8221;MMBK&#8221;<br />
TMPDIR=/tmp/makemondo.$RANDOM</p>
<p>#Functions<br />
function logOut() {<br />
echo -n $SCRIPT&#8221; &#8221;<br />
echo -n $(date +%H%M%S)&#8221;: &#8221;<br />
echo $1<br />
}</p>
<p># Check for the old log. I don&#8217;t think it appends, but why take the chance.<br />
if [ -f /var/log/mondo-archive.log ]; then<br />
logOut &#8220;Deleteing old mondo-archive.log&#8221;<br />
rm -f /var/log/mondo-archive.log<br />
else<br />
logOut &#8220;Old mondo-archive.log does not exist&#8221;<br />
fi</p>
<p># Mount the drive if not mounted.<br />
MNT_INFO=$(mount | awk -v mnt=$MNT_POINT &#8216;{ if ($3 == mnt) print $0 }&#8217;)<br />
#&#8217; To fix sysntax coloring in mc<br />
if [ "$MNT_INFO" == "" ]; then<br />
logOut &#8220;/backup Not Mounted&#8221;<br />
mount /dev/sda1 /backup<br />
else<br />
logOut &#8220;/backup Mounted&#8221;<br />
fi<br />
MNT_INFO=$(mount | awk -v mnt=$MNT_POINT &#8216;{ if ($3 == mnt) print $0 }&#8217;)<br />
#&#8217; To fix sysntax coloring again in mc<br />
if [ "$MNT_INFO" == "" ]; then<br />
logOut &#8220;/backup Still Not Mounted. Something went wrong.&#8221;<br />
exit<br />
fi</p>
<p># What backup device are we using?<br />
VOLUME=`ls $MNT_POINT | grep -i &#8220;Volume_&#8221;`</p>
<p>#logrotate -f /etc/mondo/mondologrotate<br />
# Count the number of previous backups on the drive, looking for directories beg<br />
inning with &#8220;20&#8243;<br />
MYBACKUPS=(`ls $MNT_POINT | grep &#8220;^20&#8243; | sort`)<br />
logOut &#8220;I found ${#MYBACKUPS[*]} backups&#8221;<br />
while [ ${#MYBACKUPS[@]} -gt 6 ]; do<br />
logOut &#8220;Too many backups, deleting oldest ${MYBACKUPS[0]}&#8221;<br />
rm -rf /backup/${MYBACKUPS[0]}<br />
#    sed &#8216;/${MYBACKUPS[0]}/ d&#8217; &gt; &#8220;$DATABASE.tmp&#8221;<br />
grep -v ${MYBACKUPS[0]} $DATABASE &gt; &#8220;$DATABASE.tmp&#8221;<br />
mv -f $DATABASE &#8220;$DATABASE.bak&#8221;<br />
mv -f &#8220;$DATABASE.tmp&#8221; $DATABASE<br />
MYBACKUPS=(`ls $MNT_POINT | grep &#8220;^2&#8243; | sort`)<br />
done</p>
<p># Name for backup folder<br />
DATE=$(date +%Y%m%d-%H%M%S)<br />
# Create the temp and backup directories<br />
logOut &#8220;Creating $TMPDIR&#8221;<br />
mkdir $TMPDIR<br />
logOut &#8220;Creating /backup/$DATE&#8221;<br />
mkdir /backup/$DATE</p>
<p># Actual mondoarchive command<br />
# -Oi = create iso files<br />
# -d = where to backup to<br />
# -E = Exclude these directories<br />
# -S -T = Temp dirs<br />
# -p = prefix for iso files<br />
# -0 = compression level [0-9]<br />
# -F = do not write floppy images<br />
CMDTORUN=&#8221;mondoarchive -Oi -d /backup/$DATE -E /backup -S $TMPDIR -T $TMPDIR -0<br />
-F -p $HOSTNAME&#8221;<br />
logOut &#8220;Executing: $CMDTORUN&#8221;<br />
touch /backup/$DATE/mondo-run.log<br />
$CMDTORUN 2&gt;&amp;1 &gt; /backup/$DATE/mondo-run.log</p>
<p># Check the exit code to see if everything went OK<br />
if [ "$?" -ne "0" ]; then<br />
logOut &#8220;We didn&#8217;t exit correctly. Not cleaning up $TMPDIR.&#8221;<br />
else<br />
logOut &#8220;Good exit. Cleaning up $TMPDIR.&#8221;<br />
rm -rf $TMPDIR<br />
logOut &#8220;Adding $DATE $VOLUME backup to $DATABASE&#8221;<br />
#Write the backup info to the database<br />
echo &#8220;$DATE $VOLUME&#8221; &gt;&gt; $DATABASE<br />
fi</p>
<p># Finally copy the backup script and other necessities<br />
mkdir /backup/$DATE/etc<br />
cp -rf /etc/mondo/* /backup/$DATE/etc<br />
mkdir /backup/$DATE/images<br />
cp -rf /root/images/* /backup/$DATE/images<br />
cp /var/log/mondo-archive.log /backup/$DATE</p>
<p># Email the report. Don&#8217;t need to do this now.<br />
#mailx -s &#8220;server-$DATE&#8221; nunya@biznes.com &lt; /backup/$DATE/mondo-archive.log</p>
<p>#Unmount the drive<br />
umount /backup</p></blockquote>
<p>My script requires a few things to be setup that the next version will automatically take care of. First, we expect the external drive to be <strong><em>sda1</em></strong>; if this is different on your system, change the mount line. Second, we expect each external drive to have a &#8220;label&#8221; (a file indicating what Volume number it is), so you have to label each drive by hand. Third, I expect you are allowing Mindi (Mondo&#8217;s cousin) to run so that we have bootable CD images that are copied to the backup. I can&#8217;t imagine why you wouldn&#8217;t, but people do odd things. Fourth, the file <strong>database</strong> must be created as the script will probably crash horribly without it. Lastly, everything should be placed in <strong>/etc/mondo</strong> as that was the arbitrary place I decided they should go.</p>
<p>The script takes care of mounting the drive (if it&#8217;s not already mounted), creating the backup directory on the external drive, running mondoarchive (the actual Mondo backup command), cleaning up after and unmounting the drive so the someone can change them out. It also copies the log file if everything went ok, and leaves it where it is, if it didn&#8217;t. I&#8217;ve left my numerous comments in, hopefully they help you understand my original design.</p>
<p>I run the script using a single cronjob, saved in <strong>/etc/cron.d</strong> and called <strong>mondo</strong>, detailed here:</p>
<blockquote><p><code># Regular cron job for backup</code></p>
<p>SHELL=/bin/sh<br />
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin</p>
<p># Every day at 7:30p<br />
0 19 * * 1-5    root    test -x /etc/mondo/makemondobackup &amp;&amp; /etc/mondo/makemondobackup | mailx -s &#8220;Backup Run Log&#8221; nunya@biznes.com<br />
#</p></blockquote>
<p>Obviously, you want to change the email address for the logs to go to; poor Nunya has enough logs to read on his own. Don&#8217;t forget an empty line at the end of your cronjob. You will spend many hours trying to figure out why you script doesn&#8217;t run.</p>
<p>If you are monitoring backups for your clients, <em>check your logs every morning</em>. If you didn&#8217;t get a log, find out why. I recently picked up a client whose previous consultant let them get 30 days behind on backups. They didn&#8217;t find out until they had a drive failure. It is going to happen. Drive failure is a &#8220;when&#8221;, not an &#8220;if.&#8221; Your clients will respect you so much more if they can recover quickly.</p>
<p>I love Linux for the simple fact that anything difficult can be made simple. I have run about three months of backups using this script and test about every other week. I have had yet to have a backup fail or fail to restore.</p>
<p>My hope is that this script and Mondo can help you automate those servers that aren&#8217;t getting regular backups; there are far too many of them out there. External drives are cheap folks, make your backups.</p>
]]></content:encoded>
			<wfw:commentRss>http://tagfl.com/2008/04/10/automating-mondo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
