<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2803607842323892602</id><updated>2011-11-27T16:18:51.187-08:00</updated><title type='text'>Utah sysadmin</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://utahsysadmin.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2803607842323892602/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://utahsysadmin.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mike</name><uri>http://www.blogger.com/profile/10932962862795097257</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm2.static.flickr.com/1148/803153245_272950940a_o.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2803607842323892602.post-1760315174627437965</id><published>2009-11-17T17:28:00.000-08:00</published><updated>2010-03-30T10:30:13.361-07:00</updated><title type='text'>Restoring a file that still has an open filehandle on Linux</title><content type='html'>My &lt;span style="font-style: italic;"&gt;rm /var/log/access_log*&lt;/span&gt; was a little greedier than I wanted it to be. What I meant to use was &lt;span style="font-style: italic;"&gt;rm /var/log/access_log.*&lt;/span&gt; :-( . Never fear, apache didn't know I had deleted the file as it had an open filehandle and was happily logging away, but how to restore it? Check out the step by step:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;# lsof | grep access_log&lt;br /&gt;apache2    1649       root    8w      REG        8,1        0    4334715 /var/log/apache2/access_log (deleted)&lt;br /&gt;apache2   15265   www-data    8w      REG        8,1        0    4334715 /var/log/apache2/access_log (deleted)&lt;br /&gt;apache2   15266   www-data    8w      REG        8,1        0    4334715 /var/log/apache2/access_log (deleted)&lt;br /&gt;# cd /proc/1649/fd&lt;br /&gt;# ls -alh&lt;br /&gt;total 0&lt;br /&gt;dr-x------ 2 root root  0 2009-11-17 18:31 .&lt;br /&gt;dr-xr-xr-x 7 root root  0 2009-11-17 16:15 ..&lt;br /&gt;lr-x------ 1 root root 64 2009-11-17 18:32 0 -&gt; /dev/null&lt;br /&gt;l-wx------ 1 root root 64 2009-11-17 18:32 1 -&gt; /dev/null&lt;br /&gt;l-wx------ 1 root root 64 2009-11-17 18:32 2 -&gt; /var/log/apache2/error_log&lt;br /&gt;lrwx------ 1 root root 64 2009-11-17 18:32 3 -&gt; socket:[5823]&lt;br /&gt;lrwx------ 1 root root 64 2009-11-17 18:32 4 -&gt; socket:[5824]&lt;br /&gt;lr-x------ 1 root root 64 2009-11-17 18:32 5 -&gt; pipe:[576841]&lt;br /&gt;l-wx------ 1 root root 64 2009-11-17 18:32 6 -&gt; pipe:[576841]&lt;br /&gt;l-wx------ 1 root root 64 2009-11-17 18:32 8 -&gt; /var/log/apache2/access_log (deleted)&lt;br /&gt;# cat 8 &gt; /var/log/apache2/access_log &amp;amp;&amp;amp; /etc/init.d/apache2 stop &amp;amp;&amp;amp; /etc/init.d/apache2 start&lt;br /&gt;&lt;/pre&gt;Woot!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2803607842323892602-1760315174627437965?l=utahsysadmin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://utahsysadmin.blogspot.com/feeds/1760315174627437965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://utahsysadmin.blogspot.com/2009/11/restoring-file-that-still-has-open.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2803607842323892602/posts/default/1760315174627437965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2803607842323892602/posts/default/1760315174627437965'/><link rel='alternate' type='text/html' href='http://utahsysadmin.blogspot.com/2009/11/restoring-file-that-still-has-open.html' title='Restoring a file that still has an open filehandle on Linux'/><author><name>Mike</name><uri>http://www.blogger.com/profile/10932962862795097257</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm2.static.flickr.com/1148/803153245_272950940a_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2803607842323892602.post-181106422582997788</id><published>2009-10-12T07:31:00.000-07:00</published><updated>2009-10-12T07:36:36.708-07:00</updated><title type='text'>Making sure PTR records and A records match</title><content type='html'>DNS is so simple! Unfortunately it seems like it's simple to screw up also, here's a little script I wrote the other day to verify that all my reverse dns was setup correctly. I've written this script before at least twice, so I thought I would post it. Just feed it a CIDR range via command line and it will check all those ips. Like this:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;# perl ptrchecker.pl 192.168.0.0/24&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;use NetAddr::IP;&lt;br /&gt;use Socket;&lt;br /&gt;use strict;&lt;br /&gt;&lt;br /&gt;foreach my $cidr(@ARGV) {&lt;br /&gt;    my $n = NetAddr::IP-&gt;new( $cidr );&lt;br /&gt;    for my $ip( @{$n-&gt;hostenumref} ) {&lt;br /&gt;      next if ($ip-&gt;addr() =~ /\.[0|1|2]5?5?$/);&lt;br /&gt;      my ($name,$aliases,$addrtype,$length,@addrs) = gethostbyaddr($ip-&gt;aton(), AF_INET);&lt;br /&gt;      my $addr = join ".", unpack('C4', (gethostbyname $name)[4]);&lt;br /&gt;      print "busted ip: " . $ip-&gt;addr() . " PTR is $name, A is $addr\n" if ($ip-&gt;addr() ne $addr);&lt;br /&gt;      #select(undef, undef, undef, 0.05); &lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2803607842323892602-181106422582997788?l=utahsysadmin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://utahsysadmin.blogspot.com/feeds/181106422582997788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://utahsysadmin.blogspot.com/2009/10/making-sure-ptr-records-and-records.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2803607842323892602/posts/default/181106422582997788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2803607842323892602/posts/default/181106422582997788'/><link rel='alternate' type='text/html' href='http://utahsysadmin.blogspot.com/2009/10/making-sure-ptr-records-and-records.html' title='Making sure PTR records and A records match'/><author><name>Mike</name><uri>http://www.blogger.com/profile/10932962862795097257</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm2.static.flickr.com/1148/803153245_272950940a_o.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2803607842323892602.post-7756115865440727181</id><published>2009-10-08T08:29:00.000-07:00</published><updated>2009-10-08T14:12:30.477-07:00</updated><title type='text'>Installing smartear on Ubuntu Jaunty</title><content type='html'>First &lt;span style="font-weight: bold;"&gt;apt-get remove pidgin&lt;/span&gt;&lt;span&gt;. Don't do any autoremoving, you might need some of those devel packages later on. Next, hop on over to &lt;a href="http://www.pidgin.im/"&gt;pidgin's&lt;/a&gt; and &lt;a href="http://somewhere.fscked.org/proj/smartear/"&gt;smartear's&lt;/a&gt; sites and download source tarballs.&lt;br /&gt;&lt;br /&gt;Extract both tarballs, you will then need to compile pidgin from source. I did have to disable video and voice capabilites, that's fine for me. But if you want them you will need to find the correct libraries.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# apt-get -y remove pidgin&lt;br /&gt;# apt-get -y build-dep pidgin&lt;br /&gt;# ./configure --disable-vv&lt;br /&gt;# make install&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Now it's time to get into that SmartEar tarball. If you check out the INSTALL file you will see that you need to edit the Makefile and change the PIDGIN_SRCDIR to whatever directory you compiled pidgin in. So:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;PIDGIN_SRCDIR=../whatever_directory_you_untared_to/pidgin&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then just run make install:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;# make install&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Done!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2803607842323892602-7756115865440727181?l=utahsysadmin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://utahsysadmin.blogspot.com/feeds/7756115865440727181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://utahsysadmin.blogspot.com/2009/10/installing-smartear-on-ubuntu-jaunty.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2803607842323892602/posts/default/7756115865440727181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2803607842323892602/posts/default/7756115865440727181'/><link rel='alternate' type='text/html' href='http://utahsysadmin.blogspot.com/2009/10/installing-smartear-on-ubuntu-jaunty.html' title='Installing smartear on Ubuntu Jaunty'/><author><name>Mike</name><uri>http://www.blogger.com/profile/10932962862795097257</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://farm2.static.flickr.com/1148/803153245_272950940a_o.jpg'/></author><thr:total>1</thr:total></entry></feed>
