Skip to content

Instantly share code, notes, and snippets.

View matthiasg's full-sized avatar

matthiasg matthiasg

View GitHub Profile
@matthiasg
matthiasg / index.html
Created August 31, 2012 08:19 — forked from anonymous/index.html
The bi-directional animation is done by using ~ sibling selectors. ps. WebKit only -> uses appearance:none; Cross-Browser version by @ryanseddon: http://jsfiddle.net/ryanseddon/FeJT2/
<input type="radio" name="name" checked />
<input type="radio" name="name" />
<input type="radio" name="name" />
<input type="radio" name="name" />
<input type="radio" name="name" />
@matthiasg
matthiasg / generate.sh
Created November 2, 2012 07:33
sign and verify
#!/bin/bash
ssh-keygen -f $1 -b 1022 -q
ssh-keygen -e -f $1.pub -m PEM > $1.pem

on the guest SmartOS VM

pkg_add http://pkgsrc.joyent.com/sdc6/2012Q1/i386/All/smtools
# note this is going to shut down the VM
sm-prepare-image

on the global zone

dataset=$(zfs list | grep data | awk '{print $1}')
sudo zfs set mountpoint=/data $dataset
sudo groupadd graphite
sudo useradd -c "Graphite User" -m -d /data/graphite -g graphite -s /bin/bash graphite
sudo pkgin up
sudo pkgin -y ug
sudo pkgin -y in gcc47
sudo pkgin -y in openldap-client
@matthiasg
matthiasg / carbon-cache.sh
Last active June 4, 2018 23:25
getting graphite to run under a smartos base zone
#!/bin/bash
# Simple Ad Hoc Carbon Cache Service
#
# put in /opt/custom/share/svc/carbon-cache.sh
set -o xtrace
. /lib/svc/share/smf_include.sh
cd /
PATH=/usr/sbin:/usr/bin:/opt/custom/bin:/opt/custom/sbin; export PATH
@matthiasg
matthiasg / zfs-replication.sh
Created January 31, 2013 12:52
zfs replication script from Ryan Kernan
#!/bin/bash
#
# Author: Ryan Kernan
# Date: September 23, 2011
# Version: 1.1
# Credits: Mike La Spina for the original concept and script http://blog.laspina.ca/
#
# Mike La Spina - 1.1 added vars to support full paths on remote ssh executions
# Mike La Spina - 1.2 added var symbol to last_snap_shost input parse.
#
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
cd /tmp
pkgin install gcc-compiler gcc-runtime gcc-tools-0 ruby19 scmgit-base scmgit-docs gmake sun-jdk6
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz
tar -xzf rubygems-1.8.10.tgz
cd rubygems-1.8.10
@matthiasg
matthiasg / ZABBIX SMARTOS INSTALL.md
Last active December 12, 2015 03:29
zabbix compilation on smartos

downloaded zabbix downloaded libiconv and compiled it edited configure script to make sure the correct libiconv is used

This does not seem to be necessary anymore in newer sources

if test -f /usr/include/iconv.h; then 
   found_iconv=“yes” 
elif test -f /usr/local/include/iconv.h; then 
@matthiasg
matthiasg / dladm.md
Created February 7, 2013 07:02
network traffic per zone looked at manually (SmartOS) NOTE: THIS SEEMS TO NOT SHOW VNIC TRAFFIC. ALL VNICS ALWAYS SHOW 0 USE kstat -m link instead

list all interfaces in order with allowed ips (to figure out which interface is which virtual machine)

dladm show-linkprop -p allowed-ips

Example Output:

LINK         PROPERTY        PERM VALUE          DEFAULT        POSSIBLE
rge0         allowed-ips     rw   --             --             --
stub0        allowed-ips     rw   --             --             --

stub1 allowed-ips rw -- -- --

# Licensed under CC BY 3.0 http://creativecommons.org/licenses/by/3.0/
# Derived works must attribute https://gist.github.com/4492300 at the beginning, and the date.
##########################################################
Installing and Configuring SmartOS on Hetzner (with a /29)
##########################################################
# if you find this gist useful, please star it
# thanks to: jamesog, linuxprofessor, ryancnelson for help with routing