- What about the other Ponzi shemes?
- Crash Proof - A must read if you care about your savings
- Today only - Quickbooks Pro 2009 for free (after main-in rebate)
- Stop using Internet Explorer
- Dell coupon codes
- Beware the bouncing Checker rebate check
- Detroit CEOs time valued at $0/hr
- My promise to be a better driver
- Propane tanker crash
- Free Dr. Pepper for everyone!
System Administration
Getting Yammer to work with IM on Google Apps for your domain
Submitted by altj on Mon, 11/17/2008 - 12:01Our company uses Yammer so everyone can stay in touch and post status updates easily. One problem we've had is that the IM component wouldn't work with our google talk accounts (we use Google Apps for our domain.) I discovered here that all we needed were some additional entries in DNS.
After following that doc, our settings for that service are as follows (trimmed for readability):
$ dig SRV _xmpp-server._tcp.familylink.com. ... ;; ANSWER SECTION: _xmpp-server._tcp.familylink.com. 600 IN SRV 5 0 5269 xmpp-server.l.google.com. _xmpp-server._tcp.familylink.com. 600 IN SRV 20 0 5269 xmpp-server1.l.google.com. _xmpp-server._tcp.familylink.com. 600 IN SRV 20 0 5269 xmpp-server2.l.google.com. _xmpp-server._tcp.familylink.com. 600 IN SRV 20 0 5269 xmpp-server3.l.google.com. _xmpp-server._tcp.familylink.com. 600 IN SRV 20 0 5269 xmpp-server4.l.google.com. ... $ dig SRV _jabber._tcp.familylink.com. ... ;; ANSWER SECTION: _jabber._tcp.familylink.com. 600 IN SRV 5 0 5269 xmpp-server.l.google.com. _jabber._tcp.familylink.com. 600 IN SRV 20 0 5269 xmpp-server1.l.google.com. _jabber._tcp.familylink.com. 600 IN SRV 20 0 5269 xmpp-server2.l.google.com. _jabber._tcp.familylink.com. 600 IN SRV 20 0 5269 xmpp-server3.l.google.com. _jabber._tcp.familylink.com. 600 IN SRV 20 0 5269 xmpp-server4.l.google.com. ...
After making those changes, I was able to go into my yammer account and add my google talk account like normal. I assume the same thing will work with Twitter, if you use a google apps account for that (assuming IM is working on Twitter, which it hasn't for months for me.)
It's an easy fix for Yammer with your Google Apps account. I'm also in the process of setting up yammer for my family's domain so we can stay in touch more easily. I think the thing I love most about Yammer is that I can send/receive updates from my phone.
Keep an eye out for some upcoming blog posts about ways to stay connected with your family (hint: Yammer is one of them)
Performance increase with Amazon's EBS (persistent storage)
Submitted by altj on Tue, 09/02/2008 - 10:55
At familylink.com, we have 4 MySQL database systems on EC2 that run that our facebook app, various other social network apps and various websites. I recently switched our disk storage for those instances from the standard EC2 instance disks to EBS (Amazon's persistent storage for EC2) and wanted to share some brief numbers with you regarding performance.
I'm using a simple (yet quite complex) metric to measure the performance increase, load. System load is a number that show how many processes are contending for system resources (usually CPU.) For a more detailed description of load, read this article.
Enough of the talk, here's what I saw when I switched the 4 databases over to EBS:
---Database server #1---
Purpose: 2 moderately used databases
Disk change: 2 striped local disks (raid0) to single EBS volume
Peak Load change: 2.5 to 1
Estimated disk performance increase: 5x
---Database server #2---
Purpose: 2 lightly used databases
Disk change: 2 striped local disks (raid0) to single EBS volume
Peak Load change: 1.5 to 0.5
Estimated disk performance increase: 6x
---Database server #3---
Purpose: 9 lightly used databases
Disk change: 2 striped local disks (raid0) to single EBS volume
Peak Load change: 1 to 1 (no noticeable change)
Estimated disk performance increase: 2x
---Database server #4---
Purpose: 1 heavily used database
Disk change: 4 striped local disks (raid0) to 4 striped EBS volumes (raid0)
Peak Load change: 3 to 1.5
Estimated disk performance increase: 2x
Keep in mind that in theory 2 striped disks are almost twice as fast as a single disk. That's why I say there's a disk performance increase of 2x on database server #3 even though there was no noticeable performance increase (we went from using 2 disks to 1 disk.)
There you go, real-world numbers from real-world sites and servers. In summary, it's safe to say you'll see a significant disk performance increase if you switch over to using EBS with your EC2 instances. In addition to the performance increase, it's a no-brainer that you want persistent storage for your databases. One other huge benefit is snapshots. You can quickly and easily snapshot your database for backup purposes or for testing/reporting you may want to run against your most recent production data. See Amazon's site for more details.
If you haven't yet tested EBS with your systems on EC2, now is the time.
Red Bull gives you wings...or a big headache
Submitted by altj on Mon, 07/28/2008 - 13:23
Last week, I was at the Facebook developers conference. It was a pretty good conference and I learned a lot. Here are a few things I learned:
- Some companies still operate with their blinders on: One of the sessions I was most excited about was "Made for Mobile." I was hoping for some insight into developing apps for mobile phones and maybe some new "stuff" from Facebook. I was sorely disappointed. This session should have been named "Made for iPhone." Instead of ranting in this post, I think I'll do a dedicated post to the blinders concept.
- Facebook is on the cutting edge when it comes to social networks: They announced Facebook Connect. If you're a digg/citysearch/six apart user, you can see its effects already. It's a new and easy way to put a social network twist on any site (using Facebook of course.)
- Red Bull gave me a headache: The hardest stuff I regularly drink is Mountain Dew. Red Bull was a sponsor at this conference and as a result, the stuff was given out. I decided to give it a shot. The taste wasn't very good. I'm a Guaraná Antarctica fan and so I'm a little picky when it comes to guarana. The taste of this took guarana and made it disgusting. To top it all off, within about 10 minutes of drinking it, I got the worst headache I've had in a long time. Needless to say, it didn't give me wings and I don't think I'll be trying it again.
- Facebook does an awesome job at scaling: This is the stuff I really love. In one session, the explained how they handle the high load demand due to their feeds. Their feeds are what displays all of your friends' activity/actions on the main page when you're logged in. If you think about it, that's a lot of data. Just to generate your custom feed they have to go out and get all of the recent feed items from all your friends, filter and prioritize them, and then display it on a nice pretty page for you to see. And they do it all in around 60 milliseconds. Man, that's fast!
Over 5,000,000 phpBB sites hacked
Submitted by altj on Thu, 05/15/2008 - 09:39I see no problem with running phpBB, but there are so many people that don't keep their software up to date. This is one reason why I hate to have 50 different types of software running on my servers. It's just more to keep track of and hard to stay up to date on everything.
Here's a link to the ComputerWorld article.
Oh that reminds me, I need to update my version of wordpress. BRB.
OpenSolaris on Amazon's EC2, Yay!
Submitted by altj on Mon, 05/12/2008 - 14:36
For us UNIX fans, Sun Microsystems is working with Amazon to offer OpenSolaris on EC2.
I'm not sure how I missed it, but they made the announcement last week.
I just signed up to be included in the beta. I'll post an update here when I get in and start tinkering. My main focus is going to be the performance of MySQL on EC2 comparing Linux with OpenSolaris.
I'm not sure what their long term plans are, but for now they aren't incurring any extra charges (beyond the standard EC2 charges.) I know that RedHat charges extra to run their Enterprise version on EC2.
Multimedia, Entertainment & Distractions In (K)ubuntu
Submitted by altj on Thu, 05/08/2008 - 08:53
To help you get the most out of (K)ubuntu, be sure to enable Medibuntu as a source for packages. This will allow you to easily play those wmv files and DVDs on Linux as well as most other multimedia that use proprietary formats.
The steps for setting it up involve running three commands (Details here)
For me, it was a matter of running:
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O /etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
sudo sed -e 's/ non-free//' -i /etc/apt/sources.list.d/medibuntu.list
Good luck!
My interrupt-driven life
Submitted by altj on Wed, 04/30/2008 - 12:52
Here I am, peacefully working at my computer when I'm interrupted by a text message on my phone:
** PROBLEM alert - someserver.somewhere.com/SSH is CRITICAL **
That's not a good thing. Hoping it's a false alert, I try to ssh in. No luck. I try again. Still no luck. And a third time, Yes! I'm in. Let the troubleshooting begin.
I check to see what processes are running and sure enough, I find a culprit. There are a ton of sshd processes going. I take a look at auth.log and it's full of "Failed password for root from 218.145.160.100 port 55739 ssh2" messages (about 9,000 of them.) Here's what's going on: someone is trying to login to the server most likely by trying a bunch of passwords in a brute force attack. A brute force attack consists of trying every possible password until you find the right one. The attack doesn't really concern me since I don't allow password logins on most of the servers I manage. The excessive login attempts are a little annoying.
One command later and all traffic from that IP address drops into oblivion.
iptables -A INPUT -s 218.145.160.100 -j DROP
With that band-aid applied, it's time to get something better in place for the long term. A while back there was some discussion about preventing or slowing down such attacks on the SLLUG email list and some people posted scripts they use to deal with it. Here is my current version of one of those scripts:
#!/bin/bash
case "$1" in
start)
# Put IP addresses for allowed hosts into this, separated by spaces.
SSH_ALLOWED="123.45.67.89 98.76.54.32"
iptables -A INPUT -p icmp -m state --state NEW,ESTABLISHED --icmp-type echo-request -m limit --limit 2/s -j ACCEPT
iptables -A INPUT -s 127.0.0.1 -j ACCEPT
# Allow TCP/UDP connections out. Keep state so conns out are allowed back in.
iptables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
# Allow ICMP out and anything that went out back in.
iptables -A INPUT -p icmp -m state --state ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT
#put any custom rules for you rserver in this section
iptables -A INPUT -s 218.145.160.100 -j DROP
iptables -A INPUT -p tcp -m tcp --dport 111 -j REJECT
iptables -A INPUT -p tcp -m tcp --dport 11211 -j DROP
iptables -A INPUT -p icmp -j DROP
iptables -A INPUT -p udp -j DROP
#now for the ssh stuff
iptables -N SSH_Brute_Force
iptables -F SSH_Brute_Force
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j SSH_Brute_Force
for IP in $SSH_ALLOWED; do
iptables -A SSH_Brute_Force -s $IP -j RETURN
done
iptables -A SSH_Brute_Force -m recent --name SSH --set --rsource
iptables -A SSH_Brute_Force -m recent ! --rcheck --seconds 60 --hitcount 5 --name SSH --rsource -j RETURN
iptables -A SSH_Brute_Force -j LOG --log-prefix "SSH Brute Force Attempt: "
iptables -A SSH_Brute_Force -j DROP
;;
stop)
iptables -F
iptables -X SSH_Brute_Force
;;
*)
echo "Usage: $0 {start|stop}" >&2
exit 1
;;
esac
This is an init script, so I put it in my /etc/init.d directory and set it up to run when the server boots up. What it does is only allows 5 SSH connection attempts per minute based on the source's IP address. From there, it blocks and logs any connection attempts. Two words of warning when working with IP tables; be careful. It's very easy to block yourself from accessing your own server. I've done this more times than I care to mention and had to take a drive to the datacenter or call their helpdesk to make things available again.
Recovering data after a Windows crash
Submitted by altj on Wed, 03/12/2008 - 09:12
My brother recently ran into problems with his laptop running Windows XP. I thought I'd share an easy method to recover files when you are unable to boot into Windows due to the dreaded blue screen of death or other OS problem. Keep in mind that this may not help you if you have a hardware problem. (But I've been able to recover a significant amount of data on systems with hardware problems using this method.)
Step by Step Windows file recovery
Required items
- Knoppix CD (free download)
- External hard drive (USB)
6 Easy Steps to recover your files
- Plug in your external drive. (That was easy, right?)
- Boot from the Knoppix CD. You may have to modify your BIOS settings if the system tries to boot from the hard drive. With my brother's laptop, it was as easy as putting in the CD and holding the "c" key down when I saw the Toshiba splash screen come up.
- At the
boot:prompt, just hitEnter. It will take a few minutes for the system to boot up. - On your desktop, you should see multiple Hard Disks listed. Each of these is a partition that Knoppix found while booting. Single-click on them to open them up and see what's in there (no need to double-click.) One of the drives will be your external drive.
- Copy the files you need from your systems disk(s) to your external drive. You can do this by either dragging and dropping the files/folders or you can copy (Ctrl-c) and paste (Ctrl-v).
- (Optional) Install Linux so you don't have to worry about the dreaded blue screen of death anymore (or viruses, spyware, defragmenting your hard drive, paying license fees, degrading system performance, etc...) My favorite version is Kubuntu. You can download a CD here and try it out without actually installing it on your computer. Keep in mind that it will be slow if you are running it from the CD (CDROM drives are sooo much slower than hard drives.)
Using ReWrite rules for URL parameters
Submitted by altj on Mon, 02/11/2008 - 23:33So, I was just contacted about a blog post that was accidentally deleted and recreated. Unfortunately, links to the old post had already been sent out. I wanted to use ReWrite to send anyone going to:
http://theblogdomainname.com/?p=376
to:
http://theblogdomainname.com/?p=375
a simple edit to my .htaccess file and viola! it works:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^p=375(.*) [NC]
RewriteRule ^.*$ http://theblogdomainname.com/?p=376%1 [R=301,L]
One nice thing about this is it preserves any parameters following the "p" parameter. In this case, additional parameters were being used in the URL for tracking.
Ubuntu AMI for Amazon EC2 large & xlarge instances
Submitted by altj on Wed, 12/19/2007 - 13:57
I just released another Ubuntu public AMI for Amazon EC2. This one is nearly identical to the first one I released except it can be used with large and extra large instances.
Here are the current tech specs and costs for the different instance sizes:
Small Instance (Default) - $0.10/hr
1.7 GB of memory, 1 EC2 Compute Unit (1 virtual core with 1 EC2 Compute Unit), 160 GB of instance storage, 32-bit platform
Large Instance - $0.40/hr
7.5 GB of memory, 4 EC2 Compute Units (2 virtual cores with 2 EC2 Compute Units each), 850 GB of instance storage, 64-bit platform
Extra Large Instance - $0.80/hr
15 GB of memory, 8 EC2 Compute Units (4 virtual cores with 2 EC2 Compute Units each), 1690 GB of instance storage, 64-bit platform
