Skip to content

Instantly share code, notes, and snippets.

@Raboo
Raboo / temperature.sh
Last active August 29, 2015 14:07 — forked from fkleon/temperature.sh
FreeNAS 9 temperature script
#!/bin/sh
# Write some general information
echo System Temperatures - `date`
uptime | awk '{ print "\nSystem Load:",$10,$11,$12,"\n" }'
# Write CPU temperatures
echo "CPU Temperature:"
sysctl -a | egrep -E "cpu\.[0-9]+\.temp"
@Raboo
Raboo / rrd.py
Created October 12, 2014 18:03
What I think(haven't tested) could be a working class for freenas/gui/reporting/rrd.py
class DiskTempPlugin(RRDBase):
vertical_label = "Celcius"
def get_title(self):
title = self.identifier.replace("disk-", "")
return 'Disk Temperature (%s)' % title
def get_identifiers(self):
ids = []
import pprint
import httplib
try:
import json
except ImportError:
json = None
import sys
descriptors = list()
@Raboo
Raboo / httperf_tls.patch
Created March 18, 2015 12:01
httperf SSLv3 to TLSv1 patch
--- httperf/src/httperf.c 2015-03-17 15:34:53.523565000 +0100
+++ httperf/src/httperf.c.patch 2015-03-17 15:38:00.748836588 +0100
@@ -808,7 +808,7 @@
SSLeay_add_ssl_algorithms ();
/* for some strange reason, SSLv23_client_method () doesn't work here */
- ssl_ctx = SSL_CTX_new (SSLv3_client_method ());
+ ssl_ctx = SSL_CTX_new (TLSv1_client_method ());
if (!ssl_ctx)
{
@Raboo
Raboo / gist:2634766
Created May 8, 2012 13:04
Foreman cannot create catalog debug.
Processing FactValuesController#create (for 84.17.203.72 at 2012-05-08 14:15:02) [POST]
Parameters: {"facts"=>"[FILTERED]", "action"=>"create", "controller"=>"fact_values"}
User Load (0.3ms) SELECT * FROM `users` WHERE (`users`.`login` = 'admin') LIMIT 1
Setting current user thread-local variable to admin
Host Load (0.3ms) SELECT * FROM `hosts` WHERE (`hosts`.`name` = 'vguest03.unixwarez.org') LIMIT 1
Puppet::Rails::FactValue Load (0.5ms) SELECT * FROM `fact_values` WHERE (`fact_values`.host_id = 33)
Puppet::Rails::FactName Load (0.5ms) SELECT * FROM `fact_names` WHERE (`fact_names`.`id` IN (130,81,83,55,57,54,58,51,50,52,26,29,21,23,27,20,22,128,125,127,126,129,6,7,4,5,2,1,70,3,9,77,8,41,45,43,46,40,42,13,19,15,11,10,16,17,12,69,30,32,35,31,36,37,34,39,38,33))
Puppet::Rails::FactValue Delete all (6.2ms) DELETE FROM `fact_values` WHERE (`id` IN (5172440,5172441,5172442,5172443,5172444,5172445,5172446,5172447,5172448,5172449,5172450,5172451,5172452,5172453,5172454,5172455,5172456,517245
@Raboo
Raboo / gist:2708842
Created May 16, 2012 08:55
proxmox kvm conf file.
root@virtual:/etc/pve/nodes/virtual/qemu-server# cat 105.conf
args: -uuid f160a786-2bc4-4dfd-a031-b979a9aad519
bootdisk: virtio0
cores: 4
ide2: local:iso/rhel-server-6.2-x86_64-dvd.iso,media=cdrom
memory: 2048
name: vguest06.unixwarez.org
net0: virtio=7A:1A:67:FF:13:53,bridge=vmbr0
ostype: l26
sockets: 1
@Raboo
Raboo / mount.php
Created July 4, 2012 12:52
owncloud external files config
<?php return array (
'group' => array (
'users' => array (
'/$user/files/149999_w' => array ( 'class' => 'OC_Filestorage_Local', 'options' => array ( 'datadir' => '/mnt/w', ),),
),
),
);
@Raboo
Raboo / gist:3304520
Created August 9, 2012 14:13
gentoo-prefix bootstraping failed on binutils..
$ emerge --oneshot --nodeps sys-devel/binutils
--- snip ---
>>> Unpacking binutils-2.22-patches-1.2.tar.bz2 to /usr/local/gprefix/var/tmp/portage/sys-devel/binutils-2.22-r1/work
* Applying various patches (bugfixes/updates) ...
* 03_all_binutils-2.15.92.0.2-ppc64-pie.patch ... [ ok ]
* 08_all_binutils-RPATH_ENVVAR-smack.patch ... [ ok ]
* 10_all_binutils-2.22-ppc-textrels.patch ... [ ok ]
* 12_all_sh-targets.patch ... [ ok ]
@Raboo
Raboo / haproxy_gmetric.rb
Last active October 27, 2015 10:30 — forked from macros/gist:553c2ef4d4b0594154f5
haproxy multi socket gmetric
#!/usr/bin/ruby
require 'socket'
abort('Upgrade ruby or die...') if RUBY_VERSION < "1.9"
pidfile = '/var/run/haproxy_gmetric.pid'
if File.exist?(pidfile)
pid = File.read(pidfile).to_i
begin
Process.kill(0, pid)
@Raboo
Raboo / gttab.sh
Created April 11, 2013 09:19
gttab.sh - a script to run gnome-terminal in new tabs.
#!/usr/bin/env bash
#DEBUG_INFO= &>> debug.log
TERM_APP=gnome-terminal
DESKTOP=`xdotool get_desktop`
echo Desktop: $DESKTOP $DEBUG_INFO
SEARCH_CMD="xdotool search --onlyvisible --desktop $DESKTOP --limit 1 --class $TERM_APP"
#SEARCH_CMD="xdotool search --onlyvisible --desktop $DESKTOP --limit 0 --class $TERM_APP"
echo Search command: $SEARCH_CMD $DEBUG_INFO