Skip to content

Instantly share code, notes, and snippets.

@dkilcy
dkilcy / hadoop-pseudo-distributed.txt
Last active December 26, 2015 08:38
Pseudo-distributed mode setup for Hadoop 1.2.1 setup on Linux Mint development system.
There are 3 modes: Standalone, Pseudo-Distributed, Fully-Distributed
Notes:
Standalone is limited to only 1 mapper and reducer where everything runs in 1 JVM.
Standalone uses the regular linux filesystem (no "hadoop fs")
In pseudo-distributed, HDFS is not a "real" physical filesystem, you can only add/view/delete it using "hadoop fs"
Need to export jar file and run using "hadoop jar" to avoid version mismatch (exp with JobTracker)
@dkilcy
dkilcy / flash-cubieboard2.txt
Last active December 26, 2015 08:39
Flash Cubieboard2 with Lubuntu
From Windows 7:
- Flash using PhoenixSuit V1.0.7 with cb-a20-lubuntu-server-13.06-v1.00.img
PhoenixSuit download : http://ubuntuone.com/3Z95tYxkcpvKq5oc2Zdpka
Lubuntu download: http://dl.cubieboard.org/software/a20-cubieboard/lubuntu/
Extract lubuntu to directory
Start PhoenixSuit. Select "Firmware". Select libuntu image
Enter FEL mode:
@dkilcy
dkilcy / lubuntu-cubieboard2-config.txt
Last active December 26, 2015 08:49
Lubuntu Server 13.06 configuration on Cubieboard2 Notes
- export LANG=C
- Update release (apt-get update)
- Add missing python-apt package: apt-get install python-apt
- Add static network route and set hostname (/etc/hostname and /etc/hosts)
- export PS1=...
- Use MiniTool Partition Wizard Home Edition to create ext4 filesystem on microSD (Samsung microSDXC UHS-I Card Pro 64GB)
- Mount SDXC card and add to /etc/fstab
use dmesg | grep mccblk to find correct mount point
mkdir /data
@dkilcy
dkilcy / centos-ipmi.md
Last active August 29, 2015 14:08
CentOS IPMI
dmidecode -t system

yum install OpenIPMI OpenIPMI-tools

service ipmi start
chkconfig ipmi on

ipmitool sel list
@dkilcy
dkilcy / graph1.py
Created January 23, 2015 00:08
RRDtool sample program 1
import calendar
import datetime
import random
import rrdtool
import time
from rrdtool import update as rrd_update
current_time = 0
start = 0
@dkilcy
dkilcy / RRDxportSpike.py
Last active September 26, 2017 19:52
Program to detect and correct spikes in RRDtool graph
import math
import pickle
#import rrdtool
import subprocess
import os
import sys
import traceback
import xml.sax
import numpy
@dkilcy
dkilcy / eat_memory.py
Created February 6, 2015 00:29
Program to eat memory and exit
import os
import psutil
PROCESS = psutil.Process(os.getpid())
MEGA = 10 ** 6
MEGA_STR = ' ' * MEGA
def pmem():
#tot, avail, percent, used, free = psutil.virtual_memory()
svmem = psutil.virtual_memory()
@dkilcy
dkilcy / eat_memory.c
Created February 6, 2015 02:41
Exhaust all memory
int main()
{
while(1)
{
void *m = malloc(1024*1024);
memset(m,0,1024*1024);
}
return 0;
}
@dkilcy
dkilcy / disk-write-performance.md
Created March 8, 2015 15:15
disk-write-performance.md
tune2fs -I 256 /dev/hda1

rw,noatime,barrier=1,data=ordered
commit=300

write caching    $ hdparm -W[01] /dev/sda

write barrier    barrier=[01] in /etc/fstab 

Keybase proof

I hereby claim:

  • I am dkilcy on github.
  • I am dkilcy (https://keybase.io/dkilcy) on keybase.
  • I have a public key ASB_Z8gEY4jumrCyk3uvZvT6dufVpc3eslREdZyrbP30bgo

To claim this, I am signing this object: