March 11, 2010

Running Multiple Cassandra Nodes on a Single Host
One of the first Cassandra tickets I worked on had me reviewing some code that visualized the node ring.  Properly testing the code required that I run a cluster. 

But I didn't have access to a cluster. Neither did I feel like creating a virtual cluster by building a VM and cloning it several times.  What I wanted was to run several instances of Cassandra on a single machine with multiple interfaces, all pointed at the same compiled code (without multiple svn checkouts).

The Cassandra wiki explains how to tweak Cassandra settings by editing cassandra.in.sh, but doesn't explain what needs to be done to run concurrent instances.

It turned out not to be too difficult.  I figured it might be daunting enough to Cassandra noobs (of whom we're seeing more of lately due to some great exposure), that a blog post might be helpful. 

This tutorial assumes that you'll want to run multiple instances of Cassandra on code built by ant and not a standalone jar.  I am also assuming that you are a) just playing around, or b) intend to do some development.  This is not a tutorial explaining how Cassandra should be run in production.

Note: I apologize for the way this looks.  Blogger is not a friend of ordered lists.
  1. Make sure you've got aliases to localhost (e.g.: 127.0.0.2, 127.0.0.3, etc.).  Mac OS X doesn't have this enabled by default, so you'll have to manually create aliases:

    sudo ifconfig lo0 alias 127.0.0.2 up
    sudo ifconfig lo0 alias 127.0.0.3 up
  2. Decide where you're going to keep things.  You can keep them with your code, but that just isn't neat.  Pick a directory somewhere, call it $cass_stuff.
  3. Then, for each node in your little cluster, do this:

    1. From your svn checkout, copy the conf directory into $cass_stuff.  You can rename it to something like conf0 (or conf1, etc.).  I'll assume $conf from here on out.
    2. Copy bin/cassandra.in.sh to $cass_stuff.  Give it a name that helps you associate it with the conf directory you just created (node0.in.sh or whatever).
    3. Open node0.in.sh in an editor and make the following changes:

      1. Hardcode cassandra_home to the location of your trunk.  This will give you the flexibility to run Cassandra from anywhere.
      2. Set CASSANDRA_CONF to the conf directory you just created.
      3. In the JVM_OPTS change the jdwp address= setting.  The default is 8888, but you should include the unique IP you chose for this node along with the port, e.g.: 127.0.0.2:8888.  Not specifying a host causes the debugger to bind to 0.0.0.0:8888 and you'll have port binding problems when you bring up more than one node.
      4. pick a unique port for com.sun.management.jmxremote.port, but make sure you have at least one node listening on 8080 since all the Cassandra tools assume JMX is listening there.  Unfortunately, you can't pick the JMX host, 0.0.0.0 is assumed.  I was under the impression this could be changed by specifying java.rmi.server.hostname, but had no luck going down that road.  (Please leave a comment if you figure out a way for this to work, but I think it might be hopeless.)
    4. Open $cass_stuff/$conf/storage-conf.xml in an editor and make the following changes:

      1. specify unique locations for CommitLogDirectory and DataFileDirectory.  Don't bother with CalloutLocation or StagingFileDirectory.
      2. replace ListenAddress with the IP of your host.
      3. replace RPCAddress with the IP of your host.
To run you may wish to use another script for each node:

#!/bin/sh
CASSANDRA_INCLUDE=$cass_stuff/
export CASSANDRA_INCLUDE
cd
bin/cassandra -f

One downside to this approach is that if you're tracking trunk, it is your responsibility to make sure you notice changes to the default storage-conf.xml and cassandra.in.sh and apply them to your environments.

Cassandra is supported by an active and welcoming community.  If you'd like to learn more about the project, check out our wiki, mailing list or hop on #cassandra on freenode.
Benefit of Grub 2

The other day when compiling a kernel for a friend I had an interesting issue, Grub had been installed on a drive other than the root drive. Installing grub became something of an issue. Even though I ran update-grub after compiling the kernel I could not boot. But instead of an error like ‘grub error 22′ I was given a grub prompt. With that I could set the root drive and say where the kernel image and the initrd was and voila I was in business. Pretty sweet.

Once again a great example of *nix offering people solutions that are meant to work even in the most un-ideal situations. Anyone else have any good Grub 2 experiences?

Further reading: ubuntu community docs on Grub 2

March 10, 2010

Utah Blogger/Geek Dinner: March 2010

Please RSVP on Facebook.

Utah Blogger/Geek Dinner: March 2010

Thursday March 25, 2010 from 6:00pm - 8:00pm
Neil’s Halibut and Broiler
112 E 12300 S
Draper, Utah 84020 Get Directions

The Geek/Blogger Dinner is a monthly event for bloggers, web developers, free-lancers and anyone else who likes an evening of socializing and tech talk. Come with your stories, your conversations, and your questions to enjoy the food and camaraderie!

Arrive by 6:45 pm to be entered in the drawing for a laptop bag!

Sketchy wi-fi available from the Applebee’s across the street.

Fancy QSlider Stylesheet

Seriously. I don’t know how I ever created a Qt user interface without using stylesheets. This was, by far, the best idea Trolltech ever had.

For today’s show-and-tell, I give you a nifty-looking QSlider with some nice gradient style applied to it:

The handle has a nice hover effect, the bar has a moving gradient as you slide the slider, and it looks good when disabled. Notice also the rounded corners. No image files were harmed in the making of this widget.

Here’s the stylesheet code (I used Qt’s example as a starting point).

QSlider::groove:horizontal {
border: 1px solid #bbb;
background: white;
height: 10px;
border-radius: 4px;
}

QSlider::sub-page:horizontal {
background: qlineargradient(x1: 0, y1: 0,    x2: 0, y2: 1,
    stop: 0 #66e, stop: 1 #bbf);
background: qlineargradient(x1: 0, y1: 0.2, x2: 1, y2: 1,
    stop: 0 #bbf, stop: 1 #55f);
border: 1px solid #777;
height: 10px;
border-radius: 4px;
}

QSlider::add-page:horizontal {
background: #fff;
border: 1px solid #777;
height: 10px;
border-radius: 4px;
}

QSlider::handle:horizontal {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
    stop:0 #eee, stop:1 #ccc);
border: 1px solid #777;
width: 13px;
margin-top: -2px;
margin-bottom: -2px;
border-radius: 4px;
}

QSlider::handle:horizontal:hover {
background: qlineargradient(x1:0, y1:0, x2:1, y2:1,
    stop:0 #fff, stop:1 #ddd);
border: 1px solid #444;
border-radius: 4px;
}

QSlider::sub-page:horizontal:disabled {
background: #bbb;
border-color: #999;
}

QSlider::add-page:horizontal:disabled {
background: #eee;
border-color: #999;
}

QSlider::handle:horizontal:disabled {
background: #eee;
border: 1px solid #aaa;
border-radius: 4px;
}

Enjoy!

The Power of Pull
David Siegel

This week on the Technometria podcast, Scott and I talk to David Siegel, the author of The Power of Pull. David talked to me one or two times quite a while back about identity as he was researching this book, but I didn't really know what the book was about or why he cared about identity. In appreciation, he sent me a copy of the book when it came out and I left it sitting on my desk for a number of weeks before I picked it up. When I did, I was blown away.

I'm certain that the podcast won't do justice to the material in the book--you have to read it for the full impact--but maybe it will give you and idea of why this is such an important work.

For years, we've heard about the semantic web and mostly it's been a bunch of talk about RDF, ontologies, and so on. David's talking about the semantic web, but he does it by telling us how our lives will change when data is portable and systems can manage it without constant interaction with us. These changes--and they're inevitable--will change everything from health to commerce to how we play golf. What struck me as I've read the book was the shear ubiquity of the impact.

The title, Pull, comes from the central idea of the book that more and more people will pull things to them, rather than being at the receiving end of a push. I wrote about what that will mean to commerce in a blog post called Building Fourth Party Apps with Kynetx where I borrowed Doc Searls metaphor of the sewage pump as an apt descriptor for the current regime.

When I think of the changes that the Internet has caused in the last 15 years, I'm amazed, but I also realize that we're just getting a good start. There are myriad changes yet to happen and David has done a great job in this book of laying out what the next set of changes are likely to be, why they'll happen, and what it will mean for individuals and businesses.

The bottom line: this is the most interesting tech book I've read in a long time. I bought eight copies and spread them around the office because I wanted everyone at Kynetx to read it. You should read it too.

Tags: pull semantic+web data standards identity

My .bashrc File Part 5 - Pimping the Prompt

This is the final installment of my .bashrc series. PS1 is a variable that allows you to change your prompt environment. Here is my setting as found in my .bashrc file which I use to get the prompt above.

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

The numbers in the brackets represents colors. The \u option is username and \h is hostname which defines the first part of my command prompt. The second part of my prompt is indentified with /w which displays my current path which is shown above in blue.

Your possibilities are limitless when it comes to customizing your prompt and I don't have time here to list and explain all the options available, especially when the detail is readily available with a simple google search. Nevertheless, here are some links you might find useful to help pimp your prompt.

10 examples with syntax explanation.

This IBM article is a great resource as well.

I hope this series has been useful. Please share your pimped command prompt in the comments.

March 09, 2010

Mac Like??

I keep hearing how Mac like the new theme for Ubuntu 10.04 is. I prefer to view it as less Windows like than more Mac like :) .

SSL Cert Management in Linux

Maybe you have a ton of SSL certs you’ve purchased from different vendors and you’d like warning when they’ll expire.

http://prefetch.net/articles/checkcertificate.html has a free bash script that will check the certs for you and notify you when you need to renew.

first, run this to get the list of SSL sites on your apache2 server:

grep 443 /etc/apache2/sites-enabled/*.conf |grep ServerName|awk '{print $3 }'|uniq|perl -p -e 's/:/ /g'|sort|perl -p -e 's/\r//g'>currentssls.txt

then run the script to check each of those sites (as listed in the currentssls.txt file)

# ./ssl-cert-check -f currentssls.txt|sort -nk6|sed '/^$/d'|sed 1d
Host                                            Status       Expires      Days
www.example1.com:443                        Valid        Apr 16 2010  38
www.example2.com:443                          Valid        May 10 2010  62
www.example3.com:443                        Valid        May 14 2010  66

and now let’s add it to cron, instructing the script to send out an email 30 days before expiration:

# crontab -l
10 10 * * *  grep 443 /etc/apache2/sites-enabled/*.conf |grep ServerName|awk '{print $3 }'|uniq|perl -p -e 's/:/ /g'|sort|perl -p -e 's/\r//g'>currentssls.txt
30 10 * * * ~/ssl-cert-check -a -f ~/currentssls.txt -q -x 30 -e you@example.com
New phone on the way

I just got my new Nokia n900 ordered. I know it is a bit rough around the edges, but it should work splendidly for what I do. I’ll post a review here once I get it and have used it for a bit.

My favorite bash idiom

Stuart and I came up with a refinement to my favorite bash idiom today. It was:

find ... | while read FOO; do ...; done

as demonstrated in:

find . -name '*.mp3' -type f | while read MP3; do
    ffmpeg -i $MP3 ${MP3%.mp3}.m4a
done

This handles whitespace (except newlines) in filenames. Except that ffmpeg is sharing stdin with while, which can cause some very funky problems. This is safer:

find ... | while read FOO; do echo | (
    ...
); done

and while you’re at it, you might as well take into account the unlikely-but-possible corner case of a filename containing a newline:

find ... -print0 | while read -d $'\0' FOO; do echo | (
    ...
); done
loua1873-scalogram.jpg (2422×1932)
1873 unclustered heat map of demographic characteristics in Paris.


loua1873-scalogram.jpg (2422×1932)
Qt Layout Squashing

I’ve encountered this problem a handful of times over the past few years using Qt’s layouts. Qt generally does a great job making sure that your Windows cannot be resized too small such that your content would be truncated. However, it seems that introducing a QStackedWidget causes a problem.

These two screenshots illustrate the issue:

Screenshot 1 The widget prior to resizing (all text appears correctly)

Screenshot 2 The user resizes the widget (the text is truncated)

Like I said above, I think the problem is caused by the QStackedWidget. Without it, Qt properly limits the widget’s minimum size such that the text cannot be truncated. I would love it if the Trolls could have a look at this issue. I’ve seen the problem since Qt 4.0, but I never reduced the problem to its base (it took a while to deduce that the QStackedWidget was the culprit).

If you’re interested, I’ve included the minimal Designer UI file that shows the problem (right click that link to save it). I used Designer 4.6.2 to create this file.

#hackUTOS March 9th, 2010

Hey everyone, it is time to #hackUTOS again!

What is #hackUTOS?

UTOS has been sponsoring Open Source technologies in Utah for years now. This is a chance for all the members (and potential members) to come out meet some of the UTOS hackers including herlo, utahcon, and DexterTheDragon.

We will be hacking on ConMan, the Open Source Conference Management system used by UTOSC! This is a great chance for you to participate, learn,teach, and get credit toward attending the conference for a discounted price!

When is #hackUTOS?

We will be meeting Tuesday March 9th, 2010 at 7:00PM MST.

Where is #hackUTOS?

Online

Along with meeting in person (details below) you can find us online in IRC. We are on the Freenode network in #utos-dev

IRL

Since the meeting place worked out well last time we will be meeting again at the Salt Lake Coffee Connection.

Located at:

1588 South State Street, Salt Lake City, UT 84115

The Salt Lake Coffee Connection is a really great place to meet. They have a great internet connection (provided by our good friends at Xmission), awesome drinks (check out the Dirty Chai!) and good food! The prices are good, and internet access is included with all purchases.

What Language?

ConMan is written in Python, using the Django framework. We run it on MySQL and SQLite databases.

Don't know Python, or Django? Don't worry, we are all open to helping you get started. Please realize we are here to mainly work on our project, we are happy to offer light support to get you up and running.

If you aren't interested in working on ConMan bring your own Open Source project! We would love to have you in the house for some great co-working!

Compile and Install Star II (Ubuntu 8.04.4 LTS)
This is my second post about Star, a package of astronomy software for variable star research that some of my colleges use for their work. It was programmed by an astronomer at South African Astronomical Observatory (SAAO). My first post was how to get it compiled and running on CentOS 5.4. This post will show how to do it in Ubuntu 8.04.4 LTS.

I compilied Star using the Absoft (v8, 32-bit) Compiler. It's an older version of Absoft, but this is an old program. Follow the instructions as given with the software to install.

Be sure to download and install the patches (libfio in particular) or there will be epic FAIL.

To install the compiler on Ubuntu 8.04.4 LTS, be sure to also install libxp-devel:

sudo aptitude install libxp-dev
These instructions are for a basic install of Ubuntu 8.04 that has had sudo aptitude dist-upgrade run, hence it is version 8.04.4. The instructions are written assuming you are a sudo user.

To get builds to work for both Mongo and STAR, install the needed software:

sudo aptitude install build-essential
Ubuntu likes to reset environment variables for sudo commands. The fix to compile? Alias the sudo command so it will know enough about the environment to compile and install:

alias sudo='sudo env PATH=$PATH MONGODIR=$MONGODIR ABSOFT=$ABSOFT'

Mongo

We need to set an environment variable for everyone. Add the mongo directory in /etc/bash.bashrc:

# Export the path to mongo for everyone
export MONGODIR=/usr/local/mongo;
Log out and back in for the environment variable to take affect.

Unpack the source:

tar -zxvf mongo.tar.gz && cd mongo

Mongo and Friends

Edit the Makefile. Change:
$(FNTFILE):
mkfont
To:
$(FNTFILE):
./mkfont
Note: Makefile.absoft is older than Makefile. Use Makefile

Complile the FORTRAN subroutines, create the library libmongo.a, create the X-windows driver STARplot and create the font file Font.bin.

sudo mkdir -p /usr/local/mongo &&
sudo cp Fonts /usr/local/mongo &&
make realclean && sudo make;
Install mongo and friends on the system:

sudo mkdir -p /usr/local/man/man2 &&
sudo make install

Help Library

This needs to be compiled and installed, the make command does both.

pushd helpdir && sudo make && popd;

HPGL Converter

This needs to be compiled and installed, the make all command does both.

sudo mkdir -p /usr/local/man/man1 &&
pushd hp2xx314/sources &&
make realclean &&
sudo make all &&
sudo make install-bin &&
sudo make install-man &&
popd;

STAR

Unpack the source in /usr/local/:

sudo tar -zxvf src.tar.gz -C /usr/local/ && cd /usr/local/star
Note: Makefile.absoft is older than Makefile. Use Makefile

Edit the Makefile. There is an instruction missing after the spectrunc instruction, add:

spectrund: spectrund.f
$(FC) $(FFLAGS) $@.f -o $@ $(LIBS)
Note: Be sure it is a tab and not 8 spaces in front of $(FC)

Compile STAR:

sudo make realclean && sudo make;
We want to give everyone access to the STAR binaries. Add the star directory to $PATH in /etc/bash.bashrc:

# Export the path to star for everyone
PATH="$PATH:/usr/local/star"; export PATH;
Compile and Install Star (CentOS 5.4)
Star is a package of astronomy software for variable star research that some of my colleges use for their work. It was programmed by an astronomer at South African Astronomical Observatory (SAAO) in FORTRAN. From what I can tell it is not actively maintained and can be difficult to get compiled and installed correctly if you have never done it before. The following is the result of several nights of research with trial and error to get Star to compile and install properly on CentOS 5.4.

I compilied Star using the Absoft (v8, 32-bit) Compiler. It's an older version of Absoft, but this is an old program. Follow the instructions as given with the software to install.

Be sure to download and install the patches (libfio in particular) or there will be epic FAIL.

To install the compiler on CentOS 5.4, be sure to also install libXp:

yum -y install libXp
These instructions are for a basic install of CentOS 5.4 where yum -y update has been run. The only box checked for the installation is the "Gnome Desktop." The instructions are written assuming you are logged in as the root user.

Also note: SELinux is disabled

To get builds to work for both Mongo and STAR, install the needed software:

yum -y install gcc libX11-devel

Mongo

We need to set an environment variable for everyone. Add the mongo directory in /etc/profile:

# Export the path to mongo for everyone
export MONGODIR=/usr/local/mongo
Log out and back in for the environment variable to take affect.

Unpack the source:

tar -zxvf mongo.tar.gz && cd mongo

Mongo and Friends

Edit the Makefile. Change:

$(FNTFILE):
mkfont
To:

$(FNTFILE):
./mkfont
Note: Makefile.absoft is older than Makefile. Use Makefile

Complile the FORTRAN subroutines, create the library libmongo.a, create the X-windows driver STARplot and create the font file Font.bin.

mkdir -p /usr/local/mongo &&
cp Fonts /usr/local/mongo &&
make realclean && make;

Install mongo and friends on the system:

mkdir -p /usr/local/man/man2 && make install

Help Library

This needs to be compiled and installed, the make command does both.

pushd helpdir && make && popd

HPGL Converter

This needs to be compiled and installed, the make all command does both.

mkdir -p /usr/local/man/man1 &&
pushd hp2xx314/sources &&
make realclean &&
make all &&
make install-bin &&
make install-man &&
popd;

Star

Unpack the source in /usr/local/:

tar -zxvf src.tar.gz -C /usr/local/ && cd /usr/local/star
Note: Makefile.absoft is older than Makefile. Use Makefile.

Edit the Makefile. There is an instruction missing after the spectrunc instruction, add:

spectrund: spectrund.f

$(FC) $(FFLAGS) $@.f -o $@ $(LIBS)
Note: Be sure it is a tab and not 8 spaces in front of $(FC)

Compile STAR:

make realclean && make
We want to give everyone access to the STAR binaries. Add the star directory to $PATH in /etc/profile:

# Export the path to star for everyone
export PATH="$PATH:/usr/local/star"
Hopefully some astronomers out there will find this useful.

March 08, 2010

DevOps – You’re Doing IT Wrong

There’s something happening here
What it is ain’t exactly clear
There’s a man with a gun over there…
–Buffalo Springfield

Alrighty then, what is this DevOps stuff and what does it mean to me…

First, first off, I came to Ops as a developer (and to be honest I came to be a developer because I didn’t like my prospects or the pay rate to do pure mathematics, but that’s a long story for another day).

If you are going to work with computers at all and have some curiosity and aptitude, chances are you are going to learn a bit about how they work. At the first place I was paid to program, I was a one man wrecking crew in every sense of the word. I was in charge of everything from server configuration to all the programming. I was just out of school with a degree in Mathematics and a minor in computer science. I did everything wrong but I made it all work with what I knew and force of will. I solved problems with books, google and tinkering. There were mailing lists and forums, but they were often insular and reluctant to answer questions or dismissive. Pain is an excellent teacher and that was over a decade ago.

There was a short period where my path could have gone down either road, sysadmin or developer, but as fate would have it my choices and circumstances took me through grad school and from there I became more and more inculturated into the developer tribe.

At some point, working as a developer for a SaaS ecommerce platform startup, through arrangements that I had little control over, I got to experience first hand a dysfunctional relationship with an operations team and essentially found myself taking responsibility for details that would traditionally belong to that side of the ‘wall of confusion’.

In my time working with Luke and people from the Puppet community, I learned a ton. I learned more about the work and culture of system administrators and I also learned a lot about being a developer (in addition to a more lessons than I care to enumerate about business, relationships, marketing, sales, venture capital and spinning plates but I digress).

In my journey, I was also fortunate to make the acquaintance of a number of interesting and talented people at the Salt Lake Agile Roundtable, and this had me in the habit of thinking about technology in terms of people and workflows.

I began thinking about Puppet and the systems tools ecosystem, in the context of the people and the processes. Some of those thoughts were recorded in this blog. I started articulating, sharing and experimenting with those ideas. I found others in the communities of practice that had similar ideas. We all started talking and sharing and building infrastructure and making things happen and now we are here.

To me DevOps is two distinct things that feedback on each other, and then a third that I think is really different.

First, there is the recognition that developers and operations can and should work together. In my opinion, this is being driven by the rise of web delivered business value. When the servers aren’t up, the nifty application doesn’t exist. Too many teams have too much turbulence on both sides of that. This is a serious problem and costs companies millions of dollars every year. I like to think I have made more contributions to solving this problem than I ever made to causing it. This cooperation seems to be the main focus of what I read other DevOps people talking about. Communication, community of interest, manage flow, boundary objects, yada yada… great stuff!

Second, infrastructure and system administration is evolving. The explosion in the open source tool ecosystem is awe inspiring. From provisioning, to virtualization, from configuration, to orchestration, something has undeniably accelerated in the last few years. More and more, from end to end, infrastructure is code. APIs driving and manipulating systems from bare metal to running services. That process looks more and more like software development, split from undifferentiating physical labor in the datacenter. The ’sysadmin’ no longer has to rack and stack and cable, in addition to being an expert in every OS, application stack, the Voip phones and the printers.

People are arguing that this is not new. That’s somewhat true, and similar positions could be supported for nearly any aspect of computer science, programming or technology. I think that is missing the point a bit. While some of this might not be new in principle or practice, the acceleration is real and those people have to recognize this is not how most people think about and manage their systems. The infrastructure is an application. The sooner more people think like that, the happier they will be. I’m not advocating forget what it means to be a system administrator. Own that domain and know where you come from, but recognize and leverage all the applicable tools and lessons from software development without concerns for notions of tribal identity. In my opinion, there is more to this than ‘just good at their jobs‘, because I still meet system administrators who haven’t heard of Puppet or see why anyone would want or need something like that. The past and present aren’t evenly distributed any more than the proverbial future. We take for granted that things that are obvious to us are obvious to everyone.

Telling someone a truth they aren’t ready to understand is the same as lying to them.

Which finally brings me to the big thing that I think DevOps represents, a community of practice. There might not be anything technically new, what is new is a lot more people talking and sharing. People may have automated system administration tasks forever, but they also hard coded lots of specific details and assumptions about their infrastructure, and they mostly did their work in secret. Lessons were learned and forgotten because the details weren’t transmitted beyond a generation of implementation. There wasn’t (and to some degree isn’t) a common language for patterns of common problems and solutions, but we’re working on it. This community is emerging globally and perhaps appropriately coming together through the very medium which they support, nurture and protect with their hearts and minds. A global community of peers empowering itself to improve the craft through learning and teaching. People with a passion for infrastructure. The difference is not that we can automate systems and work together with other people, the DevOps difference is we want you to be able to do it too.

Open Source, Cloud Computing, Agile, Systems Administration, a perfect storm of ‘nothing new’ with DevOps in the middle of it.

That’s what DevOps means to me…

Now go build something…


My .bashrc File Part 4 - Alias'

If you are unfamiliar with the alias command then you are missing out on an effective and efficient tool. Alias is a way to create a shortcut command in bash. You can take very long commands with several options or triggers and create your own shorthand equivalent of that long command. For Example, for me to get the weather for my local area using the weather-util application I would normally need to type:

weather -f --id=KSLC -c "Salt Lake City" -s UT

Well, that's way to long. I normally only want to know the weather in my local area, so I've created an alias for this long command.

alias weather='/usr/bin/weather -f --id=KSLC -c "Salt Lake City" -s UT'

This command essentially substitutes the longer command to display the weather for Salt Lake City with just the command "weather". I have several alias' in my .bashrc file to make my life easier.

# some ls aliases

alias ll='ls -l'

alias la='ls -A'

alias l='ls -CF'

#Information

alias weather='/usr/bin/weather -f --id=KSLC -c "Salt Lake City" -s UT'

alias gcalcli='gcalcli --cals all'

#For getting around

alias videos='cd /home/jared/Videos/ && ls'

alias pics='cd /home/jared/Pictures/ && ls'

alias music='cd /home/jared/Music/ && ls'

alias podcasts='cd /home/jared/Podcasts/ && ls'

alias dropbox='cd ~/Dropbox/ && ls'

alias documents='cd ~/Documents/ && ls'

alias notes='cd ~/Notes/ && ls'

alias manti='cd ~/Manti/jared/ && ls'

The first group of alias' are very common shortcuts for the "ls" command. The second group of alias' give me shortcuts for the weather and gcalcli applications which displays the weather and my google calendar information. Finally, the las group gives me shortcuts to commonly used directories. This saves me tons of time as I don't have to type out the complete path of a commonly used directory.

Please share some of your cool alias' that you have implemented.

YUI Image Uploader gets a code repository
I've created a github project for the YUI Image Uploader. You can download the scripts and example page here: http://github.com/mulicheng/yuiupload This will also facilitate user contributed changes and backend scripts.
Compiling the Kernel

The other day my friend Marty was having some interesting problems. His USB ports were randomly dropping. Seriously, mouse working fine and then BAM! No more mouse. At first I thought it was a hardware issue and that he would need a RMA to get a new motherboard. But after some google searching we found this bug on Launchpad that basically says there is a kernel bug with this particular Nvidia USB controller.

So, we went with the latest stable kernel that doesn’t suffer from this bug.

I have written about compiling the kernel before, but didn’t include a link. For instruction on how to compile the kernel I followed this post.

Some instructions need to be different for ubuntu. For instance, instead of ’su -’ for ubuntu you should use ’sudo -i’ to get a root shell. Also ‘mkinitrd -o initrd.img-2.6.25 2.6.25′ should actually be ‘mkinitramfs -o …’ Small differences but this points out a great part about Linux. Although these instructions may be for a different distro, in this case CentOS, you can still use them as guidelines.

Search’d: How do I enable the Sharepoint Protocol

This is part of the Search’d series.  Topics are taken from Search Engine keyword searches.

This second post is coming a bit late, but it is finally here.  I’ve been getting ready for our World Wide Sales Kickoff. We will be kicking off our new fiscal year with great sessions for our worldwide group of partners. I’ll be presenting with two of my EMEA colleagues on Scaling Alfresco.  I’ve chosen to tackle scaling our WCM product.  It might even turn into some great information for a post or two here.

This weeks topic is one of the most popular searches that has lead to this blog: How do I enable the Sharepoint Protocol in Alfresco.  At the outset let me tell you: I’m not going to explain how to actually configure the Sharepoint Services in this post, rather I want to point you to resource that take you through all of the steps of enabling the Sharepoint Protocol in Alfresco and how to use it.  These are often over looked resources, but resources that can be really useful.

The first resource is the Installing and Configuring Alfresco Community Edition guide found on the Alfresco Community Download page (or on the Alfresco Content Community Site [registration required] in the Document Library under Documentation in the Installation and Configuration folder for your installed release of Alfresco Community.  This guide covers the basics of setting up and runningg Alfresco Community (It is also a preview of the documentation available as part of an Alfresco Enterprise Subscription in the Alfresco Network site [Alfresco Enterprise Subscription Required].)  You’ll find instructions for setting up and configuring Alfresco Sharepoint Services (on the server side) starting on the bottom of page 26.

The second resource covers using the Sharepoint Extension in Microsoft Office: Managing Alfresco Content from within MS Office Community Edition. (Requires Registration).  This is also found in the Alfresco Content Community Site [registration required] in the Document Library but in the Tutorials folder.

These documents as well as others for using Share, Web Content Management, Document Management and Records Management can be found in the Content Community Site. You’ll also find presentations from past Community Conferences, Case Studies, White Papers and Webinars.

DRM cripples paying users again.

Apparently Ubisoft has some problems, not just with deploying bad DRM, but with keeping it running. There have been many discussions about their new DRM schema (it requires a live internet connection to play). Apparently, only the pirates are allowed to play currently as Ubisoft is sorting out their downtime. The pirates are once again having a better gaming experience than those that legally bought the game. Hopefully Ubisoft learns from this, and if not, they don’t really deserve to stay in the market. Until they remove DRM from their games, I won’t be making any more purchases from them.

March 07, 2010

Spam Fail

A perfect example of sincere comment spam, only this one apparently was having some technical difficulties:

Great job on %BLOGURL% -- right :)

Oh, I'm so glad they like my %BLOGURL%!

Agile Infrastructure: The Movie

In a war between cowboys and ITIL, a small resistance fights for their ideals…

Dedicated to the notion that ‘the way things are done is not the best way to do them’, our heros struggle to liberate their comrades and add to their community of practice. Long live DevOps!

InfoQ just released just released this presentation, which Paul Nasrat and I gave at Agile 2009 in Chicago.

The presentation is quite long, but I hope people find something beneficial and would appreciate any feedback here or on InfoQ.


March 05, 2010

Petabytes on a budget: How to build cheap cloud storage | Backblaze Blog
Petabytes on a budget: How to build cheap cloud storage | Backblaze Blog

There are a lot of cool storage ideas out there. This is one end of the spectrum.

I like it: 67TB in 4U for under 8K.
Interview with Linux Journal Associate Editor Shawn Powers

Here's an interesting and fun interview with Linux Journal Associate Editor Shawn Powers. You can tell from the picture that this dude is totally cool. Seems like it to me, anyway.

Shawn Powers

Carlie: What is it that you do for Linux Journal?

Shawn: That's a scary question for your boss to ask... :)

Carlie: I meant "Tell our readers what you do for Linux Journal". :p

Shawn: As our needs change here at Linux Journal, my duties have shifted around a bit in the past year. Right now I'm spending a lot of time creating the daily Tech Tip videos for the website. I also write pieces for the print magazine (Current_Issue.tar.gz, and some UpFront stuff). I answer Letters To The Editor. I write some web articles, although not as many as Katherine would like.

Honestly, Linux Journal is the sorta place that you do whatever needs to be done. I've helped edit articles for the print magazine, proofread the mag for print, come up with zany contest ideas, and *almost* convinced the Houston office they need to get a coffee pot. I'm still working on that last one. [Editor's note: we now have a Breville BKC700XL in the office. We couldn't deal with Shawn's incessant taunting.]

Read "Interview with Linux Journal Associate Editor Shawn Powers"

Rugged railroad computer runs Linux

Now here's a pretty cool implementation of Linux:

Kontron is readying an Intel Atom Z530-based box computer designed for rugged railway applications. The MicroSpace MPCX28R Railway Box PC is protected for railway use with EN50155 certification, TX compliance, extended temperature support, 1.5kV isolated power, and M12 connectors for Fast Ethernet, USB, and power, says the company. The Linux-compatible MicroSpace MPCX28R is suitable for passenger infotainment, security, and other railway applications, says Kontron. Built around the original 1.6GHz Intel Atom Z530 CPU and SCH US15W northbridge/southbridge, the MicroSpace MPCX28R supports up to 1GB of DDR2 RAM, the company says.

Rugged railroad computer runs Linux

Welcome Ingiters

Welcome Igniters, I hope you enjoyed my talk tonight. This is my wonderful website. I know I haven’t updated in a while, but I have been working a new design. I hoep to have it ready in the near future. Please check back soon. Thanks for coming. I’ll be writing a review of Ignite when some of the pictures and videos are available online.

Preview of New Design

Related posts:

  1. I’m Speaking at Ignite Salt Lake 4

Amazon Products in KRL: A New Distribution Model
Kynetx Amazon API Demo App

The first Web service that Amazon put up, years ago, was the ECommerce API that allowed API access to Amazon's product information. That API has gone through several name changes and is now called the Product Advertising API. Thousands of people have used this API to add data about products--and the opportunity to buy them--to their Web sites.

That's the problem, of course. You can use it on your Web site, but you can't conveniently use them in a browser extension to build client-side community apps because your Amazon developer keys would be exposed to the world. The most recent build of KRL changes that by making the Amazon Product Advertising API (PAA) available as a library. That means that it's possible to use Kynetx to build client-side applications that use the PAA without exposing your developer tokens. That opens up a whole host of possible uses for Amazon product information that were difficult to achieve before.

Here's a video that shows this at work:

Of course, to create client-side applications that people will install and use requires more than just pumping more product at them. The KRL integration of PAA includes the ability to access all the user-generated reviews, product information, photos, and other product data that would allow a developer to create a first-rate experience that adds real value for people who download and use their apps.

KRL makes using PAA easy. To get started, you simple put your Amazon developer secrets and associate ID in the meta block of your application:

meta {
  key amazon {
    "token"        : "absjj99a9ad9ad8799",
    "secret_key"   : "absjj99a9ad9ad8799abs79999a9ad9ad8799",
    "associate_id" :  "windleyofente-20"
  }
}

These are stored securely in the cloud and not divulged to users of the application.

The KRL Amazon library has two primary methods: ItemSearch and ItemLookup. With ItemSearch the search index is a parameter and additional parameters depend on the particular index. ItemLookup takes an Amazon product ID (ASIN) as it's primary parameter. Here's an example:

amazon:item_lookup({"ItemId" : "B00008OE6I",
                "response_group" : "ItemIds" })

The response is returned as JSON so that you can use JSONPath to pick it apart and use it. Here's a piece of the response to the previous query:

"Item" : {
            "OfferSummary" : {
               "LowestUsedPrice" : {
                  "Amount" : "3999",
                  "CurrencyCode" : "USD",
                  "FormattedPrice" : "$39.99"
               },
               "TotalRefurbished" : {},
               "TotalUsed" : "8",
               "TotalCollectible" : {},
               "TotalNew" : {}
            },
            "ASIN" : "B00008OE6I"
         }

Here's a video showing a little more about how this is done and giving a working example.

You can install the example that we used for the first video or just view the source code using the app detail page in the Apps Directory. Here's the documentation for the Amazon library.

The Amazon integration with KRL allows Amazon developers to build client-side application that use Amazon product data without exposing the Amazon developer credentials--something that's been hard in the past. KRL is designed to make using online data like Amazon or Twitter easy and quick. We'll be annnouncing some other major data and service integrations over the next few weeks as we gear up for Kynetx Impact in April. Come join us.

Tags: kynetx krl amazon

You know what’s working on my laptop with Intel 830m video? Fedora 12, that’s what

Steven Rosenberg gives Ubuntu the boot and makes a move to Fedora 12. The result? He got his Intel 830m video card to work. Nice!

At the recommendation of reader David Gurvich, as well as the enthusiastic endorsement of "Linux Outlaws" co-host Fabian A. Scherschel and Larry "the Free Software Guy" Cafiero, I burned my first Fedora disc in some time and am testing Fedora 12 in the live environment.

My latest foray into distro-hopping — live CD/DVDs only at this point — is prompted by this week's total fail in turning off kernel mode setting and getting the screen to work in Ubuntu Lucid Alpha 3. That method (turning off kernel mode setting) worked like so much magic in Ubuntu Lucid Alpha 2 and Sidux 2009-04 (basically Debian Sid in late 2009).

But that hack did nothing for me in Ubuntu Lucid Alpha 3. Yes, dear readers, I know you hate to hear me whine and complain and would rather I file a bug report. I will do so, using my ever-loving Launchpad account, rest assured.

But in the interim I'm looking for any and every solution that will carry my now-two working Intel 830m-equipped laptops through the next year.

I'm crossing my fingers (but have nothing concrete at present) that Debian Squeeze will accommodate Intel 830m, and I'm hopeful that Ubuntu Lucid will work this out (although a regression between alpha releases doesn't bode well).

I've also established that PC-BSD 8.0 (and by extension FreeBSD 8.0) has no problem whatsoever with Intel 830m video.

And today I burned a Fedora 12 live image and am running it right now.

Read "You know what's working on my laptop with Intel 830m video? Fedora 12, that's what"

You Know You're a Geek If.....
.......YOU GET EXCITED ABOUT RAM!!!!!!!!!

I haven't been able to sleep at night for the last 3 days in anticipation of the RAM upgrade I ordered from newegg for my HP 1000 mini. The mini originally came with 1 GB RAM and I'm maxing it's compacity with 2 GB. The climatic release of tension came when my RAM (finally!) arrived and I could pop in the SODIMM into it's slot and gasp in awe at the increased performance from this baby.

Whew! What a rush.
2010 Book Reading: Linux Server Hacks
I have a long list of books I want to go through this year to increase my exposure and skill set with Linux and programming. I picked up Linux Server Hacks long ago and never read it. I was too busy taking astronomy courses and doing research. It is the first edition (and as of now the only edition), published in 2003.

It is amazing what happens over the course of seven years. While many of the concepts are as applicable now as they were then, the way they are being done has changed. For example in Chapter 1, the book talks about some great tricks using tar and ssh which I'm sure will come in handy in the future. But the chapter also talks about LILO which I have not seen since I switched from a pink and purple distro named Mandrake to a more exciting orange distro named Ubuntu. However these hacks are easily converted to use in GRUB.

Chapter 2 talks about version control, mostly CVS. I used CVS once in my travels through space and time, and I used Git while at Guru Labs. It was interesting to read, but didn't apply to anything I'm using at the moment. Chapter 3 talks about backups and combined together a few things I knew about like rsync and other tools. I've already used a few tips from this chapter. Chapter 4 discusses networking. Most topics that interested me I am already aware of and using from my previous experience, but review is always good.

Chapter 5 gets into system monitoring including system logs, finding programs which are holding a port open, network monitoring, and monitoring an aging disk. All good things to know about. The book even shows you how to display your load average in the titlebar of your command window. Chapter 6 goes over some ssh tricks, many which I was already using. However reviewing port forwarding with ssh is always good since every time I do it, I have to go relearn how. Chapter 7 has some tips for scripting. There is an example script that helps a user move all their preferences and settings onto a new user. I've plucked a few ideas from this for my own use.

Chapter 8 gives tips for information services such as BIND, MySQL, and Apache. The book shows how to configure BIND to run in a chroot jail. Although these days (at least in RHEL and Fedora), you just install the rpm. Talk about taking the fun out of it. For some MySQL and Apache tips, the book talks about setting up replication across multiple servers for these applications. Again time has caught up with the book since it was published. These days the high load applications servers I've seen use clustered file systems. Other tips in this chapter include creating and distributing your own Certificate Authority and distributing load with Apache RewriteMap.

Overall, the book is valuable even seven years after it was published. Some of the technologies and applications have changed over the years, but seeing how it is (was) done is still a valuable learning experience. Several of the tips are "this is a cool script that does X" (available online). Unfortunately, I felt explanation for some of the scripts is a bit lacking. Overall for me, it was a good read.

Next book: Learning the Bash Shell. Or maybe Sed and Awk.

March 04, 2010

Furious Paintball and Desert Edge

So while I haven’t talked much about it in a while, things have really been ramping up with my paintball team (DesertEdge).  With recent wins, we’ve had some great exposure, and just picked up a new sponsor, Furious who will be providing our new barrels to match up on our amazing Planet Eclipse Ego’s.  Here’s the press release:

FOR IMMEDIATE RELEASE

Team Desert Edge Signs Sponsorship Agreement with Furious

SALT LAKE CITY, Utah – March 1, 2010 – Team Desert Edge, one of the most recognized and accomplished competitive woodsball teams in the sport, has inked a sponsorship deal with Furious Painball LLC, the maker of the most advanced paintball barrels made.

Tim Saunders, Co-Captain of Team Desert Edge points out, “Every player is looking for the most accurate and consistent barrel available. Desert Edge has found just that. The Lotus Barrel by Furious, is the world’s most advanced barrel design.” Tim continues, “The combination of the Planet Eclipse markers and the new Furious barrels is a perfect mesh of reliability and unmatched precision.”

Desert Edge Team Captain, Dan Saunders adds, “The quality of the new Lotus Barrel is helping our team perform better. The honing and porting are so perfect, our shots are more consistent, air is more efficient, and when a ball breaks, the next shot cleans the barrel perfectly! That keeps our shots right on target.” Dan continues, “In competitive woods paintball, the importance of accurate shots and a self-cleaning barrel is crucial. It’s a benefit almost unheard of, that we now have.”

“This partnership is the perfect fit.” Dan says. “Furious is a relatively small, but growing operation, and we couldn’t be more excited to be a part of the growth of such a great company. We look forward to exposing other players to such quality and reliable equipment.”

Dan continues, “We are honored to join the Furious family with winning teams like Vicious, San Francisco Explicit and Rockstar. We look forward to continuing the winning habits in the woodsball tournament scene.”

“Matthew, at Furious is excited to work with Desert Edge, and is genuinely interested in Paintball as a whole.” Says Dan. “Matthew is currently working with the UWL (Ultimate Woodsball League) in organizing a tournament series in Malaysia. Dan adds, “Matthew has strong ties with the paintball community, both in the U.S. and Malaysia. This may be our chance to reach the Paintball community on a more global level.”

Furious Paintball’s Matthew Nekvapil comments, “Furious Paintball sees an opportunity in the Scenario market. We have always wanted to get in there and work with a great scenario team, which we have found with Team Desert Edge.”

Matthew continues, “We are excited about the fact that they are enthusiastic to work with us. They have been around for some time, their results speak for themselves. At Furious, we pride ourselves on our customer service. The teams we work with is a testament to this. We feel that Desert Edge is the right fit with Furious.”

Furious Paintball specializes in custom and precision manufacturing of paintball equipment. They are most recognized by their beautifully handcrafted barrels and their ultra long lasting paintball batteries. The founder, an enthusiastic paintball player demands only the best and most reliable equipment and as a result of that, Furious Paintball came into being.

The partnership of Desert Edge and Furious Paintball will surly bring one of the most exciting seasons we have seen in competitive woodsball.

Researchers find way to zap RSA security scheme

RSA security technology is not as secure as we thought. What?!

Check it:

“Three University of Michigan computer scientists say they have found a way to exploit a weakness in RSA security technology used to protect everything from media players to smartphones and e-commerce servers.

RSA authentication is susceptible, they say, to changes in the voltage supplied to a private key holder. The researchers – Andrea Pellegrini, Valeria Bertacco and Todd Austin — outline their findings in a paper titled ‘Fault-based attack of RSA authentication’ to be presented March 10 at the Design, Automation and Test in Europe conference.

‘The RSA algorithm gives security under the assumption that as long as the private key is private, you can’t break in unless you guess it. We’ve shown that that’s not true,’ said Valeria Bertacco, an associate professor in the Department of Electrical Engineering and Computer Science, in a statement.”

Read “Researchers find way to zap RSA security scheme”

Force HTTPS in apache

maybe you want to make all HTTP requests we rewritten to HTTPS. Here’s how:

   RewriteEngine On
   RewriteCond %{HTTPS} !on
   RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Getting Loopy: Performance Loopers For Linux Musicians

Being a musician and a Linux user myself, this one certainly caught my attention! I use Muse along with my Roland Fantom X-8 to write and play music on Linux. Some of these tools look slick.

Excerpt:

A loop in music is a section of the music that repeats itself continuously until receiving a signal to either stop or move on to the next section. A loop can be assigned to a single instrument or to a group of instruments. Compositionally, loops are used for a variety of purposes. For example, they may function as formal bass patterns over which a composition is built, or they may suppy a long but consistently repeating series of chords used to define the harmony for independently composed bass and melody lines. For many computer-based music-makers the loop's most popular implementation is the drum loop, a rhythmic pattern of one or more measures of percussion sounds that can be repeated unchanged for simple lines or mixed & matched with other loops for more life-like variation.

Read the rest of "Getting Loopy: Performance Loopers For Linux Musicians"

WebDAV linux share protected by LDAP Authentication

Maybe you want your Mac, Windows and Linux users to be able to access/write to a shared environment. Maybe you want to use WebDAV instead of a samba/NFS share.* How do you do that? Maybe you’d also like to authenticate against your Active Directory server. Here’s an Apache configuration that works:

<VirtualHost *:80>
        ServerName example.com
        DocumentRoot /srv/webadmin.example.com/media
        DAVLockDB /var/lock/apache2/DAVLock
        <Directory /srv/webadmin.example.com/media >
         RewriteEngine off
        </Directory>
        <Location "/">
                DAV On
                AuthType Basic
                AuthName "Basic Research Media Server"
                AuthBasicProvider ldap
                AuthzLDAPAuthoritative off
                AuthLDAPUrl "ldap://SERVER:389/ou=YOUR_OU,dc=EXAMPLE,dc=COM?sAMAccountName?sub?(objectClass=*)" NONE
                AuthLDAPBindDN "CN=LDAPQuery,DC=EXAMPLE,DC=COM"
                AuthLDAPBindPassword YOURPASSWORD
                Require ldap-user YOURUSER1 YOURUSER2
        </Location>
</VirtualHost>

note: Windows 7 has buggy WebDAV implementation, but you can use third party webDAVE software (AnyClient, for example) to bypass this.

* unlike NFS and SMB, you can easily access a WebDAV share over the Internet. And it’s faster in some cases.

SLLUG Daytime: Wednesday, March 10 @ 11:30am – Node.js

This month’s presentation is going to be awesome!! Shane Hansen will be spending time with us over lunch (bring your brown bag) at BetalLoftSLC talking about node.js.

Node.js – building massively parallel applications with javascript and epoll

Node.js [http://nodejs.org/] is a framework for rapidly building massively parallel network applications using non-blocking io. It’s built on the performant v8 javascript engine [http://code.google.com/p/v8/] which compiles javascript to machine code at runtime. Node is similar in design to systems like Ruby’s EventMachine [http://rubyforge.org/projects/eventmachine/] or python’s twisted [http://twistedmatrix.com/trac/]. It’s suitable for building chat-like protocols, comet servers, mmo game servers, etc. This session will cover some of the basics of how to build and install node.js as well as analyze some demo programs.

If time permits, I might talk a little bit about python’s twisted and compare some programs written using twisted/node.js

About Shane Hansen:

I’m a Software Engineer working on Backcountry.com’s replatforming teams. Prior to that I worked on projects ranging from compliance tracking software for the goverment to building  mathematical models for reflectometry to immune system modeling. I’m interested in open source software, web standards, high performance computing and application architecture

Meeting Location:

BetaLoft (http://betaloftslc.com) is located at 357 W 200 S. Upstairs in Suite 201. Salt Lake City, UT, 84101

Betaloft is a coworking space in the heart of downtown Salt Lake City founded by Drew Tyler.

We are a community of freelancers, independents and work-from-home people, who have an interest in getting out of our dull work day and participating in a community that’s designed to support and encourage people who make a living doing what they love.

We provide communication tools, events (social and educational), as well as a physical space to work and collaborate.

See you all there!

Clint

Innovators get Linux to boot in 1 second

Linux boots in less than 1 second? Yes, it does.

Excerpt:

MontaVista Software has always been a leader in embedded-Linux commercialization. The company has developed Linux-development platforms since 1999, when founder Jim Ready pledged to bring ‘100% pure Linux’ to the world under the GNU (GNU’s not Unix) GPL (general public license). Since then, MontaVista has specialized in embedded and real-time Linux.

Its approach is not simply an RTOS (real-time operating system) that runs Linux as one of its tasks. The company has changed the Linux kernel to provide determinism and real-time performance in a real Linux operating system. Cavium Networks recently acquired the company, which just announced the release of Version 6 of its operating system.

In addition to designing real-time Linux, MontaVista has been working on the development of real-fast Linux, a Linux operating system that boots in less than 1 second. The team who worked on the project includes Alexander Kaliadin, Nikita Youshchenko, and Cedric Hombourger. Many on the team also worked on the MontaVista real-time Linux. ‘One of the first things we did years ago was to make the Linux scheduler pre-emptive and deterministic,’ says Hombourger. These fast-boot developments are not necessarily limited to real-time or an embedded Linux; however, they can get a conventional Linux distribution to boot in 1 second, as well.

Read all of “Innovators get Linux to boot in 1 second”

Beginner’s Guide to Nmap

Linux has a number of incredible security tools. Joe Brockmeier introduces nmap, one of the better security tools out there.

Excerpt:

"Ever wondered how attackers know what ports are open on a system? Or how to find out what services a computer is running without just asking the site admin? You can do all this and more with a handy little tool called Nmap. What is Nmap? Short for "network mapper," nmap is a veritable toolshed of functionality to perform network scans. It can be used for security scans, simply to identify what services a host is running, to "fingerprint" the operating system and applications on a host, the type of firewall a host is using, or to do a quick inventory of a local network. It is, in short, a very good tool to know."

Read the article here

My .bashrc File Part 3 - Making Life Easier
A very common thing to do in the command line is to extract compressed files. Now as many of you probably know there are a dozen different compression methods out there. Let's say I have a .bz2, .7z, .gz and a .rar file and I don't want to think about which app to use and what option I need to extract my file. I just want my file uncompressed. Let's make life a little easier and insert the following into your .bashrc file.

#------Extraction of compressed files--------------
# from ARCH Wiki

extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi
}

Now when you need to uncompress a file, simply type "extract filename" and slam-bam-thank-you-ma'am. No thinking or looking up the correct syntax, all you are left with is an uncompressed file and isn't that all we really wanted?

What fun things are you hiding in your .bashrc file that makes life easier? Please share.