SSH key forwarding
I recently built a new dev environment at work, based on DevCamps. I made significant changes and customizations for our needs at Skullcandy. As we've rolled camps out here and developers have adopted it, we've seen some common problems which are simple enough to fix but can be vexing to figure out.
The most common problem developers have run into is caused by they ssh keys not forwarding. It seems that this is not set by default pretty much everywhere, which I find confusing. So here are the first steps to ensure your ssh key is forwarding correctly:
- Make sure you are using an ssh agent to store and forward your keys. This seems obvious if you understand ssh forwarding, but it is surprising that this doesn't happen automatically on some systems (like Mac OS X). So you need to check to see if your ssh agent has your ssh key loaded. Do this with this command:
ssh-add -l
- You should see your ssh key(s) listed. If not, then run:
ssh-add
- Create or edit the file $HOME/.ssh/config on your workstation and make sure this line is present:
ForwardAgent yes
This should get you forwarding your ssh key. If you want to just forward your key on one connection only and not for all, then you can use the command line option to ssh to temporarily turn on forwarding, -A. Like this:
ssh -A user@somehost.com
Fast and easy way to send Apache logs to syslog
I keep forgetting how to do this and have to look it up every time, so I'm writing it down.
If you want to send Apache logs to syslog, it really is simple. I'm talking about RHEL/CentOS/Fedora servers with standard packages installed. Follow these simple steps:
In your Apache config where you set CustomLog, make that line look something like this:
CustomLog "|/bin/logger -p local1.info -t apache" combined
ErrorLog syslog:local1
Let's break this down and explain it....
Yet Another Ubuntu Upgrade
So Ubuntu 11.04 was release a few weeks ago and I decided to upgrade this weekend. In prep for the upgrade, I backed up my laptop onto my external portable hard drive that I may need (my home dir, and a few other things in /etc, some cronjobs, etc.). I then did a clean re-install from CD. In the past the ugrade-in-place has taken a long time, and was not completely problem free. Whereas the last time I did a clean re-install it was pretty much problem free- except getting all my personal files/configuration/settings the way I like them all back took some time. So that is the same approach I decided to take with this upgrade.
root@spencer-laptop:~# cat /etc/modprobe.d/wlan.confoptions iwlcore led_mode=1
Recent Ubuntu kernel upgrade made my wi-fi led blink; drives me crazy
Recently, I got a normal update popup from my Ubuntu Update manager. The update included a new kernel as well as other items. I usually wait a few days on kernel updates because they can make some things break (like virtual box) and I'll need to do some manual fix-up work afterwards.![]()
So I did the upgrade and after I noticed something new and very annoying. I use an HP laptop- Compaq 8510w, which has two led indicators for wi-fi. They have always simply been on when my wireless is on, or off when it is off. Never more than that. Well, after the upgrade those leds started blinking according to my wireless usage. At first I was like, "what the heck? What did I do to make that happen?" What ever it was, I was not pleased. It was so distracting that I was thinking of covering up those leds with black tape.
I then searched on google for any one else with a similar problem and I found one. Unfortunately I can't find it again right now, but the post I found mentioned the same latop and a similar problem but on Fedora.
Ubuntu 10.04 upgrade
I've been using Ubuntu for a few years now and quite like it. And when I saw they had released 10.04 I was excited to upgrade. The last two releases I did an upgrade-in-place with their upgrade tool and I didn't run into any major problems. So I did the same thing for this release. But that's where this story begins.
First I noticed that I was getting warnings and errors related to my X.org config. This was very alarming since I've never seen that before and I don't run any thing unusual in my x.org config. I tried a few different things to address it but could never really solve the problem. Then I noticed that rhythmbox was always crashing on me. Like all the time. Oh and my startup applications would never start up as they were supposed to. And compiz wouldn't work due to complaints about in correct driver even though I did install the correct one.
So after complaining about it for a week to my coworkers they suggested that I back up all my important stuff and then do a fresh install. Complety wipe it and install from scratch with 10.04. So I bought an external hard drive (500G) and did that. The fresh install was soooo easy and quick. I then carefully restored data back to my home folder. If you are doing this be careful not to copy back .gnome2 or .gvfs or anything .g* or at least be very cautious in doing so. Those could break things on an upgrade like this.
Conclusion- the fresh install worked beatifully. Ubuntu 10.04 works great and i'm not seeing any of the problems I had earlier. In fact it also fixed a completely separate issue I was having with my wireless card. So I'm definately still an Ubuntu fan.
How to: Set up a few virtual servers on your desktop
This is an attempt at a how-to for getting a few servers up and running that can talk to each other as well as with your host desktop machine all with vitrtualization. This has been a personal desire for some time and I have read documentation about how to do this and have tried multiple times, and every time it seems that the job is complex and error prone. So this how-to will describe how I finally was able to get it working with almost no effort! Yeah!
First of all, let's set the scene and give ourselves a goal: We want to have a VM web server and a VM database server running on our desktop that runs a simple web application. The two machines need to talk to each other. And we want to be able to open our desktop web browser and access the web application running on these VMs. And do all that without any complex configuration or breaking your desktop's network settings.
The first thing we will use in this setup is VirtualBox (http://www.virtualbox.org/)