Skip to content

Instantly share code, notes, and snippets.

@pccowboy
pccowboy / smart-pub.md
Created December 20, 2022 06:56 — forked from glinton/smart-pub.md
SmartOS zone manipulation. Snapshot, image, rollback, and migrate.

SmartOS Zone Manipulation

Notes on snapshots, images, and migrations

Create Zone/KVM

# Create zone
vmadm create <<EOL
{
 "brand": "joyent",
 .
@pccowboy
pccowboy / gist:3ae33e9fcf97f9ed7a10
Created February 1, 2016 17:42
memory status, after error for mpt_sas0 appeared on console
[root@headnode (home) /var/tmp]# echo ::memstat | mdb -k
Page Summary Pages MB %Tot
------------ ---------------- ---------------- ----
Kernel 2239778 8749 21%
ZFS File Data 744147 2906 7%
Anon 7057300 27567 67%
Exec and libs 97283 380 1%
Page cache 86854 339 1%
Free (cachelist) 161660 631 2%
Free (freelist) 94140 367 1%
@pccowboy
pccowboy / gist:6b39737e7845dfe462e0
Last active December 21, 2015 17:55
trying to tunnel to madtom through headnode, works on headnode, but connection refused from another host with access to the 10.67.42.x net
setup of matna was for lab, so all zones are running on headnode.
[root@headnode (home) ~]# ifconfig
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g3: flags=1000943<UP,BROADCAST,RUNNING,PROMISC,MULTICAST,IPv4> mtu 1500 index 2
inet 10.67.41.2 netmask ffffff00 broadcast 10.67.41.255
ether 0:25:90:11:7:e2
external0: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4,CoS> mtu 1500 index 3
inet 10.67.42.2 netmask fffffe00 broadcast 10.67.43.255
@pccowboy
pccowboy / gist:7906277
Created December 11, 2013 07:23
attempt to update IPMI address
curl -X PUT -d '{ "sp_ip" : "'$NEW_SP'"}' -H "Accept: version=2,application/json" -H "Content-Type: application/json" http://foreman.someone.com/api/hosts/$x -u dswift:PASSWORD -s;
root@:/var/lib/tftpboot# curl -X PUT -d '{ "build": true }' -H "Accept: version=2,application/json" http://foreman.someone.com/api/hosts/rtbdserv-v02-22b.btrll.com -u USER:PASS -s
{"host":{"build":false,"installed_at":"2013-12-10T13:14:54Z","subnet_id":29,"comment":null,"last_compile":null,"operatingsystem_id":2,"puppet_status":251666433,"domain_id":1,"id":1100,"ip":"165.254.30.86","last_freshcheck":null,"root_pass":"","compute_resource_id":null,"hostgroup_id":11,"image_id":null,"medium_id":3,"owner_id":null,"certname":"rtbdserv-v02-22b.someone.com","enabled":true,"environment_id":1,"serial":null,"last_report":"2013-12-10T15:02:01Z","architecture_id":1,"created_at":"2013-12-09T19:54:01Z","managed":true,"puppet_ca_proxy_id":1,"disk":null,"image_file":"","model_id":2,"name":"rtbdserv-v02-22b.btrll.com","owner_type":null,"source_file_id":null,"updated_at":"2013-12-10T15:05:39Z","use_image":null,"location_id":null,"mac":"00:25:90:c9:c8:7a","ptable_id":10,"uuid":null,"organization_id":null,"puppet_proxy_id":null}}
@pccowboy
pccowboy / gist:5267567
Last active December 15, 2015 13:29
I get this running a scraper (using node.io) on the 2nd site I attempt to scrape. Happens on node v0.10.1 and v0.10.2.
#
# Fatal error in ../deps/v8/src/api.h, line 297
# CHECK(allow_empty_handle || that != __null) failed
#
==== Stack trace ============================================
Security context: 0x4b33462d <JS Object>#0#
1: getListeners [/home/dswift/node_modules/node.io/node_modules/jsdom/lib/jsdom/level2/events.js:169] (this=0x3827c059 <JS Function>#1#,target=0x37daed39 <JS Global Object>#2#,type=0x38b9082d <String[15]: DOMNodeInserted>,capturing=0x4b3080b1 <true>)
#!/bin/sh
##
## Redhat / Linux / LSB
##
# chkconfig: 345 85 15
# description: Startup script for Express / Node.js application with the \
## forever module.
##
## A modification of https://gist.github.com/1339289
##
@pccowboy
pccowboy / stunnel-4.54-xforwarded-for.diff
Created October 19, 2012 21:37
stunnel 4.54 X-Forwarded-For patch, manually modified from the 4.53 gist to compile cleanly on 4.54
diff --git a/doc/stunnel.8 b/doc/stunnel.8
index 589d968..f56f5c0 100644
--- a/doc/stunnel.8
+++ b/doc/stunnel.8
@@ -693,6 +693,10 @@ This options has been renamed to \fInone\fR.
.RE
.RS 4
.RE
+.IP "\fBxforwardedfor\fR = yes | no" 4
+.IX Item "xforwardedfor = yes | no"
@pccowboy
pccowboy / gist:3709651
Created September 12, 2012 20:29
Weird behavior of facter in a custom fact
[root@ops-jenkins01-use1 facter]# facter --puppet operatingsystemrelease
6.3
[root@ops-jenkins01-use1 facter]# facter --puppet operatingsystem
CentOS
[root@ops-jenkins01-use1 facter]# facter --puppet operatingsystemmajor
2.6.32-279.5.2.el6.x86_64
[root@ops-jenkins01-use1 facter]# cat operatingsystemmajor.rb
#
# Custom fact to:
# return the major release number of the client OS
@pccowboy
pccowboy / gist:3373063
Created August 16, 2012 19:52
puppet agent conf for foreman
[agent]
pluginsync = true
report = true
ignoreschedules = true
daemon = false
ca_server = <%= @host.puppet_ca_server %>
certname = <%= @host.certname %>
environment = <%= @host.environment %>
server = <%= @host.puppetmaster %>