Skip to content

Instantly share code, notes, and snippets.

View amontalban's full-sized avatar

Andres Montalban amontalban

View GitHub Profile
dd if=/dev/zero of=/mnt/swapfile bs=1024 count=8388608
mkswap /mnt/swapfile
chown root:root /mnt/swapfile
chmod 0600 /mnt/swapfile
swapon /mnt/swapfile
echo "/mnt/swapfile swap swap defaults,nobootwait,comment=cloudconfig 0 0" >> /etc/fstab
comm -12 <(sort file1.txt) <(sort file2.txt)
@amontalban
amontalban / gist:a3c50ec095fe875c0865
Created February 25, 2015 19:00
Resize root partition FreeBSD under VirtualBox with ZFS as root
VBoxManage clonehd in.vmdk out.vdi (Convert current VMDK to VDI)
VBoxManage modifyhd box.vdi --resize 15360 (Resize disk to needed size in Kb)
--- Change VMDK disk to the VDI disk using VirtualBox interface ---
gpart recover ada0 (Where ada0 is the harddrive you want to expand)
gpart resize -i 2 ada0 (Where 2 is the partition number you want to expand, you can see this with "gpart show")
zpool set autoexpand=on zroot (Where zroot is the pool you want to expand)
zpool online -e zroot gpt/disk0 gpt/disk0
time="2015-04-18T21:59:23Z" level="info" msg="+job containers()"
time="2015-04-18T21:59:23Z" level="info" msg="-job containers() = OK (0)"
time="2015-04-18T21:59:27Z" level="info" msg="Received signal 'terminated', starting shutdown of docker..."
time="2015-04-18T21:59:27Z" level="error" msg="Error logging event die for 98d8e26d9cdbad231b854588d243f90184b65062
4d703d262dcffa00f7ead30a: engine is shutdown"
time="2015-04-18T21:59:27Z" level="info" msg="+job release_interface(98d8e26d9cdbad231b854588d243f90184b650624d703d
262dcffa00f7ead30a)"
time="2015-04-18T21:59:27Z" level="info" msg="-job release_interface(98d8e26d9cdbad231b854588d243f90184b650624d703d
262dcffa00f7ead30a) = OK (0)"
time="2015-04-18T21:59:27Z" level="error" msg="Error logging event die for 29269608e2eca909bb251d54a6747cd76247ace2
{% if grains['os'] == 'FreeBSD' %}
{% set p5_crypt_des_pkg = 'p5-crypt-des' %}
{% elif grains['os'] == 'Ubuntu' %}
{% set p5_crypt_des_pkg = 'libcrypt-des-perl' %}
{% endif %}
p5-Crypt-DES:
pkg.installed:
- name: {{ p5_crypt_des_pkg }}
php-dev:
pkg.installed:
- name: php5-dev
php-cli:
pkg.installed:
- name: php5-cli
build-essential:
pkg.installed: []
dscl . -create /Users/username
dscl . -create /Users/username UserShell /bin/bash
dscl . -create /Users/username RealName "User Name"
dscl . -create /Users/username UniqueID "1010"
dscl . -create /Users/username PrimaryGroupID 1000
dscl . -create /Users/git NFSHomeDirectory /Users/username
createhomedir -c -u username
@amontalban
amontalban / gist:75e176ea30da38b46703
Created February 23, 2016 20:46
Swap file in FreeBSD
dd if=/dev/zero of=/swapfile bs=1m count=2048
chmod 0600 /swapfile
printf "md99\tnone\tswap\tsw,file=/swapfile\t0\t0" >> /etc/fstab
swapon -aL
This file has been truncated, but you can view the full file.
2016/03/04 16:53:47 [INFO] Packer version: 0.9.0 a643faae672ec8b8424352476d2b91b7a7f7b06e
2016/03/04 16:53:47 Packer Target OS/Arch: darwin amd64
2016/03/04 16:53:47 Built with Go Version: go1.6
2016/03/04 16:53:47 Detected home directory from env var: /Users/andres
2016/03/04 16:53:47 Using internal plugin for amazon-chroot
2016/03/04 16:53:47 Using internal plugin for amazon-ebs
2016/03/04 16:53:47 Using internal plugin for null
2016/03/04 16:53:47 Using internal plugin for qemu
2016/03/04 16:53:47 Using internal plugin for file
2016/03/04 16:53:47 Using internal plugin for googlecompute
@amontalban
amontalban / pkgpng.py
Last active April 5, 2016 18:40
Patch for Saltstack #28262
--- a/salt/modules/pkgng.py
+++ b/salt/modules/pkgng.py
@@ -277,15 +277,19 @@ def latest_version(*names, **kwargs):
quiet = False
for name in names:
- cmd = [_pkg(jail, chroot), 'search']
+ cmd = [_pkg(jail, chroot), 'search', '-S', 'name', '-Q', 'version', '-e']
if quiet:
cmd.append('-q')