Skip to content

Instantly share code, notes, and snippets.

View jiwanlimbu's full-sized avatar

Jiwan Ninglekhu jiwanlimbu

View GitHub Profile
@jiwanlimbu
jiwanlimbu / json misc
Created September 6, 2017 15:21 — forked from JamesOBenson/json misc
Random json examples.
## Python 2.7
>>> import json
>>> import sys
>>>
>>> #load the data into an element
... data={"test1" : "1", "test2" : "2", "test3" : "3"}
>>>
>>> #dumps the json object into an element
... json_str = json.dumps(data)
@jiwanlimbu
jiwanlimbu / python-selenium-open-tab.md
Created February 5, 2016 03:28 — forked from lrhache/python-selenium-open-tab.md
Python Selenium - Open new tab / focus tab / close tab

On a recent project, I ran into an issue with Python Selenium webdriver. There's no easy way to open a new tab, grab whatever you need and return to original window opener.

Here's a couple people who ran into the same complication:

So, after many minutes (read about an hour) of searching, I decided to do find a quick solution to this problem.

Install Java JDK 6.0 update 31 on Ubuntu 12.04 LTS
Introduction
The first question is why are we installing an old JDK. The answer is that Oracle JDK 6.0 update 31 is the JDK recommended by Cloudera when installing CDH4 (Cloudera Distribution Hadoop v4).
This is an update to an older version of this post. Mainly I have changed the JDK from 1.6.0_26 to 1.6.0_31 as this is the recommended JDK for CDH4 .
Install Java
I have a 64 bit version of Ubuntu 12.04 LTS installed, so the instructions below only apply to this OS.