Category Archives: Tech

Everything technology related .. the latest shiny thing, software development, ideas for new products, how to do something with something

Working with rpms (extract, list contents)

Unix. I love thee!

Extract an rpm without installing in to the current directory (really, the rpm command should support this):

$ rpm2cpio myrpmfile.rpm | cpio -idmv

*i: Restore archive

*d: Create leading directories where needed

*m: Retain previous file modification times when creating files

*v: Verbose i.e. display progress

List contents of an rpm:

$ rpm -qlp myrpmfile.rpm

source

Git: beautiful git logs and listing files in a commit

Working with git is fun. However, it is easy to get tired of the log list of parameters one has to use to very often. Git aliases are a great way to deal with this.

For instance, the standard git log, it pretty much useless in any large project, where there are several hundred commits in a day. Most often, the commit you are looking for in probably several pages deep.

The following is from the latest linux.git

Fortunately, git log has options one can use, that make the output look like this:

Another useful command is git show, with the –name-only option. It displays the list of files in a particular commit.

Macports from behind a proxy

I’ve been using my MBP as the main computer at work for a couple of weeks now. It is not officially “supported”, and I’m left to my own devices to figure out any issues that arise.

Configuring proxies on the mac for all GUI applications is quite simple. However, most of the *nix tools have trouble with it. Macports, which I love to hate, should read it from the environment’s $http_proxy and $rsync_proxy, but for some reason doesn’t really do so. The simplest fix, is to override system env variables, and use the macport configuration file to provide the proxy. It works like a charm (one of reason to like macports, I suppose)

Edit $HOME/macports/etc/macports/macports.conf, and add the following. (I prefer installing macports in its own directory .. if it ever gets too big, I can delete the directory, and go back to using standard tools that come with the mac)

Two-factor authentication and spicy salmon sashimi don

For the last few months I’ve been annoyed. Two or three times a week, I get a flurry of emails from Facebook and twitter claiming that I reset my password. Sounds like a first-world problem? It is. However, I have 4 emails linked to my Facebook account and one to my twitter account. I get on average 15-20 mails a week, and I dutifully dis-avow each one of them.

Then, this happens. It scares the hell out of me, but I procrastinate. After a good two weeks, and 40 mails later, I’ve finally caved, and enabled it. Now, it’s practically impossible to hack my account. Password + token to access from any new device, and I can remotely revoke access to any device I lose.

Now, what does it have to do with sashimi, you ask? Well, nothing really! That’s just the bait to get you to read this most important thing. Don’t be like me, and procrastinate forever. Enable two-factor authentication on both google and Facebook! You’ll be glad you did. Both have very compelling implementations that are easy to configure and use.

Security is like good sushi — once you’ve tasted the good kind, it’s hard to go back to just good enough.

Well, here’s your reward for reading this far:
20120823-214038.jpg