Category Archive : Linux

Mac Madness

I got my hands on a MacBook Pro a couple weeks ago, so it is time for a review.  First of all, I’m not a master of any operating system, but I am at least familiar enough with them to make a pretty good judgment.  First the things I like, then the ones I don’t.

Like:

1.  Really fast boot and shutdown time.   The laptop only takes a few moments to start up, comparable to stripped down version of linux, or at least a linux server.  The shutdown time is amazing, like 2 seconds.

2.  Eye candy – The icons are cool, and you can tell someone really has spent some good time making application icons look really nice.    The dock is nice for the application you always start up.

3.  Terminal – The blessed terminal, with all of its wonderful powers.   I was able to run most all the commands I use regularly, and found myself at home with it.  VI, nano, ssh and sftp all installed and ready to go, what else do you need.

Dislikes:

1.  Application UI handling.   I’m not sure of all the correct names for part, but that top tool bar sucks.  If you click the ‘X’ at the top of any form, the application does not really close, all the menu stays at the top, the icon stays in the dock.  You exited nothing, and that is stupid.  I should not have to go into the menu to close an application.

2.  Apples web site and tech support suck.  Believe me.

3.  Costs money, pseudo open source, not a lot of apps ported from windows / linux.  I got Subversion and Git installed, command line only.  ( Which is really fine by me )  I couldn’t find a tortoise type application, built in text editor sucks, no notepad++  🙁

4.  Everything starts with a lower case i, and that is also stupid.

Password Strength Checker

I ran across this site today, and found it really useful for checking password strength.  It gives you all kinds of feedback on why it is or is not a good password.  This password, ‘r2d2+c3P0’, give a 100% in strength.  🙂

Uses For Live CD

Slashdot recently reported on the Washington Post’s recommendation to use a live CD for banking.  Mostly to avoid malware from getting your personal information out to the public, and giving the opportunity to others to commit fraud.  Malicious code can easily help hackers get the information needed to get to your money.

Live CDs are also a great way to try the features of different Linux distributions.  You can recover lost data from a drive that cannot boot anymore, get a computer up and running quickly if you loose your hard drive, and also get files from windows if you don’t have the proper account.  🙂

Here are some good live CDs to try, in no particual order:

Damn Small Linux

Ubuntu

Suse

Fedora

Debian

Puppy

Monterey 2 Magna – Finally

Back in April we took a family trip to Monterey Bay, California.  The day before we left we came up with a wacky idea to make a time lapse.  $4 on a iPhone app, 2 rubber bands holding my phone to the rear view mirror, 6 months of sitting around and now something to show for it.   It took 1200+ images, over 10 hours of driving ( 2 gas stops if you look close ), all down to 2 minutes of video.

For the nerds:

1.  make list of jpg files : ls -1tr > files.txt

2.  encode it : mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4 -o yourfile.avi -mf type=jpeg:fps=10 mf://@files.txt

Need ffmpeg and mencoder out of the debian or ubuntu repository

Recursive Fun

There have been few really important problems that have had the beautiful opportunity to recursively fix or use itself.  A great example it a project at work called zody, it is a bug tracking system.  After a week of development, it was able to be running well enough to keep track of its own bugs and the feature requests of others.

Richard Stallman wrote GCC the GNU C Compiler from scratch.  He was able to compile his compiler ( with a previous version ) and it has been used to compile the next generation of versions from that point on.

Notable Recursive Stuff:

  • The term GNU is a recursive acronym for “GNU’s Not Unix!”.
  • Git – After only a couple days, git source control had it’s own repository to maintain its own source code.
  • Subversion – Source Control System, maintains its own code
  • SharpDevelop – C# development program – written in C# , runs on .Net Framework, to write code for the .Net Framework.
  • Emacs – A text editor that was used to write itself ( the source text )

Today I deployed some new software, that is designed to deploy other software to servers.  So we naturally used it to deploy itself.  It was really cool, and I had a big smile on my face, when it happened.

Do one thing…..

One of the things that I have been working towards is to make my life a bit more simple.  I’ve been reading a great blog on zen-habits, that seems to really ring true for me. It has great ideas on how to simplify, be happy with less, etc.

One thing that I think would really help this world would be to follow the Unix Philosophy in our lives:

The Unix Philosophy :  Write programs that do one thing and do it well. Write programs to work together.

I see this philosophy at work each day, as I am a linux nerd.  Today’s example goes as follows:   I needed to look though several million lines of code, for a single word, output the file-name, project, and word count.   Subversion keeps track of code | svnadmin dumps the code to stream | grep finds the word I need look for | wc counts lines of code | pipes writes to results to file | sftp moves the file to my machine | pure happiness.  🙂

So each program only does one function, and is not complicated to use, so it does it’s function well.   Something as simple as ‘wc’ that counts lines per file, and words per file may seem so simple that it is silly, however it performs it’s job perfectly each time, and developers never need to write a program that does anything like it, because it already exists.  It can be trusted, day in and day out, it is tested, true and good.

There is a great post about how to help do this at a human level, here.  We should loose some commitments, clean out the clutter in our lives, do one thing and do it well.  Think of how much better our lives would be if we could trust that everyone we need help from had the time and commitment to do it well.  We would have better trust, better efficency, and be able to accomplish so much more in our lives.

Favorite RSS Feeds

I user Google Reader for all my RSS Feeds.  I’ve tried other RSS clients, but you can’t beat the web based client, so I don’t need to install anything.

Here are some of my favorite categories and feeds:

Linux

News

People

Distraction

Quips and Quotes

At work I’ve written the help desk / task / bug tracking system.  It has been developed mostly in the off hours, weekends and slow friday afternoon.  Either way, I add little features here and there, and this weeks feature is random* quips and quotes injected on each page.

I found about  25 quotes to seed the list, all worthy of being read by fellow co-workers.  However, I found this great quote by a kid on Slashdot (News for Nerds, Stuff that Matters ) that just could not make my list.  The topic is ‘USPS goes GNU/Linux‘ and the comments quickly turned to cheap people complaining about paying 40 cents to send a letter across the entire country in a couple days.

Either way here is the comment that I thought was funny:

Only old people use physical mail these days.

If you’re 30-something, you rely on email.

If you’re in your 20s, you use IM

If you’re 13 like me, it’s all Twitter, all the time. Bonus: I have no need to receive packages because I shoplift everything.


* Pseudo random of course….

Git-SVN How To

# Checkout
git svn clone <svn_repo>

# Workflow
git checkout -b <work_branch>
    .. work .. work .. work ..
git commit -a

# Switch Back To Master, Then Rebase
git checkout master
git svn rebase

# Sync Working Branch To Local Master
git checkout <work_branch>
git rebase master          

# Commit Your Work
git checkout master
git svn rebase
git merge <work_branch>
git svn dcommit -e

Subversion Pre-Commit Script – Finally

I have been the administrator for our Subversion server at work for a couple years and it has been really nice to learn all about it.  I have put together some pre/post commit scripts for checking messages, sending emails and also updating lines of code produced into a mysql database.

It always drives me nuts when I see someone commit an bin or obj folder or the suo / user file into subversion.  I finally wrote some scripts to prevent this going forward.  If it is attempted, then an nice big error message is returned, and commit is prevented.

Enjoy:

#!/bin/bash
WORDMIN=3
ZERO=0
REPOS=”$1″
TXN=”$2″

# Make Sure Bin Folder Is Not Being Added
BINF=`/usr/bin/svnlook changed -t “$TXN” “$REPOS” | grep “/[Bb]in/\| [Bb]in/” | wc -w`
if [ $BINF -gt $ZERO ];
then
echo ” ” >&2
echo “***** ERROR *****” >&2
echo “You are attempting to commit a bin folder, which is a sin.” >&2
echo “You need to preform the Undo Add to the bin folder under SVN.” >&2
echo ” ” >&2
echo `/usr/bin/svnlook changed -t “$TXN” “$REPOS” | grep “/[Bb]in/\| [Bb]in/” ` >&2
echo “***** End Of Error Message *****” >&2
exit 1
fi

# Make Sure Obj Folder Is Not Being Added
OBJF=`/usr/bin/svnlook changed -t “$TXN” “$REPOS” | grep “/[Oo]bj/\| [Oo]bj/” | wc -w`
if [ $OBJF -gt $ZERO ];
then
echo ” ” >&2
echo “***** ERROR *****” >&2
echo “You are attempting to commit a obj folder, which is a sin.” >&2
echo “You need to preform the Undo Add to the obj folder under SVN.” >&2
echo ” ” >&2
echo `/usr/bin/svnlook changed -t “$TXN” “$REPOS” | grep “/[Oo]bj/\| [Oo]bj/” ` >&2
echo “***** End Of Error Message *****” >&2
exit 1
fi

# Make Sure .suo File Is Not Being Added
SUOF=`/usr/bin/svnlook changed -t “$TXN” “$REPOS” | grep “suo\$” | wc -w`
if [ $SUOF -gt $ZERO ];
then
echo ” ” >&2
echo “***** ERROR *****” >&2
echo “You are attempting to commit a suo file, which is a sin.” >&2
echo “You need to preform the Undo Add to the suo file under SVN.” >&2
echo ” ” >&2
echo `/usr/bin/svnlook changed -t “$TXN” “$REPOS” | grep “suo\$” ` >&2
echo “***** End Of Error Message *****” >&2
exit 1
fi

# Make Sure .user File Is Not Being Added
USERF=`/usr/bin/svnlook changed -t “$TXN” “$REPOS” | grep “user\$” | wc -w`
if [ $USERF -gt $ZERO ];
then
echo ” ” >&2
echo “***** ERROR *****” >&2
echo “You are attempting to commit a user file, which is a sin.” >&2
echo “You need to preform the Undo Add to the user file under SVN.” >&2
echo ” ” >&2
echo `/usr/bin/svnlook changed -t “$TXN” “$REPOS” | grep “user\$” ` >&2
echo “***** End Of Error Message *****” >&2
exit 1
fi

# Make sure that the log message contains word minimum
LOG=`/usr/bin/svnlook log -t “$TXN” “$REPOS”`
WORDCOUNT=`echo $LOG | wc -w`
if [ $WORDMIN -gt  $WORDCOUNT ];
then
echo “Commit log message must be at least 4 words long.” >&2
exit 1
fi

# All checks passed, so allow the commit.
exit 0

Install Web Server In Minutes

* Buy Domain From GoDaddy.com

* Point the IP address correctly on Godaddy

* Install Ubuntu

* sudo apt-get install mysql-server
* sudo apt-get install apache2
* sudo apt-get install libapache2-mod-auth-mysql
* sudo apt-get install php5
* sudo apt-get install phpmyadmin
* sudo apt-get install php5-adodb

* sudo mkdir /var/searlesample

* sudo vi /var/searlesample/index.html
** Insert “Hello World”

* sudo vi /etc/apache2/sites-available/default
** Insert

<VirtualHost *>
  DocumentRoot /var/searlesample
  ServerName searlesample.com
</VirtualHost>
<VirtualHost *>
  DocumentRoot /var/searlesample
  ServerName www.searlesample.com
</VirtualHost>

* sudo /etc/init.d/apache2 restart ( Restarts Apache)

* Go To your domain == done