Skip to content

Instantly share code, notes, and snippets.

@dnozay
dnozay / core-site.xml
Created July 2, 2013 07:49
install hadoop on fedora (fc17)
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!-- Put site-specific property overrides in this file. -->
<configuration>
<property>
<name>hadoop.tmp.dir</name>
<value>/app/hadoop/tmp</value>
<description>A base for other temporary directories.</description>
import logging
LOG_MODULE_NAME = logging.getLogger(__name__)
def DEBUG(msg):
global LOG_MODULE_NAME
LOG_MODULE_NAME.debug(msg)
def foo():
DEBUG('oh hai, this should be line 9')
@dnozay
dnozay / testlink-cli.py
Created September 9, 2013 18:16
small testlink CLI using TestLink-API-Python-client
@dnozay
dnozay / .bash_profile
Created September 11, 2013 18:22
create a ramdisk on OSX.
# you can add this to your ~/.bash_profile
# based on: http://www.tekrevue.com/tip/how-to-create-a-4gbs-ram-disk-in-mac-os-x/
create_ramdisk() {
# usage: create_ramdisk ramdisk_name size_in_kb
# e.g. "create_ramdisk ramdisk 4096" will create a 4GB ramdisk.
let ramsize=$2*2048;
diskutil erasevolume HFS+ $1 `hdiutil attach -nomount ram://$ramsize`;
}
@dnozay
dnozay / slave1-config.txt
Created February 14, 2014 23:39
zfs hung on jenkins slave.
[root@jenkins-slave1 jenkins]# uname -r
2.6.32-431.3.1.el6.x86_64
[root@jenkins-slave1 jenkins]# zdb
zfs-data:
version: 5000
name: 'zfs-data'
state: 0
txg: 4
pool_guid: 11276092939463563636
hostid: 168453632
@dnozay
dnozay / messages.log
Created February 18, 2014 20:11
zfs hung on reboot during mount.zfs
Feb 18 11:38:31 jenkins-slave1 kernel: SysRq : Show State
Feb 18 11:38:31 jenkins-slave1 kernel: task PC stack pid father
Feb 18 11:38:31 jenkins-slave1 kernel: init S 0000000000000002 0 1 0 0x00000000
Feb 18 11:38:31 jenkins-slave1 kernel: ffff88013dc0b908 0000000000000082 0000000000000000 ffff8800282968a8
Feb 18 11:38:31 jenkins-slave1 kernel: ffff8801388aab18 0000000000002485 ffff8801388aaae0 0000000000000001
Feb 18 11:38:31 jenkins-slave1 kernel: ffff88013dc09ab8 ffff88013dc0bfd8 000000000000fbc8 ffff88013dc09ab8
Feb 18 11:38:31 jenkins-slave1 kernel: Call Trace:
Feb 18 11:38:31 jenkins-slave1 kernel: [<ffffffff8152942d>] schedule_hrtimeout_range+0x13d/0x160
Feb 18 11:38:31 jenkins-slave1 kernel: [<ffffffff8109b656>] ? add_wait_queue+0x46/0x60
Feb 18 11:38:31 jenkins-slave1 kernel: [<ffffffff8119fe65>] ? __pollwait+0x75/0xf0
@dnozay
dnozay / arcstats.txt
Created February 19, 2014 01:57
stuck in zio_wait
** this is 5min BEFORE the hang **
+ cat /proc/spl/kstat/zfs/arcstats
+ tee /zfs-data/jenkins/workspace/syslog.jenkins-slave2/arcstats.txt
4 1 0x01 84 4032 14259512326 11568069705331
name type data
hits 4 85134938
misses 4 697247
demand_data_hits 4 1358021
demand_data_misses 4 83814
@dnozay
dnozay / hung-tasks.txt
Created February 21, 2014 18:58
kswapd0 triggering hell.
Feb 19 19:56:24 jenkins-slave1 kernel: hrtimer: interrupt took 4942027 ns
Feb 19 21:45:03 jenkins-slave1 kernel: INFO: task kswapd0:59 blocked for more than 120 seconds.
Feb 19 21:45:03 jenkins-slave1 kernel: Tainted: P --------------- 2.6.32-431.el6.x86_64 #1
Feb 19 21:45:03 jenkins-slave1 kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Feb 19 21:45:03 jenkins-slave1 kernel: kswapd0 D 0000000000000003 0 59 2 0x00000000
Feb 19 21:45:03 jenkins-slave1 kernel: ffff88013976fb38 0000000000000046 0000000000000000 ffff88013976fa90
Feb 19 21:45:03 jenkins-slave1 kernel: ffff88013976fa90 ffff88013aa52308 ffffffff81fcf800 ffffffff811f35a0
Feb 19 21:45:03 jenkins-slave1 kernel: ffff88013df44638 ffff88013976ffd8 000000000000fbc8 ffff88013df44638
Feb 19 21:45:03 jenkins-slave1 kernel: Call Trace:
Feb 19 21:45:03 jenkins-slave1 kernel: [<ffffffff811f35a0>] ? proc_delete_inode+0x0/0x80
@dnozay
dnozay / README
Created February 28, 2014 02:05
nginx + php-fpm + x-accel-redirect + ldap
install the packages
# yum install php-fpm php-ldap
then make sure php-fpm can create sessions
and change user and group to be nginx
see /etc/php-fpm.d/www.conf for more details
# sed -i -e 's/apache/nginx/g' /etc/php-fpm.d/www.conf
# sed -i -e 's/;catch_workers_output = yes/catch_workers_output = yes/' /etc/php-fpm.d/www.conf
@dnozay
dnozay / README
Last active January 20, 2023 19:42
syslog (port 10514) firewall configuration for vSphere
goal
----
The goal is send syslog traffic to a remote host and use unpriviledged ports;
so that I can have my logstash (http://logstash.net/) server not need to
run as root. On vSphere 5.1, tcp 1514 is covered by the syslog rule, but
in my case udp is preferred.
installation
------------