This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
from pykka.actor import Actor | |
import pykka | |
import urllib | |
class Fetcher(Actor): | |
def fetch(self, url): | |
return urllib.urlopen(url).read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
After moving a machine from one Hypervisor to another it may be necessary to change some parameters, particularly likely are Network settings. This is a snippet for making changes to NIC configuration using an input file. | |
1) Update hostname and other trivial metadata. Hostname stored in the zone at /etc/nodename and /etc/hosts needs to be manually changed. | |
# echo '{"hostname": "rts-build-01.rts004.racktoplabs.com"}' | vmadm update bf43a067-b619-4383-bf6a-e2c44f0de575 | |
2) Get information about NICs setup in the VM. | |
# vmadm get bf43a067-b619-4383-bf6a-e2c44f0de575|json nics | |
[ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These two are per-cpu metrics, and we need to split them out. The output will return one cpu per line, so it should be easy to split into individual metrics. | |
These are context switches and we want to track whether there are instances where they skyrocket. | |
kstat -p cpu:*:sys:pswitch | |
kstat -p cpu:*:sys:inv_swtch | |
kstat -p unix:0:system_pages: | |
kstat -p cpu:*:sys:intr | |
kstat -p cpu:*:sys:xcalls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Copyright 2009-2015 RackTop Systems Inc. and/or its affiliates. | |
; http://www.racktopsystems.com | |
; | |
; The methods and techniques utilized herein are considered TRADE SECRETS | |
; and/or CONFIDENTIAL unless otherwise noted. REPRODUCTION or DISTRIBUTION | |
; is FORBIDDEN, in whole and/or in part, except by express written permission | |
; of RackTop Systems. | |
; | |
; @@DESCRIPTION@@ Configuration file for Netatalk -- Apple Filing Protocol. | |
; @@NAME@@ afp.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install prerequisites: | |
$ sudo apt-get install build-essential pkg-config checkinstall git-core avahi-daemon libavahi-client-dev libcrack2-dev libwrap0-dev autotools-dev automake libtool libdb-dev libacl1-dev libdb5.1-dev db-util db5.1-util libgcrypt11 libgcrypt11-dev | |
Download src: | |
$ cd /some/temp/dir | |
$ git clone git://git.code.sf.net/p/netatalk/code netatalk | |
$ cd netatalk | |
$ ./bootstrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
url='hastebin.com'; | |
curl_args='--silent --request POST --data' | |
[[ -z $1 ]] && str=$(cat /dev/stdin) || str=$1 | |
[[ -x $(which curl) ]] || (printf "%s\n" "Unable to locate cURL executable"; exit 1) | |
if [ -z "$str" ]; then | |
echo $usage; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m = json.dumps({ "metrics" : | |
[ | |
{ "device": "abc123xyz", | |
"class": "hw-storage", | |
"group": "hdd", | |
"component": "disk1", | |
"field": "errors", | |
"sub field": "soft errors", | |
"metric": "50", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
cd /; wget -O - http://pkgsrc.joyent.com/packages/SmartOS/bootstrap/bootstrap-2013Q1-x86_64.tar.gz | gzcat | tar -xf - ; cd | |
## alternatively: # cd /; curl -k http://pkgsrc.joyent.com/packages/SmartOS/bootstrap/bootstrap-2013Q1-x86_64.tar.gz | gzcat | tar -xf -; cd | |
## Rebuild pkgin database | |
pkg_admin rebuild | |
## Getting information about the available packages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple Ad Hoc SmartOS Setup Service | |
set -o xtrace | |
. /lib/svc/share/smf_include.sh | |
cd / | |
PATH=/usr/sbin:/usr/bin:/opt/custom/bin:/opt/custom/sbin; export PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
set -e | |
# Must be a valid filename | |
NAME=foo | |
PIDFILE=/var/run/$NAME.pid | |
#This is the command to be run, give the full pathname | |
DAEMON=/usr/local/bin/bar |