Skip to content

Instantly share code, notes, and snippets.

View mifix's full-sized avatar
🌴
On vacation

Christian Mayer mifix

🌴
On vacation
View GitHub Profile
@mifix
mifix / install.sh
Created December 20, 2017 21:51
Multipass on Arch Linux
# https://github.com/CanonicalLtd/multipass
Install snapd-git ncurses5-compat-libs
sudo ln -s libpcre.so libpcre.so.3
@mifix
mifix / Keybase.txt
Created August 23, 2016 16:18
Keybase
```
hKRib2R5hqhkZXRhY2hlZMOpaGFzaF90eXBlCqNrZXnEIwEgEGqfuAcEVeLrWj082xTBDEfVOJ35USFoUncRjqr6qSoKp3BheWxvYWTFAvB7ImJvZHkiOnsia2V5Ijp7ImVsZGVzdF9raWQiOiIwMTIwMTA2YTlmYjgwNzA0NTVlMmViNWEzZDNjZGIxNGMxMGM0N2Q1Mzg5ZGY5NTEyMTY4NTI3NzExOGVhYWZhYTkyYTBhIiwiaG9zdCI6ImtleWJhc2UuaW8iLCJraWQiOiIwMTIwMTA2YTlmYjgwNzA0NTVlMmViNWEzZDNjZGIxNGMxMGM0N2Q1Mzg5ZGY5NTEyMTY4NTI3NzExOGVhYWZhYTkyYTBhIiwidWlkIjoiZjhhYTNkOGFjNGQ0Y2U3YjhlYmI1NGJkOGE4NDM1MTkiLCJ1c2VybmFtZSI6ImNocmlzdGlhbl9tYXllciJ9LCJzZXJ2aWNlIjp7Im5hbWUiOiJnaXRodWIiLCJ1c2VybmFtZSI6Im1pZml4In0sInR5cGUiOiJ3ZWJfc2VydmljZV9iaW5kaW5nIiwidmVyc2lvbiI6MX0sImNsaWVudCI6eyJuYW1lIjoia2V5YmFzZS5pbyBnbyBjbGllbnQiLCJ2ZXJzaW9uIjoiMS4wLjE2In0sImN0aW1lIjoxNDcxOTY5MDU3LCJleHBpcmVfaW4iOjUwNDU3NjAwMCwibWVya2xlX3Jvb3QiOnsiY3RpbWUiOjE0NzE5NjkwNDIsImhhc2giOiJkYzYwMjkxMjhmMjNjOGE2NDRlNzFiMGNiMTA2Y2E2ZTg0YWVkNTdiMDQ4OWJiM2FmMTQ1MjRhZjNiNzZiOTI4ODQzZjNjMjVlYjhjZjg5ZTFhZTJjYmNjYmIwNGJhMjJiY2NhNmZkNWIyZGY1Zjg2OTdmYWNiMjg0Nzc1NDU0MSIsInNlcW5vIjo1OTY5NTN9LCJwcmV2IjoiZjYyMTgyYWE4YTY1ODg4YzEwOGM4NjM3ODdl
@mifix
mifix / resize.sh
Created May 30, 2016 09:33
LXD - ZFS - resize
# make sure zfs autoexpand is enabled (only needed once)
sudo zpool set autoexpand=on lxd
sudo truncate -s 50G /var/lib/lxd/zfs.img
# Make zfs realize the fact that partition has been changed and make zpool
# use the new partition which is actually the same one
sudo zpool online -e lxd /var/lib/lxd/zfs.img /var/lib/lxd/zfs.img
@mifix
mifix / xhyve-freebsd-tutorial-1.md
Created April 11, 2016 00:25 — forked from tanb/xhyve-freebsd-tutorial-1.md
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites

@mifix
mifix / README.md
Last active March 26, 2016 12:23
Automatically add packages to ansible

My system is fully managed via ansible. After apt-get install new packages, I have to remember to add them to a certain ansible file.

Add the following script (ai.sh) to your shell rc file and install new packages with:

$ ai -y htop git

See the python script below for reference or standalone usage.

@mifix
mifix / Setup and forget Apache Host and PHP configuration
Last active February 22, 2016 03:23
Setup and forget Apache Host and PHP configuration. (VirtualDocumentRoot and php-fpm)
Prerequisites
=============
$ apt-get install apache2-mpm-worker libapache2-mod-fastcgi php5-fpm php5 php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
$ a2enmod actions fastcgi alias rewrite vhost_alias
$ sudo service apache2 reload
@mifix
mifix / eigenfun.rb
Last active December 17, 2015 06:08
# see http://blog.codegram.com/2011/4/understanding-class-instance-variables-in-ruby
# and http://vimeo.com/33481092 (Ruby's Object Model & Eigenclasses)
module MyMixin
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
tell application "iTunes"
set sel to selection
play item 1 of sel
set player position to 26
end tell
/**
* makePlain2ColTable
*
* Tabelle ohne Rahmen mit 2 Spalten
*
* @param array arr_data Assoziativer Array mit Daten f�r TabSpalten
* @param array col_param Breite, H�he & Ausrichting von Spalte 1 und 2
* @param array tab_pos Postition der Tabelle
* @returns yPostition
**/