Skip to content

Instantly share code, notes, and snippets.

@sunnyone
sunnyone / AutoFetch.pm
Created May 30, 2011 15:00
Tiarra DCC auto getter
# -----------------------------------------------------------------------------
# $Id$
# -----------------------------------------------------------------------------
# Auto fetch DCC SEND
# -----------------------------------------------------------------------------
package CTCP::DCC::AutoFetch;
use strict;
use warnings;
use base qw(Module);
use Multicast;
@sunnyone
sunnyone / fetch_dcc.rb
Created May 30, 2011 15:02
Tiarra DCC auto getter (child)
#!/usr/bin/ruby -Ku
require 'socket'
require 'logger'
LOG_PATH = '/var/log/fetch_dcc.log'
DCC_DIR = '/mnt/dcc'
(nick, address, port, size, filename) = ARGV
port = port.to_i
@sunnyone
sunnyone / gist:1047564
Created June 26, 2011 12:10
virt-install command for Debian with serial console
virt-install --connect qemu:///system \
--name=HOSTNAME --ram=128 --vcpus=1 \
--disk path=/dev/vg0/HOSTNAME-root \
--disk path=/dev/vg0/HOSTNAME-swap \
--os-type linux --os-variant debianlenny \
--accelerate --network network:DMZ \
--nographics \
--location='http://ftp.jp.debian.org/debian/dists/squeeze/main/installer-amd64/' \
--extra-args='console=tty0 console=ttyS0,115200n8'
@sunnyone
sunnyone / gist:1115239
Created July 30, 2011 05:40
acpidump result
DSDT @ 0x7b97c2f4
0000: 44 53 44 54 10 d9 00 00 01 b4 4c 45 4e 4f 56 4f DSDT......LENOVO
0010: 54 50 2d 36 44 20 20 20 50 10 00 00 4d 53 46 54 TP-6D P...MSFT
0020: 00 00 00 03 10 3a 5c 5f 50 52 5f 5b 83 0b 43 50 .....:\_PR_[..CP
0030: 55 30 00 10 10 00 00 06 5b 83 0b 43 50 55 31 01 U0......[..CPU1.
0040: 10 10 00 00 06 5b 83 0b 43 50 55 32 02 10 10 00 .....[..CPU2....
0050: 00 06 5b 83 0b 43 50 55 33 03 10 10 00 00 06 5b ..[..CPU3......[
0060: 80 4d 4e 56 53 00 0c 00 e0 98 7b 0b 00 10 5b 81 .MNVS.....{...[.
0070: 4d 37 4d 4e 56 53 03 00 80 00 07 47 41 50 41 20 M7MNVS.....GAPA
0080: 47 41 50 4c 20 44 43 4b 49 20 44 43 4b 53 20 56 GAPL DCKI DCKS V
@sunnyone
sunnyone / gist:1115260
Created July 30, 2011 06:14
acpidump disassembled by iasl
/*
* Intel ACPI Component Architecture
* AML Disassembler version 20100528
*
* Disassembly of DSDT.dat, Sat Jul 30 15:10:56 2011
*
*
* Original Table Header:
* Signature "DSDT"
* Length 0x0000D910 (55568)
@sunnyone
sunnyone / gist:1151964
Created August 17, 2011 16:37
Amazon links to ASIN/Title table
var ar = document.getElementsByTagName("a"); var text = "";
for (var i = 0; i < ar.length; i++) {
if (ar[i].href != null && ar[i].href.match(/gp\/product\/[0-9]{10}\//)) {
var asin = ar[i].href.replace(/.*product\//, '').replace(/\/ref=.*/, '');
var title = ar[i].text; text = text + "<tr><td>" + asin + "</td><td>" + title + "</td></tr>";
}
}
var table = document.createElement('table');
table.innerHTML = text;
document.body.appendChild(table);
@sunnyone
sunnyone / gist:1175660
Created August 27, 2011 17:54
OpenIndiana Update-1
$ cat /etc/release
OpenIndiana Development oi_148 X86
Copyright 2010 Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
Assembled 29 November 2010
$ zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 2.79G 3.09G 46K /rpool
rpool/ROOT 2.01G 3.09G 31K legacy
@sunnyone
sunnyone / gist:1175673
Created August 27, 2011 18:07
OpenIndiana Update-2
$ sudo pkg set-publisher -O http://pkg.openindiana.org/dev-il/ openindiana.org
$ sudo pkg publisher
PUBLISHER TYPE STATUS URI
openindiana.org (preferred) origin online http://pkg.openindiana.org/dev-il/
opensolaris.org origin online http://pkg.openindiana.org/legacy/
$ sudo pkg image-update
WARNING: pkg(5) appears to be out of date, and should be updated before
running image-update. Please update pkg(5) using 'pfexec pkg install
pkg:/package/pkg' and then retry the image-update.
$ sudo pkg install pkg:/package/pkg
@sunnyone
sunnyone / gist:1175721
Created August 27, 2011 18:40
OpenIndiana Update-3
$ sudo pkg image-update
Packages to remove: 71
Packages to install: 111
Packages to update: 416
Create boot environment: Yes
DOWNLOAD PKGS FILES XFER (MB)
Completed 598/598 18219/18219 287.1/287.1
PHASE ACTIONS
Removal Phase 13234/13234
@sunnyone
sunnyone / gist:1175724
Created August 27, 2011 18:42
OpenIndiana Update-4
$ cat /etc/release
OpenIndiana Development oi_151 X86 (powered by illumos)
Copyright 2011 Oracle and/or its affiliates. All rights reserved.
Use is subject to license terms.
Assembled 28 April 2011
$ sudo zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 4.41G 1.47G 46K /rpool
rpool/ROOT 3.62G 1.47G 31K legacy
rpool/ROOT/solaris 9.69M 1.47G 2.45G /