Skip to content

Instantly share code, notes, and snippets.

View donnykurnia's full-sized avatar

Donny Kurnia donnykurnia

View GitHub Profile
@muresan
muresan / Vagrantfile
Last active August 3, 2020 11:14
Vagrant virtualbox multiple disks
osd_data_size = 6
osd_journal_size = 6
osd_path = '/d02/vagrant/virtualbox-ceph-disks'
hosts = {
'mon-1' => {
'ip' => '10.253.60.151', 'cpus' => 1, 'memory' => 1024, 'autostart' => true,
'data_disk_size' => osd_data_size * 1024, 'journal_disk_size' => osd_journal_size * 1024 },
}
#!/bin/sh
wget https://gist.githubusercontent.com/OpakAlex/6ffc1ba4bf10312a9635/raw/0a870c574e42f10e7acd52d88822e5f5ec6c2972/bootsync.sh -O /tmp/bootsync.sh
docker-machine scp /tmp/bootsync.sh lab:/tmp/bootsync.sh >/dev/null
docker-machine ssh lab "sudo mv /tmp/bootsync.sh /var/lib/boot2docker/bootsync.sh" >/dev/null
#!/bin/sh
sudo umount /Users
sudo /usr/local/etc/init.d/nfs-client start
sleep 1
sudo mount.nfs 192.168.99.1:/Users /Users -v -o rw,async,noatime,rsize=32768,wsize=32768,proto=udp,udp,nfsvers=3
grep '\-\-dns' /var/lib/boot2docker/profile || {
echo 'EXTRA_ARGS="$EXTRA_ARGS --dns 192.168.99.100 --dns 8.8.8.8 --dns 8.8.4.4"' | sudo tee -a /var/lib/boot2docker/profile
}
echo -e "nameserver 8.8.8.8\nnameserver 8.8.4.4" | sudo tee /etc/resolv.conf
@rkusa
rkusa / README
Created January 11, 2016 09:10
Install alpine linux on xhyve VM
# curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86_64/alpine-3.3.1-x86_64.iso
curl -LO http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86/alpine-3.3.1-x86.iso
# create hdd image (8GB)
dd if=/dev/zero of=hdd.img bs=1g count=8
# extract kernel and initramfs
brew install cdrtools
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/initramfs-grsec > initramfs-grsec
isoinfo -i alpine-3.3.1-x86.iso -J -x /boot/vmlinuz-grsec > vmlinuz-grsec
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@Stanback
Stanback / coffee2js.sh
Last active July 11, 2019 10:30
Convert all CoffeeScript files to Javascript (coffee2js)
#!/bin/sh
# Install coffeescript cli
npm -g install coffee-script
# Convert all coffeescript files to javascript
find . -name "*.coffee" -exec coffee --no-header --bare -c {} \;
# Optionally delete original coffee files
find . -name "*.coffee" -exec rm {} \;
@ljmccarthy
ljmccarthy / qemu-winxp.sh
Created November 28, 2015 18:31
QEMU command line for Windows XP
#!/bin/sh
exec qemu-system-i386 -enable-kvm -cpu host -m 1024 -vga std -soundhw ac97 -net nic,model=rtl8139 \
-net user -drive file=winxp.img,format=raw -drive file=/usr/share/virtio/virtio-win.iso,media=cdrom
@tanb
tanb / xhyve-freebsd-tutorial-1.md
Last active November 27, 2021 13:07
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

@cottonaf
cottonaf / ActiveRecord.php
Last active August 29, 2015 14:21
Soft delete, or logical delete addition for yii 1.x
<?php
class ActiveRecord extends CActiveRecord
{
/**
* Based on ActiveRecord delete() but instead of actually deleting it sets an attribute to deleted=true.
* Others have chosen to implement this as a behavior; this should be standard AR practice, but in order
* to maintain backwards compatibility with a few models which use delete() to actually delete models it must not be overridden (delete).
*
* Performs a logical delete.
@andrealbinop
andrealbinop / setup-modernie-vagrant-boxes.md
Last active May 28, 2023 01:54
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites