Archives Under "Planet Ubuntu" (RSS)
Check how much web bandwidth your users are using
15 April 2008 | Planet Ubuntu, Programming | 6 Responses
This is the ckbw script I briefly mentioned earlier. Before going any deeper into the subject, realize that this script assumes some things about your system:
- You are using the “combined” Apache2 log format.
- Logs are stored as /home/username.logs/domainname.com.access.log and compatible logrotate (.1, .2, etc) equivalents.
In a general sense, ckbw parses through all log files in the above directory and gets a file size total for all items used. Some things, such as unbuffered PHP scripts, will not return a file size and so will not be counted. Be sure that you at least have a month of logs if using logrotate or data can not be reported accurately.
Onto the script itself:
ckbw script; Perl
Basic usage:
ckbw apr - grab the bandwidth used in April on the current user
sudo -u bob ckbw apr - get the bandwidth used in April by “bob”
The script is hardcoded to grab the bandwidth per user and not per site, but it should be very easy to adapt it for a getting stats of a single site.
If anyone has a more elegant way of grabbing the output of system() or similar without piping to a file, let me know.
DreamFAIL
12 April 2008 | Planet Ubuntu, Random | 2 Responses
I have no issues with DreamHost’s service. Before I moved to a VPS provider, I was with them for all of my hosting. They had provided (and still do provide) great service and reliability for a shared host. Customer service for the most part is excellent, and gets things done in usually 5 minutes to an hour.
But when your signup form begs you not to leave, then you better run as fast as you can.
When trying to close the page:
- An alert appears.
- A confirmation dialog appears.
- If you hit Cancel, the “live chat” appears.
- Trying to close the “live” chat yields another confirmation box.

While I’m at it, might as well join the parade:
jacob@codechunk:~$ history|awk '{a[$2]++ } END{for(i in a){print a[i] ” ” i}}’ |sort -rn|head
108 sudo
56 cd
36 tail
35 ls
31 svi
28 vi
19 screen
19 fg
17 ckbw
14 htop
svi = sudo vim
ckbw = script to check bandwidth on an apache site.
There you have it.
MOTDs are boring
10 March 2008 | Planet Ubuntu, Random | 3 Responses
I’ve decided my MOTD has gotten stale. What better to do with your free time than to look up escape sequences?

Bringing annoyances to the terminal, one color code at a time.
Snow.
8 March 2008 | Planet Ubuntu, Random | 7 Responses
Yesterday morning at a hotel, I woke up to prepare for a presentation. I looked out the window and there was a light snow. No problem.
Skip to noon of that day. A winter storm warning is in effect. 8 to 10 inches of snow expected. Okay, we can still make it out of Columbus.
By 4 PM, a blizzard warning was in effect. 12 to 15 inches projected by the end of Saturday (today).
This morning, I woke up to a level 3 snow emergency (only emergency personnel allowed on the roads). Everything is covered in snow, and it doesn’t look like it is going to stop.
How bad did the snow hit the rest of you in Ohio or the Midwest?
The dog seems to like it.

SSH loves rDNS
4 March 2008 | Planet Ubuntu, Random | 6 Responses
Since a few weeks ago, every time I would run SSH to sign into my server I would have to wait about a minute before I could even get a key/password prompt. The problem never really went away, so I contacted my ISP.
After a few email exchanges with some SSH debug logs and traceroutes, they added a reverse DNS record to see if it helped. Strangely enough, it did. I’ve never had a reverse DNS entry associated with my IP, and I’ve never had any trouble with it in the past. Only recently did connections start to halt because of it.
So, if you don’t have a reverse DNS entry on your IP and have been noticing slow SSH connections, call up or email your ISP to get one added. You will love your connection that much more.
Video Editing
22 February 2008 | Planet Ubuntu, Ubuntu | 3 Responses
Peter Upfold made a very valid point about the state of Linux video editing:
So here I throw it out to you. Has anyone out there had experience with FOSS-based Linux screen capture and does anyone have any ideas on how I could rework the way I do things to make this better? Even if it involves radically changing the set of tools I am using, I am open to any ideas that could solve the problem.
We’ve got all of these projects coming up like PiTiVi, but for getting the job done now, what would be the best way to have a go at video without hacking around between formats too much?
I was also sucked into this 5-a-day fad. How long will I last?
–
My 5 today: #194578 (ubuntu), #194486 (firefox-3.0), #194522 (ssh-askpass), #194482 (gvfs), #194526 (gnome-control-center)
Do 5 a day - every day! https://wiki.ubuntu.com/5-A-Day