Emacs+git: Adding Git Identity to the Emacs Frame Title

I am a heavy emacs person, so, when I started using Git, I really wanted to see what Git branch I am working on, and in what repository along with the frame title. I worked the problem by making a couple of tweaks to my ~/.bashrc and my ~/.emacs.d/init.el configuration.

First, I instructed my ~/.bashrc to set up two new environment variables for git (GIT_BRANCH & GIT_REPO_NAME):

bashrc code for setting up environment variables
1
PROMPT_COMMAND="export GIT_REPO_NAME=\$(git remote -v 2> /dev/null | grep \"origin.*fetch\" | awk '{print \$2}' | sed 's,https://github.com/\(.*\)/\(.*\),\1,g'); export GIT_BRANCH=\$(git branch 2> /dev/null | grep \"^*\" | awk '{print \$2}')"

Next, you use the environment variables that are set in your ~/.emacs.d/init.el like so:

init.el code for setting up emacs frame title (sadly, pygments does not have lisp support)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
;;; Rest of init.el code
(setq-default
  frame-title-format
  (concat
   "%f"
   (if (getenv "GIT_BRANCH")
       (concat
  " in [ " (getenv "GIT_BRANCH") "/" (getenv "GIT_REPO_NAME") " ]"
  )
     )
   )
  )

;;; All the other goodies in init.el

Note that everytime a new bash prompt appears, the environment variables are reset (this is good), but the environment variable does not change (within emacs, i.e.) as the working buffer changes from one directory to another (this is not so good because the other directory might be a different git repo/branch). I have to figure out a way to constantly refresh the frame title to reflect the current buffer’s git identity/status.

Here are some references that I am going to use to get me started: Emacs wiki and Emacs-fu.

Ditch Cable. Enjoy Free OTA HDTV With an Antenna and a Booster. Save $.

So, you want to enjoy TV programming minus the trouble and the expenses of paying for cable TV. If you live in the USA, you are in luck—my short note below will help you choose and install a simple antenna system that will get the TV signals to your TV. Hope you have a HDTV—these instructions will only work for HDTVs.

The very first step is to check if your address has decent TV reception. The website http://www.antennaweb.org will let you check if you can get any Over The Air (OTA) reception for any of the channels at your address. Hopefully, you get a few channels, and you can actually rid your home of a cable subscription. The next step is to get an antenna. There are a large number of HDTV antennas out there, but I currently use a Mohu Leaf antenna, which is quite discreet. Until recently, I used an Antennas Direct DB2, which was far bulkier, uglier but about as good. Depending on where you live, you may need a signal booster—I use a Motorola bi-directional RF amplifier, but I have also used a PCT 1-port bi-directional cable TV/HDTV amplifier signal booster with passive return path and works just as well.

Install the antenna and RF amplifier close to the TV. My antenna is right beside my HDTV—I didn’t bother hanging the antenna outside and running coax all the way to my TV—though with the Antennas Direct DB2 antenna model, though I could have. However, if I did that, I will probably have had to amplify the signal a couple of times before it reaches the TV (one signal booster per 75 feet of coax is a rule I read somewhere on the Internet).

The next step is to tune your TV to receive the channels your antenna is pushing. Many TVs have an autotune feature for antennas. On my Panasonic TV, you choose Menu->setup->auto tune, and bingo, the TV automatically tunes itself for all the TV programming it is picking up via the antenna.

Thats’ it! You are done! No more pesky monthly cable bills for your TV, and no more yearly arbitrary bill increases.

When you enjoy your TV programming via the antenna, be prepared to experience minor signal disruptions every once a while, but mainly when the weather goes bad. Where I live, in New England, I find the signal disruption happens when it rains, and when it snows, but also sometimes when the weather is perfect. On the whole, I don’t experience it very often at all—say a handful of times in a year. When the disruptions do occur, get a sense of what signal strength the TV is experiencing—this information has a direct correlation to the quality of the signal, and the disruptions you see (on my Panasonic TV, this is an item on the sub-menu). Most often, minor, 5-10 degree change in antenna direction solves the problem for me.. Considering the fact that my setup is in the basement with no access to the exterior around, this is remarkable.

I bought my OTA HD antenna goodies from Amazon a few years ago when the analog TV signals were beginning to be phased out (2008). At that time, the total cost of my antenna+signal booster for OTA HDTV were about $80 US. Since then, I’ve upgraded to the Mohu leaf antenna which is extremely discreet but just as good as my previous antenna (my wife argues that it is better). The total cost of TV programming for our household over the past 6 years = USD 120 (two antennas including the recent upgrade, and a signal booster). Total saved (assuming USD 10 per month for basic cable): USD 12 x 10 x 6 – USD 120 = USD 600). Everyone knows that cable companies charge more for basic channels, though.

Want a Landline Phone? Set Up a Completely Free Landline Service

Here in the North America, it must truly be one of the most crazy market observations of the day that there are people who actually pay for their non-mobile telephone service, the kind of service that until just a few years ago, used to be called a “landline.”

The landline lives among us. It lurks in all manner of deals, triple-plays, dual-plays and quad-plays; disguised as a service you need to pay for. “$20 unlimited US/Canada!” “$20 Unlimited world” (by “world,” they only mean “US/Canada and three other countries). All manner of other bizarre promotions exist.

But my question is—if you live in the US and Canada—why on earth would you want to pay for telephone service in an era when Google Voice exists, and there are a zillion ATA devices out there? I enjoyed free phone calling goodness for all 2011 through 2013, and in 2014, it appears like Google has every intention of keeping Google voice payment free for USA and Canada calls.

In the “good-old days” age of telephony, PSTN-based telephone companies were all the rage, and they needed physical telephone wires to be laid all the way into your home. This means that the cost of the telephone service was to p ay for the labor, maintenance of the cabling to your home and your neighbors’ and the infrastructure that needs to be maintained at the core. The great side effect of the Internet-based transport of telephony data (or VoIP) is th at the rapidly expanding infrastructure for Internet communications laid by the same companies that are selling you “landline” plans can also carry your telephony data. Psst: here’s a dirty secret: that is precisely what these co mpanies are doing when you pay them for a “landline—“ you are not exactly using a telephone wire very much any more.

My question is: why are you letting them do that?

I have been using free phone service via Google Voice and my regular, “landline” phone devices (Uniden phones or even an old fashioned corded one!) for nearly a year now, and I was a late entrant to this party! It is possible through the magic of an ATA device like ObiHai 110 and a Google Voice account, which is free, and already available to you if you have a Google mail account on gmail (that is, no additional crap to sign up for and maintain the password). I spent a total of $50 USD circa spring of 2011 on the ObiHai 110 device, and powered it up and connected it to via Ethernet to m y router in the basement. I also connected a “landline” cordless phone’s base to the phone (RJ11) port on my ObiHai 110 using a telephone jack. I then configured the ObiHai 110 device to use my Google Voice account details. Lo and behold! I now have a dial tone on my landline device, and you can use your cordless phone to make/receive phone calls in the USA and Canada.

Yes, it is really that simple!

Do it!

PS: There’s just one caveat to all of this—you cannot make 911 calls with the setup I describe above. Rather, for making 911 calls, you have to register with an old-fashioned phone company and pay only for their 911 service (don ’t you just hate that!). Read a crisper introduction to some hacks on this front.

Ivan Jovanovic’s Octopress Theme

Ivan’s Octopress theme is really very nice.

Quite a while ago, I used to enjoy far blander themes, and the high-key/black on white theme that became very popular with Google’s main webpage was a big hit with me well before Google’s time. In fact, that was my webpage theme for a long time. It was actually inspired by someone at MIT.

Anyway, I think a change now and then is good for you. Ivan’s theme strikes the right balance between the bland/big lettered web sstyles of today and a genuine appreciation for color and font rendition on modern machines.

Epson V700

I found that the basic Epson V700 scanner works quite well with the OEM software that came with it. I tried using VueScan, and wanted to like it, but I must say the program is a little counterintuitive—maybe the fact that the trial version of VueScan on Windows and (Ubuntu) Linux differ by quite a bit seems to have played a role in this decision. I liked that VueScan works in Linux, and I might gravitate towards it for that reason at a later time. For now, it appears like I am happy with a workflow that involves my Epson V700 OEM software and Windows XP.

On a related note, what about the iScan software and related drivers from the Epson site (see this thread on the askubuntu.com forum? I still have not tried this software on the Ubuntu box. I’ll post my results here soon after I try it.