Skip to content

Instantly share code, notes, and snippets.

View unpluggedcoder's full-sized avatar

UnpluggedCoder unpluggedcoder

View GitHub Profile
@senthil245
senthil245 / JDK 1.6 Installation in Ubuntu
Created July 27, 2013 02:16
Step by step installation of JDK 1.6 in Ubuntu
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.
@brantfaircloth
brantfaircloth / cool_argparse_stuff.py
Created December 7, 2011 16:47
Some cool argparse stuff
class FullPaths(argparse.Action):
"""Expand user- and relative-paths"""
def __call__(self, parser, namespace, values, option_string=None):
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values)))
def is_dir(dirname):
"""Checks if a path is an actual directory"""
if not os.path.isdir(dirname):
msg = "{0} is not a directory".format(dirname)
raise argparse.ArgumentTypeError(msg)
@stedolan
stedolan / coreinfo
Created July 18, 2011 16:09
Prints number of cores, CPU topology and cache topology/size on Linux machines
#!/bin/bash
unshared () {
grep '^[0-9]\+$' "$1" > /dev/null
}
for cpu in $(ls -d /sys/devices/system/cpu/cpu[0-9]* | sort -t u -k 3 -n); do
echo "${cpu##*/}: [Package #$(cat $cpu/topology/physical_package_id), Core #$(cat $cpu/topology/core_id)]"
if ! unshared $cpu/topology/core_siblings_list; then
echo " same package as $(cat $cpu/topology/core_siblings_list)"