Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am xen0l on github.
* I am xenol (https://keybase.io/xenol) on keybase.
* I have a public key whose fingerprint is 00EF 547B 63CC 8FB0 02F4 C654 6843 7E0C F3E7 FCC1
To claim this, I am signing this object:
@xen0l
xen0l / gist:732fb7a6bb50ffbf0ba9
Created September 30, 2014 15:56
How to make QEMU guest-agent work on SmartOS
[root@smartos ~]# UUID="afe2f552-4a35-4c44-8855-a9bac10f27d2"
[root@smartos ~]# vmadm update ${UUID} qemu_extra_opts="-chardev socket,path=/tmp/vm.qga,server,nowait,id=qga0 -device virtio-serial -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0"
Successfully updated VM afe2f552-4a35-4c44-8855-a9bac10f27d2
[root@smartos ~]# vmadm boot ${UUID}
Successfully started VM afe2f552-4a35-4c44-8855-a9bac10f27d2
[root@smartos ~]# sleep 60 # Machine needs to boot up
[root@smartos ~]# echo '{"execute": "guest-ping" }' | socat stdio unix-connect:/zones/${UUID}/root/tmp/vm.qga # Is GA alive?
{"return": {}}
[root@smartos ~]# echo '{"execute": "guest-info" }' | socat stdio unix-connect:/zones/${UUID}/root/tmp/vm.qga # show information about GA
{"return": {"version": "0.12.1", "supported_commands": [{"enabled": true, "name": "guest-set-vcpus"}, {"enabled": true, "name": "guest-get-vcpus"}, {"enabled": true, "name": "guest-network-get-interfaces"}, {"enabled": true, "name": "guest-suspend-hybrid"}, {"enabled": tru
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@xen0l
xen0l / hosts.cfg
Created September 27, 2016 12:09
How to use zone connection with Ansible and OpenIndiana
# If you want to run this as a non-root user, assign "Zone Management" RBAC profile to non-root account.
root@openindiana:/root/ansible# ansible www -m ping
www | SUCCESS => {
"changed": false,
"ping": "pong"
}
# dark colors
$colors[0][0] = "5299AD"; # blue1
$colors[0][1] = "5D549A"; # violet
$colors[0][2] = "87B457"; # green
$colors[0][3] = "CF545E"; # red
$colors[0][4] = "CDDA13"; # lemon
$colors[0][5] = "5DAE99"; # turquise
$colors[0][6] = "DD844C"; # orange
$colors[0][7] = "AE5C8A"; # mauve
$colors[0][8] = "BD9F83"; # ltbrown
@xen0l
xen0l / ipf.conf
Created October 14, 2016 09:17
Sample ipf.conf
# This file is managed by Ansible. Any manual changes will be overwritten!
#
# ipf.conf
#
# IP Filter rules to be loaded during startup
#
# See ipf(4) manpage for more information on
# IP Filter rules syntax.
# Do not filter loopback
@xen0l
xen0l / gist:2792654274bc57470cb1b4217eaf76d9
Last active October 19, 2016 19:16
epoll on illumos vs linux (python example)
Linux:
Python 3.5.1 (default, Mar 3 2016, 09:29:07)
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import select
>>> os.uname()
posix.uname_result(sysname='Linux', nodename='archlinux.vagrant.vm', release='4.5.0-1-ARCH', version='#1 SMP PREEMPT Tue Mar 15 09:41:03 CET 2016', machine='x86_64')
>>> select.epoll(select.EPOLL_CLOEXEC).close()
https://gist.github.com/f60a78d4f85675b95f6efb4ab8994d0a
#!/usr/bin/env bash
# Colors
NOCOLOR='\e[0m'
BLACK='\e[0;30m'
RED='\e[0;31m'
GREEN='\e[0;32m'
YELLOW='\e[0;33m'
BLUE='\e[0;34m'
PURPLE='\e[0;35m'