Skip to content

Instantly share code, notes, and snippets.

View matthiasg's full-sized avatar

matthiasg matthiasg

View GitHub Profile
@matthiasg
matthiasg / docs style (bootstrap)
Created August 5, 2013 06:26
the callouts from the bootstrap documentation
/* Side notes for calling out things
-------------------------------------------------- */
/* Base styles (regardless of theme) */
.bs-callout {
margin: 20px 0;
padding: 15px 30px 15px 15px;
border-left: 5px solid #eee;
@matthiasg
matthiasg / readme.md
Created February 21, 2013 12:54
smartos, reconfigure sata drive on the fly

cfgadm to list drives

[root@54-04-a6-91-2b-27 /opt]# cfgadm
Ap_Id                          Type         Receptacle   Occupant     Condition
sata0/0::dsk/c2t0d0            disk         connected    configured   ok
sata0/1::dsk/c2t1d0            disk         connected    configured   ok
sata0/2::dsk/c2t2d0            disk         connected    configured   ok
sata0/3::dsk/c2t3d0            disk         connected    configured   ok
sata1/0::dsk/c0t0d0            disk         connected    configured   ok

sata1/1::dsk/c0t1d0 disk connected configured ok

# 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
@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 -- -- --

@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 
# 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 / 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.
#
@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
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

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