Skip to content

Instantly share code, notes, and snippets.

@logic855
logic855 / gist:59b99392881c11c9dcc1594b1df52164
Created August 6, 2020 14:09 — forked from danmack/gist:6d69a6d2ab08e6dbf8a1727e9c2267a0
SmartOS add disk to bhyve linux container
Adding a new disk to a bhyve vm takes a few steps.
1. increase the quota on the zfs dataset to accomodate the additional
space.
2. create a zvol inside the zone
3. stop the vm and update its configuration to reflect the change
4. start the vm, login and use the disk
# update quota

My Openshift Cheatsheet

Openshift build secrets for cloning git repos using SSH Keys

  • To create ssh secret:
oc create secret generic sshsecret \
    --from-file=ssh-privatekey=$HOME/.ssh/id_rsa
@logic855
logic855 / firefly iii install on 18.04.md
Created February 3, 2020 14:10 — forked from philthynz/firefly iii install on 18.04.md
Firefly III install on Ubuntu18.04

Firefly III install on Ubuntu 18.04

These instructions will install Firefly III on Ubuntu 18.04. It includes setup for:

  • PHP 7.2
  • Nginx
  • MariaDB
  • Securing an Ubuntu server
  • Securing Maria DB
  • Let's Encrypt
@logic855
logic855 / tar.gz with gpg-encryption on the fly
Created June 28, 2018 14:30 — forked from revnode/tar.gz with gpg-encryption on the fly
Create a encrypted tar.gz file from a directory on the fly. The encryption is done by GPG with a public key. The resulting filename is tagged with the date of creation. Very usefull for encrypted snapshots of folders.
tar -cvz /<path>/ | gpg --encrypt --recipient <keyID> > /<backup-path>/backup_`date +%d_%m_%Y`.tar.gz.gpg
@logic855
logic855 / fetch-tmpl-content
Created February 10, 2017 14:55 — forked from seeder/fetch-tmpl-content
Used for fetching templates from consul for use in consul-template as plugin
#!/bin/sh
TMPL=$1
DESTINATION=/config/consultemplate/template/$TMPL
TMPDESTINATION=/tmp/$DESTINATION
LOGS=/logs/$HOSTNAME
mkdir -p $LOGS
mkdir -p "`dirname $DESTINATION`"
@logic855
logic855 / dz-bashrc
Created January 16, 2017 10:14 — forked from drscream/dz-bashrc
alias dz-search='dz list -c | grep -i'
alias zlogin='dz shell '
function alogin() {
UUID=$(cat ~/.dz/vms.json | jq -r '.[][] | select(.alias=="'${1}'") | .uuid')
dz shell ${UUID}
}
@logic855
logic855 / osx_haproxy.md
Created October 7, 2016 13:39 — forked from drpauldixon/osx_haproxy.md
Compile HAProxy with Lua and OpenSSL on Mac OS X

Compile HAProxy with Lua and OpenSSL on Mac OS X

Tags: osx haproxy lua openssl

Compile LUA:

mkdir ~/oss
wget http://www.lua.org/ftp/lua-5.3.3.tar.gz
tar xvzf lua-5.3.3.tar.gz
@logic855
logic855 / smartos-graphite.sh
Created August 29, 2016 14:44 — forked from anl/smartos-graphite.sh
Bootstrap Graphite on SmartOS
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
@logic855
logic855 / gist:5e04249dc7ed4392b402
Created February 22, 2016 10:41 — forked from mattconnolly/gist:6097313
Adding a zfs dataset to a SmartOS zone. Seems there's no vmadm api for this, but you can do it with zonecfg:
# vmadm halt <uuid>
# zonecfg -z <uuid>
zonecfg:uuid> add dataset
zonecfg:uuid:dataset> set name=<zfs/path>
zonecfg:uuid:dataset> end
zonecfg:uuid> commit
zonecfg:uuid> exit
# zfs set mountpoint=legacy <zfs/path>
# vmadm boot <uuid>
@logic855
logic855 / udp-thing.js
Created January 20, 2016 16:56 — forked from rjungemann/udp-thing.js
UDP client and server in Node.js
log = require('sys').log
dgram = require('./lib/dgram')
var Buffer = require('buffer').Buffer;
var endat = 10;
var count = 0;
socket = dgram.createSocket();
socket.addListener('message', function (msg, rinfo) {
log('got message from '+ rinfo.address +' port: '+ rinfo.port);
log('data len: '+ rinfo.size + " data: "+ msg.toString('ascii', 0, rinfo.size));