Archive for 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!

OMFGWTFBBQ! No more Gimp?

November 26th, 2009  |  Published in Ubuntu

Seriously, is removing Gimp from a default install of Ubuntu that bad? Bad enough for you to leave Ubuntu for some other distribution? I have been reading blog posts, news sites, blog comments, IRC, Twitter, and Identi.ca, and what I am seeing simply amazes me. Thus far, the popular topic to these complaints is that Ubuntu is making the desktop even dumber. So, if Ubuntu is making the desktop dumber, I guess in the past it has made many lazier? I mean, installing Gimp isn’t a big deal. I am a Kubuntu user, and KDE user of other distros, and none off the top of my head include Gimp. Just now, I had to reinstall my system because my hard drive blew up. In just over a minute I had Gimp, the Plugin Repo, and Inkscape installed. And for you all who are going crazy over the decision, just know that the developers of Gimp agree with the decision:

“That is pretty much in-line with our product vision. GIMP is a high-end
application for professionals. It is not the tool that you would advise
every user to use for their casual photo editing. And as far as I
understand this, it’s not that GIMP would not be available for Ubuntu
users. It’s simply not installed by default.

Sven”

HERE is a comment from the Gimp world supporting it, HERE is another, and another. I use Zsh, Ubuntu doesn’t ship that by default, I am going to go take a turkey hostage now!

Simmah down nah! It isn’t the end of the world. When Ubuntu switches to KDE in 2012, then it will be the end of the world!

Kubuntu DocBook/XML 101

November 23rd, 2009  |  Published in Documentation, Kubuntu, Tutorial, Ubuntu

So, you keep hearing me talk about contributing to Kubuntu documentation, and you see that I say it would be nice for you to have some DocBook/XML experience. Many people want to help, but they don’t have that experience. In most cases, the people interested at least understand HTML or some other markup language a little bit. If you can understand that, then you can easily understand DocBook/XML the way we use it for Kubuntu documentation. DocBook/XML has a lot of tags that one can use, however we only use a very small subset of those tags with our documentation. Just an idea of the main tags we use from DocBook/XML are:

  • <sect1>
  • <sect2> – sometimes
  • <title>
  • <para>
  • <ulink>
  • <example> – sometimes
  • <mediaobject> – only for screenshots
  • <imageobject> – only for screenshots
  • <imagedata> – only for screenshots
  • <acronym> – sometimes
  • <guibutton> – sometimes

There might be a few more, but these are the ones that pop into my head. For instance, when you are trying to let the reader know to open up an application via the menu, there is a tag called <menuchoice>. We have an entities file that contains all of the menu stuff, so you wouldn’t even need to use that tag, as you would call it in the document you are working in. Example: Say you are trying to tell the user how to open Amarok, you would enter &menuamarok;. Easy!

Here is an HTML example, lets say, Hello World :)

<html>
<head>
<title>Hello, World!</title>
</head>
<body>
<p>Hello, World!</p>
</body>
</html>

The html, head, and title, are already taken care for you with the template, so you just need to do the part in between the <p> and </p>. So in DocBook/XML, that would look:

<para>Hello, World!</para>

Easy. Typically with HTML, when you are trying to show a section or make a section stand out, you might use <h1> to make the title stand out. Well in DocBook/XML there are a few more lines, but still easy to do:

HTML:

<h1>This is the title of the section</h1>
<p>This is a paragraph in the section.</p>
<p>This is another paragraph in the section.</p>

DocBook/XML:

<sect1 id="intro">
<title>This is the title of the section</title>
<para>This is a paragraph in the section.</para>
<para>This is another paragraph in the section.</para>
</sect1>

If you are looking for a little bit more information concerning documentation in the Ubuntu world, take a look at the Documentation Team Wiki Page. There is also a bit of information on how we use Bazaar when working with documentation as well. To get an idea of how we use DocBook/XML with Kubuntu documentation, take a look at the old Jaunty Documentation for Kubuntu. Under the docs/ directory you will find the topics covered. And then under the topic, in the C/ folder is the XML markup for that topic. There is obviously a bit more DocBook/XML markup in our documentation, but the header portion and the layout is already completed in a template, so all one would need to do is fill in the space and create new sections.

If you have any questions, please do not hesitate to stop by the Ubuntu Documentation IRC channel on Freenode in #ubuntu-doc and ask away. We also have a mailing list where you can ask questions and communicate via email to other documentation people.