Friday, February 10, 2017

Java - redirect standard output stream to file


Buy Moto series phones: Moto E, Moto G, Moto X or Other phones
Buy eBooks from Flipkart
-----------------------------------------------


 We can redirect all System.out.println output to a file with below code snippet.

 System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream("/tmp/output.txt"))));

Monday, January 30, 2017

Create a desktop shortcut in Mac with Automator


Buy Moto series phones: Moto E, Moto G, Moto X or Other phones
Buy eBooks from Flipkart
-----------------------------------------------


Open Automator
File > New
select Application
Then add "Run Shell Script" option
Give the command to run, here I am giving Google chrome canary with no proxy option

/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary --no-proxy-server=
Then Save with the name you want.







By default this will show automator icon.
Here is how to set your favorite icon.
Right click on Chrome canary icon and select "Get Info"



Then click on the icon and press Cmd+c
to copy the icon.
Now open info window on newly created icon, select the icon in the same place (which shows automator icon) press Cmd+v to paste the previously copied icon.


Latest Posts