Gnu Screen Status Bar

This is a pretty cool way to set a status bar at the bottom of your unix screen session. Add this to your screenrc file (one line):

[dennis@box ~]% vim .screenrc

caption always "%{=b dw}:%{-b dw}:%{=b dk}[ %{-b dw}%{-b dg}$USER%{-b dw}@%{-b dg}%H %{=b dk}] [ %= %?%{-b dg}%-Lw%?%{+b dk}(%{+b dw}%n:%t%{+b dk})%?(%u)%?%{-b dw}%?%{-b dg}%+Lw%? %{=b dk}]%{-b dw}:%{+b dw}:"  

Share |

Posted on December 20, 2011 by Dennis Mojado

Filed under #code | 0 Comments |  Digg it

Data Cake

A good metaphor from epicgraphic.com:

data cake
Image by EpicGraphic

Share |

Posted on July 25, 2011 by Dennis Mojado

Filed under #code | 0 Comments |  Digg it

Developer's Problem Solving

I found this funny, then sad.

2010 developer's problem solving sequence: 1. Google 2. Coworkers 3. #StackOverflow 4. RTFM. 5. Think

Share |

Posted on February 28, 2011 by Dennis Mojado

Filed under #code | 0 Comments |  Digg it

My Development Toolbox, 2010 Edition

After reading my friend Jerry Cheung's post about his most used web development tools, I felt like I wanted to also share my "basic necessities of development"; but not just that-- I also want to share some regular system tools that I find essential to a desktop/portable computer. This doesn't reflect my workplace development environment, which is extremely locked down and provides little leeway for customization. These are personal favorite go-to apps that greatly ease my computing life.

Google Chrome

Google Chrome

Like Jerry, I switched primarily to Chrome in 2010, and it just felt like a better experience. I read the stats on memory usage, and saw that it doesn't offer any significant improvement over Firefox. It also lacks the many great add-ons that Mozilla has like Firebug, Live HTTP headers, Add N Edit Cookies, and YSlow. But I am so used to it I often get jarred into reality when I enter search terms into the URL bar of other browsers.

Adium Chat ClientAdium

As far as multi-chat clients go, Adium is fairly standard for OSX. I like the OTR (Off-the-record) encryption for chatting with other Adium users, and the fact that it supports nearly every chat protocol. Skype is still the way to go for video, until Apple fixes FaceTime for Mac.

 

Eclipse Helios IDEEclipse

Nothing beats the coverage of things you can develop in Eclipse. For me, it's Java. And it's great that I don't have to change IDE's when I want to work in Google AppEngine, GWT, Android, and PyDev. There might be better faster IDEs out there, but Eclipse is definitely a bang-for-the-buck tool that I cannot do without. And it's a divide by zero value because Eclipse is free!

VMWare FusionVMWare Fusion

Inevitably, we need to test how Windows users view our applications. I also find it funny that Adobe Flash uses what appears to be less resources when run in a Windows VM on IE8, then it does when running natively on Firefox/Chrome.

Macromates TextMateTextMate

"The Missing Text Editor for OSX". I have to agree. Syntax highlighting for most every language is quite delightful to view (except, amusingly enough, for ASP.NET). This is where Ruby and django development happens (if not in vim).

 

And now for some regular workstation utilities

The above list is fairly innocuous, and even standard for most developers. They are part and parcel to almost all things programmatic that I do on my machine. Of course, there are at least a half dozen terminal windows open as well.

iPulse

It is nice to see, at a glance, what your system is up to. I don't need a dedicated windowed application telling me all kinds of running graphs and alerts, I just need a little HAL-like widget in the corner of my screen that I can reference every once in a while if my system is slowing down.

Little Snitch

Little Snitch likes to tell me when some rogue program is trying to talk to the Internet. I use it as a line of defense against trojans or applications that I have not explicitly told to report to a server out there.

 

TaoEffect Espionage TaoEffect Espionage

This application encrypts specific applications and folders. While it's much like encrypting .dmg image files, it takes the manual process out of it and is very convenient. I use it mostly to lock down applications that might be storing PII in places on the filesystem I am not aware.

JungleDisk

You have rehearsed your backup/recovery strategy, right? JungleDisk is not the cheapest among the cloud backup solutions out there, but I like that I can use my own AWS S3 buckets; and that files are stored encrypted and immediately available if I need them. I just set it and forget it, and I know that my system isn't the only repository of my photos, documents, and code.

 

Don't obsess over the tool, just work

I know it's easy to debate this or that best tool for the job. Whole project portfolios have been lost in analysis paralysis. I am always checking out what others are using, but what drives it is getting to the task at hand: Creating cool stuff.

What are your favorite tools? Feel free to share in the comments.

Share |

Posted on January 15, 2011 by Dennis Mojado

Filed under #code | 0 Comments |  Digg it

Hofstadter's Law

It always takes longer than you expect, even when you take into account Hofstadter's Law.

–Douglas Hofstadter, Gödel, Escher, Bach: An Eternal Golden Braid

Share |

Posted on October 15, 2010 by Dennis Mojado

Filed under #code | 0 Comments |  Digg it

Securely Sending Your Repository to the Cloud

backup-manager is a great utility that supports delivery to Amazon S3.With this tool, it is possible to schedule jobs that do full or incremental backups and push them off to the cloud, even encrypted before they cross the wire. It reminds me a lot of duplicity, tarsnap, and desktop clients like JungleDisk, but is very easy to use and has little dependency on third parties.

Unfortunately, it does not work out-of-box, so to speak. First, set up AWS: Create a bucket in S3 dedicated for backup-manager.

Next, use apt to install backup-manager. It will run through some configurations, like what you'd like to backup (e.g. /etc, /home/git). Once it's installed, you can be stop here and begin backing up to local drive... Or, you can create the most resilient offsite backup ever. Install dependencies for connecting to S3. I'm using it to backup my git remote repositories on an Ubuntu server.

sudo apt-get install libperl6-slurp-perl libxml2-dev
sudo cpan XML::LibXML
sudo cpan Net::Amazon::S3

Once these are installed, all you need to do is follow the very detailed instructions in /etc/backup-manager.conf: Find the line export BM_UPLOAD_METHOD= and add "s3", add your AWS bucket access key and secret key, and if you are paranoid (like most offsite backup administrators are), set:

export BM_ENCRYPTION_METHOD="gpg"

and specify a key ID to encrypt to in BM_ENCRYPTION_RECIPIENT.

Try a test run, and make sure it saves the tarball where you specified and encrypted it. Set your cron for your favorite backup interval (I do daily backups), and voila! Secure redundant offsite backups that only a rogue asteroid or global thermonuclear war could take out.

Share |

Posted on September 14, 2010 by Dennis Mojado

Filed under #code | 0 Comments |  Digg it

Making git-daemon Work in Ubuntu

It is surprising, considering all the talk I've been hearing about the wonders of git, how much one has to dig around the Internet to figure out git-daemon (which comes with git-core) on Ubuntu (the most popular free Linux server distribution).

What is git-daemon you may ask? It's a way to make your own remote git repository server into one that allows read-only public access to your projects. It's how you share code with users who haven't given you ssh pubkeys and don't have commit rights. I won't get into how to make your own remote git repo server because that works good and fine through many online tutorials and blog entries much better presented than this one. Public repo access is where I hit a snag, and I thought I'd share some of my discoveries here for those who are googling like mad to get package git-daemon-run to work.

First, if you've searched around and seen people say "it's so easy, just install git-daemon-run", and you followed their directions, then you may have already failed. Do an apt-get purge git-daemon-run. For whatever reason (arcane discussion threads can tell you), simply trying to install apt git-daemon service on Ubuntu breaks. At least, it didn't work for me, and I stopped trying to figure out why a valid connection and url kept giving me "does not appear to be a git repository" in the logs.

You'll basically have to write your own /etc/init.d/git-daemon startup script:

#!/bin/sh

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:\
/usr/bin:/usr/lib/git-core
NAME=git-daemon
PIDFILE=/var/run/$NAME.pid
DESC="git daemon"
DAEMON=/usr/lib/git-core/git-daemon
DAEMON_OPTS="--base-path=/home/git/repositories --verbose \
--syslog --detach --pid-file=$PIDFILE --user=git \
--group=nogroup"

test -x $DAEMON || exit 0

[ -r /etc/default/git-daemon ] && . /etc/default/git-daemon

. /lib/lsb/init-functions

start_git() {
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--startas $DAEMON -- $DAEMON_OPTS
}

stop_git() {
start-stop-daemon --stop --quiet --pidfile $PIDFILE
rm -f $PIDFILE
}

status_git() {
start-stop-daemon --stop --test --quiet --pidfile $PIDFILE >/dev/null 2>&1
}

case "$1" in
start)
log_begin_msg "Starting $DESC"
start_git
log_end_msg 0
;;
stop)
log_begin_msg "Stopping $DESC"
stop_git
log_end_msg 0
;;
status)
log_begin_msg "Testing $DESC: "
if status_git
then
log_success_msg "Running"
exit 0
else
log_failure_msg "Not running"
exit 1
fi
;;
restart|force-reload)
log_begin_msg "Restarting $DESC"
stop_git
sleep 1
start_git
log_end_msg 0
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
exit 1
;;
esac

exit 0

(Here's a pastie link.) Make sure nothing's bound to default port 9418 (from your previous attempts at running git-daemon-run under runsvdir) and then change the script executable and run it:

sudo chmod +x /etc/init.d/git-daemon
sudo invoke-rc.d git-daemon start

Since your Ubuntu server is locked down with ufw (you are firewalling all but essential traffic, right?), don't forget to open the port:

sudo ufw allow proto tcp from any to any port 9418

Assuming you've already pushed a project to your remote server that is running gitosis, and made it accessible with touched file git-daemon-export-ok, And then try from your local machine to do an anonymous git:

git clone git://yourserver.com/pubproj.git

And it should check out your copy of the repo.

Share |

Posted on September 12, 2010 by Dennis Mojado

Filed under #code | 0 Comments |  Digg it