Skip to content

Instantly share code, notes, and snippets.

@wolfg1969
wolfg1969 / CaptchaServiceBeanConfig.java
Created August 23, 2012 06:20
spring beans configuration for jcaptcha service
package me.guoyong.demo;
import com.jhlabs.image.WaterFilter;
import com.octo.captcha.CaptchaFactory;
import com.octo.captcha.component.image.backgroundgenerator.BackgroundGenerator;
import com.octo.captcha.component.image.backgroundgenerator.UniColorBackgroundGenerator;
import com.octo.captcha.component.image.deformation.ImageDeformation;
import com.octo.captcha.component.image.deformation.ImageDeformationByFilters;
import com.octo.captcha.component.image.fontgenerator.FontGenerator;
import com.octo.captcha.component.image.fontgenerator.RandomFontGenerator;
# build helloworld executable when user executes "make"
volumecontrol: volumecontrol.o
$(CC) $(LDFLAGS) -lasound volumecontrol.o -o volumecontrol
volumecontrol.o: volumecontrol.c
$(CC) $(CFLAGS) -c volumecontrol.c
# remove object files and executable when user executes "make clean"
clean:
rm *.o volumecontrol
@wolfg1969
wolfg1969 / script.sh
Created September 5, 2012 10:45 — forked from kapkaev/script.sh
centOS gitosis
#step 1
yum -y install python-setuptools
#step 2
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# or
# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
#step 3
# if you using centOS 6.2 enable rpmforge-extras (enabled =1)
@wolfg1969
wolfg1969 / tunnel.conf
Created September 6, 2012 07:05
autossh upstart conf
# tunnel - secure tunnel to my vps
description "ssh tunnel"
start on (local-filesystems and network-device-up IFACE!=lo)
stop on runlevel [!12345]
respawn
respawn limit 5 60 # respawn max 5 times in 60 seconds
umask 022
@wolfg1969
wolfg1969 / nginx.conf
Created September 7, 2012 09:58
ngx_set_misc example: redirect to a url specified by query parameter.
location /go {
set_unescape_uri $new_url $arg_url;
if ( $new_url ~* ^[^(http://)](.*)$ ){
return 302 http://$new_url;
}
return 302 $new_url;
}
@wolfg1969
wolfg1969 / maven-assembly-plugin.xml
Created September 14, 2012 02:08
maven pom samples
<project>
...
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<finalName>uis-server</finalName>
<descriptors>
@wolfg1969
wolfg1969 / DemoDaemon.java
Created September 17, 2012 08:56
run java program as a daemon with jsvc
package server;
import org.apache.commons.daemon.Daemon;
import org.apache.commons.daemon.DaemonContext;
import org.apache.commons.daemon.DaemonInitException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* User: guoyong
@wolfg1969
wolfg1969 / 3g.sh
Created October 4, 2012 08:29
scripts under my gentoo home directory
#!/bin/sh
sudo wvdial
@wolfg1969
wolfg1969 / boot.log
Created October 4, 2012 08:32
wr703n uboot log
U-Boot 1.1.4 (Feb 28 2012 - 11:58:24)
AP121 (ar9330) U-boot
DRAM: 32 MB
led turning on for 1s...
id read 0x100000ff
flash size 4194304, sector count = 64
Flash: 4 MB
Using default environment
@wolfg1969
wolfg1969 / cisco-decrypt.c
Created October 4, 2012 08:34
Decoder for password encoding of Cisco VPN client
/* Decoder for password encoding of Cisco VPN client.
Copyright (C) 2005 Maurice Massar
Thanks to HAL-9000@evilscientists.de for decoding and posting the algorithm!
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,