Gradle proxy settings

If you are behind the corporate proxy, you can configure Gradle to use the proxy by following settings.

Create a file called ~/.gradle/gradle.properties

Generally is in «USER_HOME»/.gradle/gradle.properties, where «USER_HOME» is your home directory.
That’s typically one of the following, depending on your platform:
C:\Users\<username> (Windows Vista & 7+)
/Users/<username> (macOS)
/home/<username> (Linux)

Add the settings related to proxy.

systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost

Also add the HTTPS proxy settings

systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost

If your proxy is a CNTLM then you can also configure

* Set the http.proxyUser system property to a value like domain/username.
• Provide the authentication domain via the http.auth.ntlm.domain system property.

Class JavaLaunchHelper is implemented in both

I was getting the below error which compiling my code.

objc[3789]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java (0x1095e64c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1096724e0). One of the two will be used. Which one is undefined.

Solution.

Upgrade JDK to the latest version from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Details related are also discussed at https://stackoverflow.com/questions/18794573/class-javalaunchhelper-is-implemented-in-both-libinstrument-dylib-one-of-th

How to fix when Nexus 5 cannot detect Wifi SSID

Suddenly my phone today could not detect the WiFi SSID for my home router. Strangely all other devices at my home are able to connect.

I was not able to figure out why it is the case and I restarted my Router and Phone. But, it did not help.

I logged into router and checked what is the channel of current wifi connection. It was set to automatic and its value was 12.

I found the issue with my phone plus higher channels.
https://www.reddit.com/r/Nexus5/comments/31ljh5/connect_to_wifi_channel_12_or_13/

I manually set the channel to a lower number (2) and then my phone was able to detect and connect to the Wifi

How to get Wunderlist list of all tasks in different lists

Wunderlist has become my default task management tool.

I was looking for a way to see on a single page the list of all tasks, in the all the lists.

After lot of searching, I found a way inside Mac application of Wunderlist.

If you want to see list of all tasks on Mac (might be in other OS also)

  • Click Open preferences
  • Click on Smart List
  • Check the option next to ALL and make it Auto
  • Save and then you should see list of all tasks inside the menu option All

How to prettify JSON in VS Code Editor

I have been using VS code editor from 1 month now. I am big fan of it and now it has become the default editor for me.

Here is a tip if you want to prettify son in VS code.

Download the extension Prettify JSON


Install and Reload the editor

From the Command Palette, type Prettify JSON and hit enter

If you have JSON in your editor, it would shown now in pretty format.

Enjoy using VS Code

How to install libevents on Linux

Dowload the library

  
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar xzf libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure --prefix=/opt/libevent # Change path as required
make
make install

How to get internet access inside Jupyter notebook

Create a file

vi ~/.ipython/profile_default/startup/00-startup.py

Add the following inside it
(Change proxy details as per your own environment)

import sys,os,os.path
os.environ['HTTP_PROXY']="http://127.0.0.1:3128"
os.environ['http_proxy']="http://127.0.0.1:3128"
os.environ['HTTPS_PROXY']="http://127.0.0.1:3128"
os.environ['https_proxy']="http://127.0.0.1:3128"

# Test

Inside the notebook cell

import requests
requests.get("http://google.com")