Skip to content

Instantly share code, notes, and snippets.

@lancechentw
lancechentw / .procmailrc
Created June 30, 2012 18:10
procmailrc examples
VERBOSE=on
LOGFILE=$HOME/.procmail.log/procmail.`date +%Y%m%d`.log
LOGABSTRACT=yes
:0:
* ^To: yourname.donotforward@yourdomain.tld
$DEFAULT
:0
* ^From: root@yourdomain.tld
@lancechentw
lancechentw / httpd-vhosts.conf
Created August 3, 2012 18:39
apache config for git smart http with ldap auth
<VirtualHost *:80>
ServerName your.domain.name
DocumentRoot /srv/http
setEnv GIT_PROJECT_ROOT /opt/git
setEnv GIT_HTTP_EXPORT_ALL
scriptAlias /git/ /usr/lib/git-core/git-http-backend/
<Directory />
Order allow,deny
@lancechentw
lancechentw / fstab
Created August 22, 2012 19:34
freebsd basic settings
/dev/mirror/gm0 / ufs rw 1 1
/dev/gpt/swap0 none swap sw 0 0
/dev/gpt/swap1 none swap sw 0 0
@lancechentw
lancechentw / .muttrc
Created September 20, 2012 05:39
Muttrc example
ignore *
unignore from: subject to cc date x-mailer x-url user-agent x-label
hdr_order date from to cc subject
set locale='zh_TW.utf8'
set charset='utf8'
set assumed_charset = 'cp950:gb2312:UTF-8'
set send_charset='utf8'
# Change <Your Name>
@lancechentw
lancechentw / wav.xml
Created May 8, 2013 03:10
Peach pit file for fuzzing media players(ex. mplayer) which read wav file. Check out http://peachfuzzer.com/TutorialFileFuzzing.html
<?xml version="1.0" encoding="utf-8"?>
<Peach xmlns="http://phed.org/2008/Peach" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://phed.org/2008/Peach /peach/peach.xsd">
<!-- Import defaults for Peach instance -->
<Include ns="default" src="file:defaults.xml"/>
<DataModel name="Chunk">
<String name="ID" length="4" padCharacter=" " />
<Number name="Size" size="32" signed="false">
@lancechentw
lancechentw / PKGBUILD
Created June 20, 2013 17:56
Archlinux package rpc-rstatd
# Maintainer: LinuxTA <linuxta@cs.nctu.edu.tw>
# Contributor: Chris Cooper <coopstah13@comcast.net>
# Special thanks to Mark Rosenstand <mark@borkware.net>
# He is the original creator of this, but stopped maintaining.
pkgname=rpc.rstatd
pkgver=4.0.1
pkgrel=2
pkgdesc="Linux Performance Statistics Client and Server"
arch=('i686' 'x86_64')
$ sudo make distclean
===> Cleaning for py27-asn1-modules-0.0.5
===> Deleting distfiles for py27-asn1-modules-0.0.5
$ sudo make install clean
===> License BSD accepted by the user
===> py27-asn1-modules-0.0.5 depends on file: /usr/local/sbin/pkg - found
=> pyasn1-modules-0.0.5.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch http://ftp.tw.freebsd.org/distfiles/pyasn1-modules-0.0.5.tar.gz
===> Fetching all distfiles required by py27-asn1-modules-0.0.5 for building
@lancechentw
lancechentw / gist:5982566
Created July 12, 2013 07:25
ethernet-static
CONNECTION='ethernet'
DESCRIPTION='A basic static ethernet connection using iproute'
INTERFACE='eth0'
IP='static'
ADDR='198.211.111.197'
#ROUTES=('192.168.0.0/24 via 192.168.1.2')
GATEWAY='198.211.111.193'
DNS=('4.2.2.1')
## For IPv6 autoconfiguration
@lancechentw
lancechentw / lance.asc
Last active April 6, 2016 03:09
My PGP Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
mQENBFE+4NkBCADpGzVHUnVWD7z0VDeKsXC0A8cN4i5E5ejl1+XTVuOsR+MrbJc/
d+YkkETWXwsZLLo2t0C7rurB0wiUuoTRvnzoigoPh2R4QAp/iykcfit91hNF/mxg
9JXonxh4+5u48DgDUHib9AdkIe4sK706DvjC2ZQjyirbzOPg1jdcK8EzELG4J3tb
1yqwQ4Edq9d2w5hduWEZJi90PptG+q4gZFcXksLDx4F4/wppcraG5g0+8qZciuV2
9rlAdTlY8ZTIClD/VzRSapEAJp9l6Td4phf4o0oYAxPW4GJQDdU/1m+iq0/o3om9
tLzwD9oko2DTgSe3nhSzLZRpatDA9U8e/cMVABEBAAG0H0xhbmNlIENoZW4gPGN5
ZW4wMzEyQGdtYWlsLmNvbT6JATwEEwECACYCGwMHCwkIBwMCAQYVCAIJCgsEFgID
#include <stdio.h>
int main() {
char buf[] = "aaaabbbb";
if (buf[0] == "a") {
if (buf[1] == "b") {
}
}
}