Archive for December, 2009

Byobu shows me next meeting

December 30th, 2009  |  Published in Tutorial

Have I ever told you all how much I love byobu? I have always used screen, though I really never tweaked it all crazy like many did. Recently I typed screen at the command line and I was presented with this thing called byobu. I went ahead and gave it a shot, and at first I will say I was rather annoyed with the bar at the bottom of my screen, and my scrollwheel didn’t work with byobu the way it did with screen. I went ahead and changed my workflow in order to get used to byobu. A couple of weeks ago, I got nosey, and wanted to know how byobu was doing its thing. After a while of messing around, and seeing everything it could display, I wanted more! And since quite a few of you on IRC wanted it, well here it is.

See, I use the cli more than I do the desktop, which is weird seeing as I am an avid KDE lover and hacker. Here is my current workflow via the command line:

With byobu, I have it set up to automatically create 5 windows (the 4 above, plus a regular zsh shell). Since I use the command line so much, I tend to forget about meetings from time-to-time as I don’t get any warning of them, until it is either to late or I have totally missed it. So I thought, since I use the command line so much, how can I have something simple to show me the next meeting. Then I thought: I could use gcalcli to read the Fridge meeting calendar, and then have the next meeting output to the bar in byobu, so I will always see the next meeting. Currently with byobu, it isn’t the easiest thing in the world to add custom items such as this, but I have been told they are coming soon! Awesome!

So, here is what my new addition looks like:

To get this, I had to do the following:
Step 1: Create crontab task
Create a crontab task to create a file in my home directory that contains a list of meetings:

*/5  * * * * gcalcli --nc --ignore-started agenda "`date`" > $HOME/.gcal_agenda.txt

Step 2: Create a script for byobu
Create the following script (/usr/lib/byobu/gcal_agenda) and then make it executable:

#!/bin/sh
if [ "$1" = "--detail" ]; then
        head -2 /home/nixternal/.gcal_agenda.txt | tail -1
        exit 0
fi
GCAL=$(head -2 /home/nixternal/.gcal_agenda.txt | tail -1)
printf "\005{+b }%s\005{-} " "$GCAL"

Step 3: Add a tick to the common profile
In /usr/share/byobu/profiles/common, you need to add the following:

backtick 200    67      67              byobu-status gcal_agenda

Add this line right after the last backtick line you see.

Step 4: Add output to the hardstatus string
We need to add the number 200 that represents our backtick in the previous step to the hardstatus string line in $HOME/.byobu/profile. profile is a symbolic link to the current color profile you are using in bybobu, so if you ever change your theme, you will lose this setting until you add it to the next theme. Here is what my hardstatus string line looks like in $HOME/.byobu/profile:

hardstatus string '%99`%{= kw} %100`%112`%= %102`%101`%200`%127`%114`%115`%108`%128`%125`%126`%113`%119`%117`%116`%106`%104`%103`%105`%107`%123`%120`%121`'

That is all on one line. See the %200 in that line, that is our gcalcli output. That is the one we need to add in there.

Step 5: Make byobu use it
For some reason, byobu didn’t automatically pick up my new script in /usr/lib/byobu, even after reloading (F5), so I added gcal_agenda=1 to $HOME/byobu/status, did a reload (F5), and it was there.

I think this is everything, hopefully I didn’t forget anything. If you try it, and it doesn’t work, let me know.

EDIT: I am a moron, not /var/lib, but /usr/lib. I have made the changes to the post already. Also make sure you have gcalcli up and running with your calendars first. To add the fridge calendar, you subscribe to it from your Google calendar.

EDIT: I redid the last 3 steps because I totally forgot them originally. Thanks to Chris Johnston to pointing this one out!

Everyone is late to the game

December 15th, 2009  |  Published in Personal

Last night as I went to bed, I turned on the television to see what was on. This is typically the way I fall asleep. I came across this movie titled, “The First $20 Million is Always the Hardest” from 2002. In this movie, 4 researches split off from some big research company to create a $99 PC. Where have I heard that one before? Oh, they were only off by a $1. Then, in order to make this $99 PC, they had to get rid of so much, they got rid of things such as:

  • Hard drives
  • CDROM drives
  • Floppy drives
  • and more…

This got them to thinking, if we get rid of all of this, then how in the hell will this PC work? Their answer, put the software on the Internet! Here are a couple of quotes from the movie:

  • “The world needs a cheap portable computer, Casper. Third world school children want to join the information age.”
  • “Your mother uses Macintosh!”

The movie was quite hokey, and what they created was a small computer that looked like a toy of some kind from the Star Trek set. It used a hologram instead of a monitor, and it had icons that roughly represent the icons that Google uses today, except when you clicked on email for instance, the little envelope sprouted wings and flew up to be read. So in 2002, a movie starts talking about our so-called cloud computing buzz word, a $99 PC, and makes fun of the Mac kids. We are just a bit late to the game now, time to innovate something else :)

RE: SSH Tab Complete

December 5th, 2009  |  Published in Tutorial

This is a response to SSH Tab Complete by Michael Lustfield.

Create a ~/.ssh/config file and populate it with configurations. Doing this is the only step you need to do, and you don’t need to add anything to your ~/.bashrc. Example ~/.ssh/config:

# foobar.com
Host foobar
    Hostname foobar.com
    User xxxxxxxxxxxxx
 
# Home server (internal)
Host iserver
    Hostname 10.0.0.2
    User xxxxxxxxxxxx
    Port ####

Host is a simple word that will be used with ssh like ssh foobar. Hostname is the actual IP address of domain name of the server. User is your username for that machine. Port is the ssh port number, if it isn’t the default port of 22.

So, when I want to ssh into my home server, I just do ssh is, press tab, then enter. There are many more options to add to the config file as well, and a simple Google search will provide more. Also man ssh_config will give you pretty much everything you need as well.

Awesome!

December 1st, 2009  |  Published in Community, Documentation, Kubuntu

docawesome_sm

AWESOME! This definitely shows that the Kubuntu community has grown over the past couple of years, even among the complaints, we seem to be succeeding, and this makes me super happy. Just over a week ago, I decided that we were going to totally wipe out the current set of Kubuntu documentation and start from scratch. My buddy Jonathan Jesse, the 2nd Kubuntu docs dude, was freaking. He was like, “that sounds like a lot of work!” Oh, it did, but our awesome community has stepped up and is taking control, writing documentation, and good documentation at that. I am really grateful to all of you who are helping, and because of you, there is no doubt in my mind that our docs will finally kick ass again!