Tuesday, January 29, 2013

Reset MacOSX Lion Password from terminal

Boot from Install Disc.

Open terminal.

$ resetpassword

Follow the gui and you are done.

This was really quick.

Sunday, January 20, 2013

groovy with emacs on ubuntu 12.04 lts

List of steps to get groovy syntax highlighting working with emacs:

1) Get all *.el for supporting syntax (this step assumes you have a configured github account, if false, you can manually download from github)
git clone git://github.com/russel/Emacs-Groovy-Mode.git

2) Create symbolic links to new .el groovy supporting files: (assuming you performed cmd 1 and in the same folder)
ln -s `pwd`/*.el /home/yourUserName/.emacs.d/

3) Create/append to init.el
(message "Loading emacs init.el")

;;;... <body of init.el> ...

;;; pick up modules into load path
(add-to-list 'load-path "/home/<yourUserName>/.emacs.d/")

;;; use groovy-mode when file ends in .groovy or has #!/bin/groovy at start
(autoload 'groovy-mode "groovy-mode" "Major mode for editing Groovy code." t)
(add-to-list 'auto-mode-alist '("\.groovy$" . groovy-mode))
(add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode))

;;; make Groovy mode electric by default.
(add-hook 'groovy-mode-hook
          '(lambda ()
             (require 'groovy-electric)
             (groovy-electric-mode)))

;;;... <end of body of init.el> ...

(message "Done loading emacs init.el")

(provide 'init)


3) On Ubuntu 12.04 LTS the default .emacs file is present but we need to load our newly modified /etc/<userName>/init .el

so:

rm ~/.emacs
ln -s /home/<yourUserName>/.emacs.d/init.el /home/<yourUserName>/.emacs

Optionally if you do not have your emacs configured, you will see 2 windows coming up. Make sure you enable inhibit start up screen option. That way your editor will always come up with the argument file or folder you passed.

If I missed anything, please let me know in the comments!

Happy Coding!

Wednesday, January 16, 2013

git-svn adventures

Checkout:

How to correctly checkout an existing svn repo, following a standard svn layout:

git svn clone http://svnRepoAddress.com/project --stdlayout

verify that you can see branches from svn:

git branch -r

Checkout a branch (notice the appended "Local"):

git checkout -b featureBranchLocal remotes/featureBranch
If you are trying to create a branch, refer to this SO post.

git checkout featureBranchLocal

git svn rebase

How to revert a commit from SVN using git-svn (I recommend doing it in order from HEAD, top-down, haven't tried otherwise but it would seem you would be resolving unnecessary conflicts):

git revert <commitHash>
git revert <commitAnotherHash>
git svn dcommit

SVN should have applications of reverted commits.

Pull down new svn branches: Fetch


git svn fetch 

Credit: SO posts: 1, 2, 3.

Sunday, January 13, 2013

HTC Sensation 4G - TMobile stuck on ICS

HTC and T-Mobile pretty much gave the finger to HTC Sensation 4G users. No Jelly Bean update. While it is infuriating to browse the countless Google Search results of garbage results, i.e.: how "monkey-balls" and "super-duper" solve your problems, I really just wanted simple, step by step guide on how to upgrade once and forget it.

Apps like Gmail should be run the way Google intended it to. HTC is better off devoting their resources to making some killer apps and monetizing on those efforts rather than making bunch of f* "glossy widgets".

Best, no-nonsense guide on how to effectively put Jelly Bean 4.2 (ok, OpenSensation is at 4.1.2, still far better than HTC stock image) on your phone:

Basic run down of steps:
  • Pay attention in guides to your phone's firmware version. The guide and links below mostly mention on how to do this without replacing the existing firmware.
  • Backup your phone. The adb command offers backup options as cli argument.
If you are reading this and thinking I need to spend $5 on Android backup software, just stop here and have your tech savvy friends take care of this "upgrade").
  • Unlock your HTC Bootloader from HTC Dev
  • Install 4EXT Recovery Image (see the 1st link, its basically a "high level, boot loader/rescue CD"  for your desktop computer)
  • Download the custom image you want (link 1 from supporting links) and place it as zip on your sdcard.
  • Reboot into recovery (see guide 1st link) and navigate within the 4EXT to install from zip. (Make sure here you wipe any "cached" settings and format the system partitions. Getting this right means the difference between a stable phone and bunch of random resets and lockups.
  • Get the gapps (3rd supporting link) for your image/version.
Optional next steps:

Fed up with T-Mobile horrible service (your service is probably OK if you live in a dense, urban area)? Changing providers?
  1. Get your phone IMEI # (behind battery)
  2. Call them up while you have service, request your phone be unlocked. Classic excuse would be "traveling internationally".
  3. Cancel service when you are ready. Verify that new sim works with your existing phone.
My cancelation fee per line is in ~$100-$150 (~half-off), so in most cases the earlier you cancel and start with some conservative plan, you will save money. ( $monthBill * 24 months > paying $100 a year of services like H20, Virgin Mobile or even (yes!) TMobile prepaid).

Update: Feb 27 2013

Jumping off carriers did not work for me as planned. The TMobile and HTC partnership goes through great lengths to lock you down to a network. Firmware on the phone is designed with that partnership in mind. It does some work to ensure that business is as usual. Best choices, I think, at this point are to get the $30 - unlimited data/text, 100 mins from TMobile. Its "month-to-month" still far better than my current bill of $130. Other "virtual operators" leasing TMobile service are probably good choices too.

Update: March 27 2013
Only issues so far is location. There were instances where enabling location without a phone reboot "dead locked" to the phone. Instant hangups and long pauses. The only "workaround" for this was to enable location and reboot the phone right away. Otherwise, there have been occasional lock ups but nothing major. Phone has been operating well for weeks.

Update: Jul 15 2013
Cancelled T-Mobile - after prepaid having essentially no "internet" data available this plan was ridiculous - for a smartphone. But TMobile knows this very well, that's why these plans are designed this way.
What am I using now? (with a new affordable phone from Ting.com)
Ting.com. ~$25/month - pay for what you use at very reasonable rates. 12 * $25 = $300 < 12 * $120 = $1440.

Update: Nov 6 2013
Looks like LycaMobile might get your GSM phone down to $16-20 monthly cost range. $8 for the sim/shipping. Know only 1 person that uses this, not sure what the service quality is.


Read carefully:
http://forum.xda-developers.com/showthread.php?t=1631861

Supporting links:
http://tips4droid.com/top-5-custom-rom-for-t-mobile-htc-sensation-4g/
http://forum.xda-developers.com/showthread.php?t=1494373
http://goo.im/gapps
http://forum.xda-developers.com/showthread.php?t=1494373
http://files.tamcore.eu/android/?dir=pyramid

Good luck,