Monday, November 11, 2013

Lenovo K1 How to add Google Apps?

How to add Google Apps?

Are you looking for a simple answer on how to put Google Apps on your Lenovo K1 tablet? Did you just flash the updated Lenovo K1 stock image and noticed it had no Google Apps?

You should let me know how, a company of worth few billions of dollars manages not to give instruction how to do it easily?

Yes?

----------------------------

Few solutions for Lenovo K1:
Paper weight: use your Lenovo tablet to hold some papers in place. Or continue to sort the web (keep that google index fresh) how "monkey doodles" "ABC magic" and "super duper" trick you into downloading some spyware :D - Welcome to Android!
Hang it on a wall: when kids stop by - you could point to it and say - this is what happens when $ to maintain something like a Lenovo K1 Android port cost > benefit to Lenovo.

----------------------------
Bottom line with non Google products:
Do not buy another tablet unless it is of Google's Nexus brand - everything else is complete WASTE of your money!

I think I was saying the same thing 2 years ago. haha!

Wednesday, November 6, 2013

Removing VMs from VirtualBox gui

Deleted files backing the VM? "Remove" option does not work?

edit /Users/<userName>/Library/VirtualBox/VirtualBox.xml and remove entries with the name of your VM. Removing options like LastSomethingSomething was safe to do in my experimentation but the main section is here:

<MachineRegistry>

<MachineEntry uuid="{ee2edf14-bc0f-4436-9cb2-beb983425c8f}" src="/Users/user1/VirtualBox VMs/ui_vm/ui_vm.vbox"/>

<MachineEntry uuid="{911ad5ce-a269-4549-8cdc-b1d8df47df72}" src="/Users/user1/VirtualBox VMs/ui_vm_w_ga/ui_vm_w_ga.vbox"/>

</MachineRegistry>


Monday, July 15, 2013

Disable click anywhere in IntelliJ

If you are using this awesome IDE - it has an annoying default with virtual space!

Here is how to disable it: http://stackoverflow.com/questions/593214/how-do-i-turn-off-the-unlimited-whitespace-in-intellij-editor

Enjoy!

Sunday, June 2, 2013

Create custom shortcut for Anki on OSX

Using this guide you can create an application shortcut and have it "open at login".

The command to run in "Run Shell Script" is:

/Applications/Anki.app/Contents/MacOS/Anki -b ~/Dropbox/Documents/Anki

Sunday, May 26, 2013

OSX Open under Linux


  • Tested under Ubuntu 12.04LTS
echo "alias open='nautilus $1'" >> ~/.bash_aliases
source ~/.bash_aliases

To make things more permanent, you might want to log out - in so that entire bash environment gets refreshed.

Monday, April 22, 2013

Access EC2 from Terminal on OSX

Create/Append to ~/.ssh/config:
...
# EC2 Shared keys configuration                                                                                                                                                                                                                      
Host *.computer.amazonaws.com                                                                                                                                                                                                               
 User ec2-user                                                                                                                                                                                                                              
 HostName *.computer.amazonaws.com                                                                                                                                                                                                          
 IdentityFile ~/.ssh/<your_pem_key>.pem
...

then just

ssh <hostNameEndingWithRegexInConfig>

Done.

Didn't work? Tell me about it in the comments.


Sunday, February 24, 2013

Emacs favorites so far - (Work in progress)

Shortcuts:
M-: - block comment
M-/ - auto complete from context
C-M-% - regex-replace
C-q <specialChar> - C-q <TAB>, <SPACE> inserts those special chars

Commands:
M-x whitespace-mode - see all the cursing characters... :-P
M-x man RET cmd - view a man page properly in emacs

Startup file location ~/.emacs Tip: Avoid too many non-standard configurations. Keep your configuration file small and lean. If you evolve and/or heavily modify your environment, it will be increasingly harder to stay productive when you move over machines and won't have access to your superCustomized.el

or

Hypothesis 1: make your file available through some http service. curl it down. run with emacs and watch for errors?
i.e. `emacs some option <yourConfig>.el` if $? == 1 { #don't move HEAD, latest emacs does not work }. You should let me know once you figure this out. :D

Reference links:
http://sachachua.com

Rename bunch of files with Python

#!/usr/bin/env python                                                                                                                                                                                                                       

import os, re, commands

fileNameRegEx = '^([0-9])+'
pattern = re.compile( fileNameRegEx )

filesRenamed = 0

for f in os.listdir( '.' ):
    match = pattern.search( f )
    if match:
        newFileName = "{0}.regex".format( match.group(0) )
print "Renaming {0} to {1}".format( f, newFileName )
statusTuple = commands.getstatusoutput( 'mv {0} {1}'.format( f, newFileName ) )
if (statusTuple[0] == 0): filesRenamed += 1

print "Total files renamed {0}".format ( filesRenamed )


Thursday, February 7, 2013

Music - Above & Beyond

A post completely? (almost) unrelated to programming, software engineering. Big fan of above and beyond podcast. (http://www.mixcloud.com/aboveandbeyond). Check it out, if you like electronic, trance music and code away that python <insertYourLangHere> script, class away.

Wednesday, February 6, 2013

Managing multiple identities with git and ssh

If you have multiple git repositories, you should create an ~/.ssh/config file to reflect your "identities", here is mine:


# Default GitHub user
Host github.com
 HostName github.com
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/personalPrivateKey

# Work user account
Host supercode.com
 HostName supercode.com
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/my_workplace_companyPrivateKey

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,