Skip to content

Instantly share code, notes, and snippets.

View albertohm's full-sized avatar

Alberto Hernández Mateos albertohm

View GitHub Profile
@albertohm
albertohm / notes.sh
Created September 11, 2012 23:26
lxc debian on arch
lxc-create -n debian -B lvm --lvname debian --vgname vg0 --fssize 4GB
sudo debootstrap wheezy /media/containers/debian http://ftp.us.debian.org/debian
--no-check-gpg
@albertohm
albertohm / knife-solo
Created September 12, 2012 23:07
knife-solo
gem install knife-solo
knife prepare user@host
knife cook user@host
@albertohm
albertohm / tabularize
Created September 24, 2012 14:58
New ruby syntax tabularize
:'<,'>Tabularize /:/r0r1l1
@albertohm
albertohm / crap.sh
Created October 23, 2012 18:55
Add torrent magnets to transmission-qt on debian
Modify or create /usr/share/kde4/services/magnet.protocol like this:
exec=transmission "%U"
protocol=magnet
input=none
output=none
helper=true
listing=false
reading=false
writing=false
site :opscode
cookbook 'mongodb'
cookbook 'apt'
cookbook 'sudo'
cookbook 'conf'
cookbook 'tmux'
cookbook 'git'
cookbook 'haproxy'
cookbook 'java'

Create the container using LVM

You can use lxc-create to create and initialize a new lvm partition

lxc-create -n <name> -t ubuntu -B lvm --lvname <name> --vgname <vgname> --fssize 5GB

Mount the container

Create a directory mkdir /media/volumes/ and edit the /etc/fstab by adding:

@albertohm
albertohm / gist:7290725
Created November 3, 2013 14:18
knockout.js debugging
%pre{"data-bind" => "text: JSON.stringify(ko.toJS($data), null, 2)"}
<!DOCTYPE html>
<html>
<head>
<link type='text/css' rel='stylesheet' href='style.css'/>
<title>Hello, World!</title>
</head>
<body>
<?php
@albertohm
albertohm / asound.conf
Created December 2, 2013 12:07
Max sound on pulseaudio. Copy on /etc/asound.conf
pcm.!default {
type plug
slave.pcm "softvol"
}
pcm.softvol {
type softvol
slave {
pcm "dmix"
}
@albertohm
albertohm / knockout.haml
Created December 16, 2013 11:20
knockout debugging
%pre{"data-bind" => "text: ko.toJSON($data, null, 2)"}