Set Proxy Server via Windows Command Line

Posted in howto on April 10th, 2012 by Aditya – Be the first to comment

Type this in the cmd window to set it (or put it inside a .bat files):


set HTTP_PROXY=http://userid:pass@proxywhatever.domain.com:portnumber

I use this to download python module via PIP every now and then.

.gitignore setting for Windows Visual Studio

Posted in programming on March 24th, 2012 by Aditya – Be the first to comment

the one I used

# from
# http://www.diaryofaninja.com/blog/2011/06/01/how-to-easily-create-a-gitignore-file-inside-windows-explorer
# https://github.com/github/gitignore/blob/master/Global/VisualStudio.gitignore
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.sln.docstates

# Build results
[Dd]ebug*/
[Rr]elease*/
[Bb]uild/
[Bb]in
*_i.c
*_p.c
*.ilk
*.log
*.lib
*.meta
*.[Oo]bj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
*.vssscc
.builds
Ankh.NoLoad

# Visual C++ cache files
*.[Cc]ache
ipch/
*.aps
*.ncb
*.opensdf
*.sdf

# Visual Studio profiler
*.psess
*.vsp

# ReSharper is a .NET coding add-in
_ReSharper*
*.resharper
[Tt]est[Rr]esult*

# Installshield output folder
[Ee]xpress

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish

#Subversion files
.svn

# Office Temp Files
~$*

# Others
[Oo]bj
[Tt]humbs.db
sql
TestResults
*.Cache
ClientBin
stylecop.*
*.dbmdl

*.DS_Store
Generated_Code #added for RIA/Silverlight projects

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML

Prettifying Java XML output

Posted in java on March 8th, 2012 by Aditya – Be the first to comment

This following code is to display a long string of XML into a textfield with proper indentation and such. I grab it from one of the websites. read more »

Change git origin

Posted in Uncategorized on February 29th, 2012 by Aditya – Be the first to comment

In some cases, I want to change git origin URL. Say when switching from SSH to HTTPS protocol. Easiest way to do so is by changing origin information inside .git/config

Using Git behind proxy

Posted in Uncategorized on February 29th, 2012 by Aditya – Be the first to comment


$ git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
$ git config --system http.sslcainfo /bin/curl-ca-bundle.crt
$ git remote add origin https://mygithubuser:mygithubpwd@github.com/repoUser/repoName.git
$ git push origin master

proxyuser= the proxy user I was assigned by our IT dept, in my case it is the same windows user I use to log in to my PC, the Active Directory user
proxypwd= the password of my proxy user proxy.server.com:8080 = the proxy name and port, I got it from Control Panel, Internet Options, Connections, Lan Settings button, Advanced button inside the Proxy Server section, use the servername and port on the first (http) row.
mygithubuser = the user I use to log in to github.com
mygithubpwd = the password for my github.com user
repoUser = the user owner of the repo
repoName = the name of the repo

Prerequisite: Git 1.7 and above

from

http://stackoverflow.com/questions/783811/getting-git-to-work-with-a-proxy-server

setting the $HOME environment for portable Git

Posted in Uncategorized on February 29th, 2012 by Aditya – Be the first to comment

I got this information from http://markashleybell.com/articles/portable-git-windows-setting-home-environment-variable. Visit his blog. Quite neat.

Anyway, I want to create portable git environment where I can continue my work within different environment. Portable git can do the trick. To bad it is tied to user directory for SSL information.

The easiest way to do this is to create folder home under

git\home\aditya

(you can change ‘aditya’ with your username and ‘git’ with your git portable folder home)

Followed by adding…

For git-bash.bat user

HOME="/e/git/home/aditya"

above the line

# normalize HOME to unix path
HOME="$(cd "$HOME" ; pwd)"

in e:\git\etc\profile

For git-cmd.bat user
adding

@set HOME=%git_install_root%\home\aditya

after

@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%

in git-cmd.bat

Python Keywords Sample

Posted in python on August 26th, 2011 by Aditya – 2 Comments

Recently I was attempting to follow tutorial on python from LearnPythonTheHardWay.org (yes the name explains it pretty well). I am currently on exercise 37 where I need to review list of Python symbols among many other things. I decided to go slightly beyond what is required and jot down some snippets code too. Here are they read more »

List of Budget Airlines Between Jakarta Singapore

Posted in list on June 22nd, 2011 by Aditya – 1 Comment

Booking via online travel agents might be convenient and easy. Not to mention, their names always popped up on the first few rows of popular search engine. However, those online travel agents might not , for whatever reasons, list regional airlines in their sites which in all fairness cheaper than full fledged carrier. This post will list budget airlines that serve routes between Singapore and Jakarta as well as around the South East Asia region. You can definitely book those airlines via their own website and in many cases cheaper than what online travel agent offers.

read more »

Find Canon G10 Actual Actuation or Shutter Count

Posted in howto on June 13th, 2011 by Aditya – 2 Comments

Many people mistakenly believe the name of the last photo (e.g. 101-4511 is 14511st pic) is the indication of the shutter count of the camera. While it might be true most of the time, those number is not accurate as the software can be modified. Finding the REAL actual actuation or shutter count from Canon G10 can be done with a bit of effort.
read more »

String Split() with special character

Posted in java on February 28th, 2011 by Aditya – Be the first to comment

Being an Information Systems Management, I have not been really exposed to much nitty gritty details of programming – even on the language that I am exposed to the most – Java. Yes I have done my fair share of debugging and such, but even so I often stumble in some random stuff that waste quite a number of minutes. For example, with String split() method that I was worked with. read more »