Skip to content

Instantly share code, notes, and snippets.

eb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free
deb http://deb.debian.org/debian stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free
deb http://security.debian.org/ stretch/updates main contrib non-free
deb-src http://security.debian.org/ stretch/updates main contrib non-free
var Abstract = function () {
};
Abstract.prototype.fnc1 = function () {
throw new Error('Implement in subclass!');
};
var SubClass = function () {
Abstract.call(this);
};
@fastman
fastman / gist:3427826
Created August 22, 2012 17:40
SampleClass
var SampleClass = function () {
this._variable = 'test_variable';
};
(function () {
this.sampleMethod = function () {
console.log('Hello world');
};
@fastman
fastman / gist:3424886
Created August 22, 2012 12:02
node inotify
developer@clouddev:~/dev/tests$ cat watch.js
var fs = require('fs');
var data = 'sample data';
var file = '/tmp/watch_test_file';
fs.writeFileSync(file, data);
fs.watchFile(file, function (curr, prev) {
console.log('File changed');
s1:~# vgreduce vg /dev/hdc5
Removed "/dev/hdc5" from volume group "vg"
s1:~# pvmove /dev/hdc5 /dev/sda6
/dev/hdc5: Moved: 0,6%
/dev/hdc5: Moved: 1,2%
/dev/hdc5: Moved: 1,9%
...
/dev/hdc5: Moved: 99,6%
/dev/hdc5: Moved: 100,0%
s1:~# vgextend vg /dev/sda6
Volume group "vg" successfully extended
s1:~# pvdisplay
--- Physical volume ---
PV Name /dev/hdc5
VG Name vg
PV Size 30,75 GB / not usable 2,62 MB
Allocatable yes
PE Size (KByte) 4096
Total PE 7872
Free PE 96
Allocated PE 7776
CC=gcc
CFLAGS=-Wall -g -ansi -pedantic
OUT=sample
sample:
$(CC) $(CFLAGS) -c sample.c
$(CC) $(CFLAGS) -o $(OUT) sample.o
sample.o:
$(CC) $(CFLAGS) -c sample.c -fPIC -o sample.o