Trixbox Phone Home

At work we use tons of open source software. Off the top of my head, I can name15:

  1. Gentoo, both desktop and server
  2. Apache 2
  3. Subversion
  4. MySQL
  5. OpenLDAP
  6. Zend Framework
  7. phpMyAdmin
  8. phpLDAPadmin
  9. MediaWiki
  10. Aptana
  11. PuTTy
  12. Mozilla Firefox
  13. Mozilla Thunderbird
  14. Open Office
  15. trixbox

That last one, trixbox, made the news recently when it was recently discovered that the software contacts a Fonality server once every 24 hours by itself. This process sends information about the hardware setup it’s running on and a few configuration details. This is all done via allowing a remote server to execute root-privileged commands on the local box. You can read this forum thread for more details.

The problem here is mainly that no one knew any of this was happening. So, naturally, when people find out about it, they feel duped. Now, this certainly should have been a better described “feature”, sure. But, I’m not overly concerned about it. The script doesn’t gather anything like phone numbers or email addresses. The theoretical problem is if this “feature” was abused in some way. It looks like their in the process of updating this part of their system and I’m satisfied with the changes they’re making to correct the potential problems with it.

Linux Customization With .bashrc

This post will explain what a .bashrc file is and how it can be used to customize your usage in a Linux environment. It will explain what alias and export are used for. Also it will explain how easy it is to create functions. Finally, to tie it all together, it will explain how to set up a colored system-status display that will be shown when you first log into your machine via the command line.

What is a .bashrc file?

A .bashrc file is a startup configuration file used with the Bourne-Again SHell (Bash). Bash is the most common shell on Linux systems, as far as I know at least; I would also assume it is on OS’s like Solaris and Mac OSX too, though I .

What is a .bashrc file used for?

The .bashrc file is used for personal aliases of commands, think shortcuts, and user-functions.

Some quick example .bashrc files

This Novell CoolSolutions page on configuring the .bashrc file is what prompted me to write this entry. This is a fairly lengthy .bashrc file example. You may also just want to google for more examples.

Aliases, Export, Functions, etc.

Alias

You can think of an alias just like you think of a shortcut on your GUI desktop. Effectively they are no different. Isn’t it easier to type something like web instead of cd /opt/lampp/htdocs. If I wanted to, I could have even shortened the alias to just w. Aliases allow you to quickly move around your system as well as execute complex commands with ease.

Export

The export system command can be used in a similar manner as alias. The main difference is that when using export, you create a system variable. An example of this usage is updating the default PATH system variable. For example: export PATH=$PATH:/sbin:/opt/lampp/bin/. This updates the PATH variable to include, what else, other paths. Programs, really the whole system, can access the value of this system variable by referring to $PATH. I mentioned that exporting variables can be used in a similar manner as an alias. An example of this would be creating a system variable called WEB, i.e. export WEB=/opt/lampp/htdocs. On the command line simply execute cd $WEB. This has the exact same effect as having the web alias mentioned above.

Functions

Understanding functions is really quite simple. A function simply wraps around a code block of system commands. An example will probably do the explaining for me:
netinfo () {
echo "---------------- Network Information ----------------"
/sbin/ifconfig | awk /'inet addr/ {print $2}
echo ""
/sbin/ifconfig | awk /'inet addr/ {print $3}
echo ""
/sbin/ifconfig | awk /'inet addr/ {print $4}
echo "------------------------------------------------"
echo ""
}

This block of code, this netinfo function, simply outputs my network information with some nice formatting. From the command line, all I’d have to do is type netinfo.

An example to put it all together

I will put the code here that will allow you to set up your own ‘Welcome / System Status’ display upon logging into your computer via command line. My comments and explanation of what is going on will be shown as comments in the actual code. At the very bottom will be a link to my actual .bashrc file which will include everything I’ve mentioned here.

# WELCOME SCREEN
#######################################################
clear; #remove anything above this welcome screen
for i in `seq 1 15` ; do spin; done ;echo -ne "${WHITE} Welcome to Apache01 ${NC}"; for i in `seq 1 15` ; do spin; done ;echo ""; # this will display a header
echo -e ${LIGHTBLUE}`cat /etc/SuSE-release` ; # this shows some information about my machine itself
echo -e "Kernel Information: " `uname -smr`;
echo "";
echo -ne "Hello $USER today is "; date
echo -e "${WHITE}"; cal ; echo ""; # some date / calendar info
echo -ne "${CYAN}";netinfo; # network info
mountedinfo; echo ""; # filesystem info
raidinfo; echo ""; # RAID info
echo -ne "${LIGHTPURPLE}";fortune; echo ""; # and for a little fun, a fortune
echo -ne "${LIGHTBLUE}Uptime for this computer is ";uptime | awk /'up/ {print $3,$4}' # machine uptime
for i in `seq 1 15` ; do spin; done ;echo -ne "${WHITE} Welcome to Apache01 ${NC}"; for i in `seq 1 15` ; do spin; done ;echo ""; #ending header
echo ""; echo ""

My .bashrc file

A note about the code snippets you see here: I do not claim to be the originator of all this code you see here. Though, much of the code can be found in various places around in the intarweb. Also, if you happen to see anything incorrect, please let me know!

And a question for my those who read this: What interesting things do you have in your .bashrc file?

FBI Scraping Half Billion Dollar Program

For reference, you should probably read this Yahoo article first.

Now my commentary…

Gotta love our government. Half a billion dollars down the tubes. I love how they’re still working on this program yet they’ve started soliciting offers for a new program to replace it at the same time.

And you know what the program does:

The prototype’s main feature allows users to prepare documents and forward them in a usable form.

and

Eventually, the FBI expects to have software with added features for managing records, evidence and other documents, along with the ability for users to collaborate on documents and share information online.

Jesus! What about this project can’t be done via the internet? Seriously. Prepare documents and forward them in usable form? What the hell is that? Sounds like email to me. Collaborate on documents and share information online? That just sounds like something you could just put on an encrypted network and then have like a Wiki or something along those lines, combine that in with the emailing of documents (mind you it could be heavy SSL or an equivalent).

I dunno, I just don’t get our government some times. This is my rant for the day.

Free Mini Mac and Free iPod Shuffle

If you haven’t heard, which you should have by the way, Apple announced two new products at their annual MacWorld conference: the Mac mini and the iPod shuffle. I won’t go into great detail about either one of them, as there are already tons of reports on them. However, I will quickly explain what they are.

The Mac mini is a Mac computer that retails at $499, the cheapest Mac to date. It comes with no keyboard, mouse, or monitor, however. If you don’t like your current PC, all you have to do is buy a Mac mini and replace it.

The iPod shuffle is a flash based iPod. It comes in sizes of 512MB and 1GB. Unlike the regular iPod and the iPod mini, there is no display to speak of. Thus, it is quite tiny.

That’s about that. Now, I want one of each, just because. So, from the people who brought you FreeiPods.com, Gratis Internet gives you:

Now, hook me up! Thanks!

My Up-coming DVD Collection

Ah Kansas City (Overland Park, really, but whatever). I have but one real friend here. I work all the time – at least 9 hour days, usually a little more. After dinner and maybe a trip to the gym, I’m usually reading a book on Access Programming. I guess that would make time for work or work-related things increase to around 12 hours. Nonetheless, with the little amount of free-time I do have, I don’t really do much. This coming weekend I’m going to Manhattan and Wichita, for picking up my mail and to a wedding, respectively. Odds are, I’ll be venturing back to KC on Sunday. So that leaves me one day to get little stuff done, like go to Wal-Mart, Target, etc. So, what can I do to during my down-time?

Oh, you had to ask, didn’t you? 😉 The answer is two-fold: NEC ND-3500A and Netflix.

I’ll briefly detail why I made the choices that I did.

First, the NEC ND-3500A. This is, arguably, the best DVD burner on the market today. Really, it was a toss up between this one, which is featured in Ars Technica’s November 2004 God Box and the Sony DRU-710A, featured in Maximum PC‘s Best of the Best. It should be noted, however, that Ars Technica tends to make recommendations for hardware prior to it being widely available. Also, Maximum PC is a magazine, so things are a little slow. The only difference that I can see between the two is that the Sony has an 8x write speed for DVD-R, whereas the NEC has a 16x write speed. Everything else is the same. Oh, I guess the NEC is also $26.00 cheaper.

Now, Netflix. This was a toss-up between Blockbuster and Netflix. If I were still in Manhattan, I’d have gone the Digital Shelf or Hastings maybe route. But, I’m in KC and I don’t have much free time. You may have heard about the little battle / price war / whatever between Netflix and Blockbuster. As far as I know, it ended and the result is that Blockbuster’s monthly rate is $15.00/month and Netflix is $18.00/month. Not a big difference. Also, I should note that Blockbuster also gives you two free in-store movie or game rentals each month.

So why did I choose the more expensive one? Well, Netflix has been in this business a lot longer than Blockbuster. And by this business I mean the DVD through the internet/mail thing. Netflix is known across the board for getting you movies very quickly. As in, usually one day. Plus, I’ve heard from people who’ve used both and are going back to Netflix. They cited a bigger catalogue of movies. So that’s nice. Plus, Blockbuster just seems very Corporate and I’m very not. Well, when I can be.

And that’s about it. Pretty soon my DVD collection will rival that of Barrett and even, dare I say it, Collin. W00t.