Aurgasm.us and The Hott Infinite Scrollage

Filed under: Quick Code — Written by Chrissy on Wednesday, October 31st, 2007 @ 7:04 pm

While visiting one of the best music discovery blogs ever, aurgasm.us, I noticed that the author, Paul Irish, had implemented a really slick Infinite Scroll AJAX technique which smoothly loads the next set(s) of posts without loading a new page.


This blog is awesome and the
author wrote some sweet code.

I was so impressed by the cross-browser compatibility and usability that after checking the copyright and seeing it was GPL'd, I added a slightly modified version of Paul's code to my own blog. I then changed the AJAX loading gif to one that I found @ this ajax gif generator and turned the code into a Wordpress plugin. In talking to Paul, however, I discovered that he and his friend are working on a plug-in too and theirs will actually have options. So I won't be releasing mine but if anyone can't wait until theirs is released, you can download my super simple version here. Your posts must be in the content div (which is generally the case with themes) for this to work. You may also want to remove any Next and Previous prompts.

You can see this plugin in action on the homepage of this blog or at the original source, aurgasm.us.

Wordpress Security Whitepaper and a Random Tip

Filed under: Security — Written by Chrissy on Tuesday, October 30th, 2007 @ 10:03 am

I found a pretty good Wordpress Security Whitepaper over at BlogSecurity.net. I followed most of the techniques, especially those that concerned protecting the wp-admin directory, since that's what got me hacked last time.

Also, today, while installing 8 GB of RAM into my virtual server and after more than a decade of taking computers apart, I finally figured out an easy way to keep track of those tiny computer screws. I took a Post-it, turned it upside down and used the glue strip to keep the screws all in one place. Granted I try to stay away from hardware because I tend to catch it on fire, but I can't believe how long it took for me to figure that out.

All Sorts of Stuff

Filed under: Tech Stuff — Written by Chrissy on Thursday, October 25th, 2007 @ 8:00 pm

First and foremost, I'd like to wish netnerds.net a happy birthday!


I'm 10!

"NetNerds.net" turned 10 years old on October 22, 2007. I wanted to post that day but I got hacked and didn't want to post again until I fixed the problem. So how did I end up with the name netnerds.net? Well, I called my best friend Jenny and asked for name suggestions for a new computer company I was starting. Almost immediately, she came up with the name "netnerds" and I thought it was fantastic. Netnerds.com was taken and I was "stuck" with .net but as it turns out, I ended up strongly preferring netnerds.net anyway; it just makes more sense.

Being a poor/broke student, I phoned my dad and asked for $70 to register the domain at Internic. He obliged and I jumped on it. Three days later, I kid you not, I had an offer from someone else who wanted to buy the domain name. I refused and he wasn't happy at all -- he bought a similar domain and proceeded to DOS me over the course of the next few years. Recently, I actually found the Conceal Firewall (remember that?) logs for his attacks in 99.

Over the years, I've done so many different things with netnerds. It's been running a combination of SuSE and Windows since 98 or so. Before that, it was hosted at random places but when I moved to California on December 23, 1997, I brought it home with me where it stayed till I started colocating it in 2004. I got an @Home cable modem in early January '98 and started hosting my own DNS, mail, and websites and haven't stopped since. The guy who taught me about running DNS eventually ended up giving himself a rootshell and a backdoor on my little server. As soon as I figured it out, I shut down my crappy 486 Linux machine and purchased the book Practical Unix and Internet Security.

I dove head first in learning all about protecting myself. It's worked decently well; I'm even planning to get my CISSP in January.

So 10 years later, I got hacked again. I don't think it was anything too drastic on the system itself but the web and mySQL passwords seem to be compromised. Like most exploits, it happened because I was running outdated software. I didn't know Wordpress 2.0.2 was so exploitable.

The first strange thing I noticed was that someone created a Wordpress account, even though I explicitly disabled allowing users to create accounts. I logged into my admin panel to find out wtf but I kept getting a "database is out of date" error. Oh poo! So I checked my logs and found some unusual behavior. Dang, Gina. Now I know I'm hacked so what about backups? Well, I had a backup of my entire blog VM from days earlier but for some reason unknown to me, decided to delete it so restoring recent backups were not an option.

I wanted to find out more about the compromise so I replaced my hacked admin files with some old backups and was able to login. I immediately noticed that someone posted a secret entry titled "ris.jpg." I did a locate to find ris.jpg on the filesystem but nothing came up. Eventually, I would find it in /tmp and it looked really nasty. You can see a copy of it here: ris.txt. Notice the password upload calls to nst.void.ru. Ugh. In researching the guy's IP, it turns out it's likely a linkbot from Estonia. This guy got hit by him/it/her too.

I don't like to take any chances so I created a whole new VM from scratch. I exported only the comments and posts from my 3 hosted blogs and recreated everything else. This is why it took 14 or so days to bring the blog back to life. It would have been earlier but I'm still dealing with my RSI shoulder injury that recently and seemingly magically turned into a torn rotator cuff injury. It's going to require surgery so I'll be out of commission in December after I graduate from the University of San Francisco with a BS in IS Yay :D. Hopefully I can study for the CISSP during my downtime.

So the lesson I learned, Corey? Keep my stuff up to date, even on Linux. I've now got automatic updates setup in SuSE and I'm signing up for the Wordpress update mailing list. Oh and h0bbel, I did attempt to find a new blogging platform (including Habari) as you know but none were as mature, targeted and functional as WP. Plus, I kind of have to use WordPress, Matt Mullenweg has eateth my chicken-n-shrimp gumbo and stocked my fridge with Pumpkin flavored beer. It's only right ;)

PowerShell: Parse an RSS Feed and E-mail/Text Yourself the Results

Filed under: PowerShell, Quick Code — Written by Chrissy on Thursday, October 25th, 2007 @ 1:30 pm

I'm so excited -- my best friend and tech partner-in-crime, Brandon, recently picked up PowerShell after I gave him a copy of Wrox's Professional PowerShell. He totally loves it and has already created a few new PowerShell scripts and converted other ASP.NET/VBScript scripts. One of his favorite scripts checks the Woot.com RSS feed and e-mails him with the daily item. He reduced a 25 line VBScript to a 5 line PowerShell script which goes something like this:

$rssUrl = "http://www.woot.com/blog/rss.aspx"
$blog = [xml](new-object System.Net.WebClient).DownloadString($rssUrl)
$results = $blog.rss.channel.item[0].title
 
$smtpmail = [System.Net.Mail.SMTPClient]("smtp.san.rr.com")
$smtpmail.Send("me@netnerds.net", "xxxxxxxxxx@vtext.com ", "Woot Deal", $results)

Five silly lines! PowerShell is just so straightforward:

1) Assign URL to a variable
2) Create a new WebClient and pull the RSS Feed into it.
3) Assign the value of the first title element to a variable
4) Create a SMTP Client and assign it the value of the smtp host
5) Access the Send Method and pass it (From, To, Subject, Body)

He then used Task Scheduler (tasksch) to run the script each night.

Another script he wrote checks for backups older than seven days then deletes them. If you use this script, be sure to remove the -whatif if you are happy with the results.

foreach ($file in (get-childitem -Path C:\backups\))
{
  $curTime = [System.DateTime]::get_now()
  if ($file.LastWriteTime -gt $curTime.Add("-7"))
   {
    remove-item -recurse $file -whatif
   }
}

For the record, I have Professional Windows PowerShell (Wrox/Andrew Watt), Windows PowerShell Cookbook (O'reilly/Lee Holmes, MSFT) and PowerShell in Action (Manning/Bruce Payette, MSFT). I suggest reading all three of them, in that order. The Wrox and O'reilly books provide the "how" while Payette's book provides the "why?". All three are very well written, especially the Cookbook, for which I was a technical editor ;)

ris.jpg huh?

Filed under: Security — Written by Chrissy on Friday, October 12th, 2007 @ 7:05 am

Hai. I got hacked. brb.

8-bit tie, 8-bit face

Filed under: Tech Stuff — Written by Chrissy on Friday, October 12th, 2007 @ 3:15 am

Hah! I bought an 8-bit tie the other day from ThinkGeek. It arrived, I sported it at work much to everyone's pleasure then I went home and took an action shot.

My smile in the picture looked silly but the tie was rockin so I 8-bitted my face and submitted it to ThinkGeek. I checked out the page today and there I are!


mosaic in the house

In other news, Microsoft is awesome (but y'all already knew that). I dropped by their SF office today to pick up some swag for a gathering I'm having and they gave me the coolest swag of my life -- some wine tools (thermometer, corker, uncorker thing, something else I don't know how to use) in a cherry wooden box w/ a gold placard that reads "SQL Server 2005." Receiving this gift comes at the perfect time too, I've been drinking wine like a fish since I moved to the Italian part of San Francisco a couple months ago.

Thanks, Microsoft. You are and will always be my favorite overlords.

Love,
Chrissy

Install VMware Server 1.0 on SuSE 10.2 x64

Filed under: Linux, Virtualization — Written by Chrissy on Tuesday, October 2nd, 2007 @ 11:55 am

Ahh! One of my servers had a bad stick of RAM and caused all sorts of problems with VMWare ESX Server. At first, I thought ESX was too sensitive but later realized the stick was just super bad. Meanwhile, my evaluation version expired and so I decided to use VMware Server 1.0 (free) on top of SuSE 10.2 (also free).

Thankfully, this dude setup a really nice guide to get around some kernel issues in SuSE. It's pretty simple; before installing the VMware Server RPM, I ran the following:

# cd /usr/src/linux
# make mrproper; make cloneconfig; make modules_prepare

After installing the RPM, I ran vmware-config.pl and VMWare complained that a few files were missing. As it turns out, I needed the x86 version of a few packages. I loaded up
Yast -> Software -> Software Management -> Search -> [X] Provides -> [Missing Filename here]. I believe I ended up installing the following packages:

Several.. (many auto-selected themselves)

xorg-x11-libICE-32bit-7.2-13.x86_64.rpm
xorg-x11-libXau-32bit-7.2-8.x86_64.rpm
xorg-x11-libXdmcp-32bit-7.2-8.x86_64.rpm
xorg-x11-libSM-32bit-7.2-12.x86_64.rpm
xorg-x11-libX11-32bit-7.2-13.x86_64.rpm
xorg-x11-libXext-32bit-7.2-12.x86_64.rpm
xorg-x11-libXrender-32bit-7.2-12.x86_64.rpm
xorg-x11-libXt-32bit-7.2-13.x86_64.rpm
expat-32bit-2.0.0-32.x86_64.rpm
xorg-x11-libXfixes-32bit-7.2-13.x86_64.rpm
xorg-x11-libXmu-32bit-7.2-13.x86_64.rpm
xorg-x11-libXp-32bit-7.2-8.x86_64.rpm
xorg-x11-libXpm-32bit-7.2-12.x86_64.rpm
xorg-x11-libXv-32bit-7.2-8.x86_64.rpm
xorg-x11-libxkbfile-32bit-7.2-12.x86_64.rpm
zlib-32bit-1.2.3-33.x86_64.rpm
freetype2-32bit-2.2.1.20061027-11.x86_64.rpm
xorg-x11-libXprintUtil-32bit-7.2-8.x86_64.rpm
xorg-x11-libfontenc-32bit-7.2-12.x86_64.rpm
fontconfig-32bit-2.4.1-19.x86_64.rpm
xorg-x11-libs-32bit-7.2-19.x86_64.rpm
audit-libs-32bit-1.2.6-20.x86_64.rpm
cracklib-32bit-2.8.9-20.x86_64.rpm
libstdc++41-32bit-4.1.2_20061115-5.x86_64.rpm
libxcrypt-32bit-2.4-30.x86_64.rpm
db-32bit-4.4.20-16.x86_64.rpm
pam-32bit-0.99.6.3-24.x86_64.rpm

Next, used YaST to open up my firewall's port 902. Everything seemed to go well until I ran into PAM issues while attempting to remotely manage it using the VMWare Server Console (Windows). I received the error Permission denied: Login (username/password) incorrect. So I took a look at /var/log/messages and found this crappy news:

vmware-authd: PAM unable to dlopen(/usr/lib/vmware/lib/libpam.so.0/security/pam_unix2.so)
vmware-authd: PAM [error: /usr/lib/vmware/lib/libpam.so.0/security/pam_unix2.so: cannot open shared object file: No such file or directory]

After searching the web for a solution (thanks web!), I edited /etc/vmware/pam.d/vmware-authd and now it looks like the following:

#%PAM-1.0
#auth       sufficient       /usr/lib/vmware/lib/libpam.so.0/security/pam_unix2.so shadow nullok
#auth       required         /usr/lib/vmware/lib/libpam.so.0/security/pam_unix_auth.so shadow nullok
#account    sufficient       /usr/lib/vmware/lib/libpam.so.0/security/pam_unix2.so
#account    required         /usr/lib/vmware/lib/libpam.so.0/security/pam_unix_acct.so
auth sufficient /lib/security/pam_unix.so shadow nullok
auth required /lib/security/pam_unix_auth.so shadow nullok
account sufficient /lib/security/pam_unix.so
account required /lib/security/pam_unix_acct.so

Once that was done, I created a symbolic link to make restarting VMWare more comfy (ln -s /etc/init.d/vmware /usr/sbin/rcvmware), then I restarted the vmware service (rcvmware restart) and connected successfully from my remote machine. Now I'm happily installing Windows Server 2008 RC0. Hooray!

And my procrastination paid off -- while I was waiting for the motivation to troubleshoot the RAM issue, the price of my server's RAM dropped drastically -- from $160 to $99. Niiiice! I'm buying 5 for a total of 8 Gigs :D