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
monolith:~ blake$ vagrant plugin install vagrant-smartos-zones | |
monolith:~ blake$ mkdir smartos && cd smartos | |
monolith:smartos blake$ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Importing base box 'livinginthepast/smartos'... | |
==> default: Matching MAC address for NAT networking... | |
==> default: Checking if box 'livinginthepast/smartos' is up to date... | |
==> default: Setting the name of the VM: smartos_default_1412188127370_65947 |
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
# this assumes that you have the latest node.js | |
sudo npm install -g json | |
curl -s \ | |
-H 'X-Circonus-App-Name: nad' \ | |
-H 'X-Circonus-Auth-Token: <your_auth_token>' \ | |
-H 'Accept: application/json' 'https://api.circonus.com/broker' \ | |
| json \ | |
| grep "cid\|name" |
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 | |
set -e | |
chef_version="11.12.8" | |
if [ $(uname -a | grep -c Ubuntu) -eq 1 ]; then | |
packager="apt-get" | |
packages="build-essential git ruby1.9.1 ruby-bundler ruby1.9.1-dev" | |
else |
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
> svcprop /application/management/redis | grep "^start" | |
start/exec astring /usr/local/bin/redis-server\ /etc/redis/redis.conf\ \& | |
start/timeout_seconds count 60 | |
start/type astring method | |
> svcprop /application/management/redis | grep "^stop" | |
stop/exec astring /usr/bin/bash\ -c\ \'LISTEN=\`netstat\ -an\ \|\ grep\ \"127.0.0.1.6379\"\ \|\ grep\ LISTEN\`\;\ if\ [\ !\ -z\ \"$LISTEN\"\ ]\;\ then\ /usr/local/bin/redis-cli\ -h\ 127.0.0.1\ -p\ 6379\ shutdown\;\ fi\' | |
stop/timeout_seconds count 300 | |
stop/type astring method |
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
> prstat -s rss -mL | |
PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWPID | |
78760 root 0.0 0.0 0.0 0.0 0.0 100 0.0 0.0 0 0 0 0 redis-server/3 | |
78760 root 0.0 0.0 0.0 0.0 0.0 100 0.0 0.0 0 0 0 0 redis-server/2 | |
78760 root 0.2 0.1 0.0 0.0 0.0 0.0 100 0.0 508 0 1K 0 redis-server/1 | |
15224 root 0.0 0.0 0.0 0.0 0.0 100 0.0 0.0 0 0 0 0 redis-server/3 | |
15224 root 0.0 0.0 0.0 0.0 0.0 100 0.0 0.0 0 0 0 0 redis-server/2 | |
15224 root 0.2 0.1 0.0 0.0 0.0 0.0 100 0.0 504 0 1K 0 redis-server/1 | |
16265 root 0.0 0.0 0.0 0.0 0.0 100 0.0 0.0 0 0 0 0 redis-server/3 | |
16265 root 0.0 0.0 0.0 0.0 0.0 100 0.0 0.0 0 0 0 0 redis-server/2 |
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
## Dedicated 32-core compute nodes | |
4994a399-ff31-4a85-91c0-80bc5501dfb2 Memory size: 32768 Megabytes caps:4:cpucaps_zone_4:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none - | |
12b5afe2-dc4a-4578-b70b-d0a9731f23fd Memory size: 32768 Megabytes caps:4:cpucaps_zone_4:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none - | |
669e78bf-23fb-4187-9a23-203099f81488 Memory size: 32768 Megabytes caps:5:cpucaps_zone_5:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none - | |
25f3a19b-a0b8-4968-a69b-1d425d07a945 Memory size: 32768 Megabytes caps:5:cpucaps_zone_5:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none - | |
bb6838d3-40d4-4fcf-be1a-4f9d4b531365 Memory size: 32768 Megabytes caps:6:cpucaps_zone_6:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none - | |
e7e99079-fb23-467d-9139-606c50b9b803 Memory size: 32768 Megabytes caps:6:cpucaps_zone_6:baseline 482 cpu_alloc:32 zone.cpu-shares privileged 256 - none - | |
2226eff3-ce6c-4ca |
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
## curl the raw version of this gist like this: | |
## curl -s -L https://gist.github.com/bixu/5316445/raw/[revision]/ruby-2.0.0-p0+on+smartos | bash | |
pkgin -y install build-essential libyaml readline libxml2 libxslt postgresql92-client | |
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile |
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
{ | |
"brand": "joyent", | |
"image_uuid": "cf7e2f40-9276-11e2-af9a-0bad2233fb0b", | |
"max_physical_memory": 512, | |
"quota": 20, | |
"nics": [ | |
{ | |
"nic_tag": "admin", | |
"ip": "dhcp", | |
"primary": true |
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 are 8GB smartmachine zones | |
> prctl -n zone.cpu-shares -i zone $(zonename) | |
zone: 57: 81bfaea9-a15f-4d54-b5f4-f4b80082d528 | |
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT | |
zone.cpu-shares | |
usage 8.19K | |
privileged 8.19K - none - | |
system 65.5K max none - |
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
[root@08-00-27-ca-21-aa ~]# vmadm create -f /etc/base64.1.8.1.json | |
UNCAUGHT EXCEPTION (acff1491): dumping core | |
/usr/vm/sbin/vmadm:645:28 | |
fs.readFile (fs.js:176:14) | |
Object.oncomplete (fs.js:297:15) | |
Abort (core dumped) |