Skip to content

Instantly share code, notes, and snippets.

View bdha's full-sized avatar
☂️
ಠ_ಠ

Bryan Horstmann-Allen bdha

☂️
ಠ_ಠ
View GitHub Profile
Installing image 845480a6-ef02-11e4-a313-135b7a82221b (manta-moray@release-20150430-20150430T062614Z-g088ac51)
Provisioning Temporary moray VM moray0tmp
Wait (sleep) for moray instance ffa1e3c0-f762-4e0b-be60-8ba3bb7e417e to come up
Running vmadm lookup to get tmp instance UUID
Checking if tmp instace ffa1e3c0-f762-4e0b-be60-8ba3bb7e417e services have errors
Waiting until ffa1e3c0-f762-4e0b-be60-8ba3bb7e417e instance is in DNS
Update error: {"message":"error Getting VM info ffa1e3c0-f762-4e0b-be60-8ba3bb7e417e:\n\targv: [\"/opt/smartdc/bin/sdc-oneachnode\",\"-n 564d6390-f5b1-d9b7-68ec-50905e7eb627 \",\"-j\",\"/usr/sbin/vmadm get ffa1e3c0-f762-4e0b-be60-8ba3bb7e417e\"]\n\texit status: 10\n\tstdout:\n[]\n\tstderr:\nERROR: could not find all nodes\n\n missing nodes:\n 564d6390-f5b1-d9b7-68ec-50905e7eb627","we_cause":{"killed":false,"code":10,"signal":null},"code":"InternalError","exitStatus":1}
sdcadm update: error: error Getting VM info ffa1e3c0-f762-4e0b-be60-8ba3bb7e417e:
argv: ["/opt/smartdc/bin/sdc-one
#!/bin/bash
set -e
#set -x
TOKEN=$( cat /root/.github-token )
BASEURL="https://api.github.com/orgs/${1}/repos?type=owner&access_token=${TOKEN}&per_page=100"
BACKUPS_ZFS="zones/$( zonename )/data/backup/github"
@bdha
bdha / smartos_hackery.md
Last active April 7, 2018 10:10
Modify a SmartOS vmware platform image

Using OS X and vmware Fusion. Requires an actual Solarish system or VM to modify the boot_archive.

Why would you want to do this? Well, it's an easy way of modifying an excellent platform for your own nefarious ends. Maybe you want to inject some extra (or less) work into the install scripts. Or just add some extra default services. Or drop in some leet figlet into /etc/issue. Or more usefully: Drop your application bootstrapping code into the platform to create turnkey appliances.

Prep

Download and decompress the SmartOS VMware image.

Copy the boot image out of the VM directory and mount it.

@bdha
bdha / gist:c456cf6e5484ea5ad256
Last active August 29, 2015 14:15
Building Haskell on SmartOS
........................................
......... ..........
....... ........
..... ......
.... .....
... ....... ....
.. ....... .. ...
. .......... .. ..
. ....... .... .. .
. ..... ..... .
@bdha
bdha / gist:8628477
Last active October 13, 2016 18:06
Set up Graphite and Panoptimon on SmartOS

Install Graphite

pkgin up
pkgin in py27-graphite-web ap22-py27-wsgi

If pkgin says the package cannot be found, do this:

10:58 < helen> you know how bryan gets if you disturb his pancakes.
10:58 < rjbs> Actually, I have no idea.
10:59 < rjbs> I can't recall ever seeing Bryan in the same room as a pancake.
zfs set atime=off zones
zfs set compression=on zones
zfs create -V 131055mb zones/dump
zfs create zones/config
zfs set mountpoint=legacy zones/config
mount -F zfs zones/config /mnt
cp -p /etc/zones/* /mnt
umount /mnt
"Good hardware costs money, and your time has value. The ditches on either
side of the road through the land of hardware are steep and home to
manifold ferocious beasts. Stray from this golden path at your peril."
-- Keith Wesolowski
http://www.listbox.com/member/archive/184463/2013/02/sort/time_rev/page/1/entry/0:156/20130218134633:82C0ABBC-79FB-11E2-B214-A90A0365DAE4/
#!/bin/bash -e
REMOTE_POOL=tank2
LOCAL_POOL=tank
TARGET_HOST=foo
LAST_SYNCED=$( ssh $TARGET_HOST zfs list -t snapshot -o name -r $REMOTE_POOL/zones/icg_db/mysql | tail -1 )
echo "r: $LAST_SYNCED"
LAST_SNAPSHOT=$( zfs list -t snapshot -o name -r tank/zones/icg_db/mysql | tail -1 )