Skip to content

Instantly share code, notes, and snippets.

View twtw's full-sized avatar

Cheng-Yen Liu twtw

View GitHub Profile
@twtw
twtw / proxy.rb
Created December 31, 2017 06:28 — forked from torsten/proxy.rb
A quick HTTP proxy server in Ruby.
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009-2014 Torsten Becker <torsten.becker@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
@twtw
twtw / useGithubAs.adoc
Last active January 20, 2018 02:44
use github as
@twtw
twtw / rotateMailLog.sh
Created August 16, 2020 02:59
archive everyday maillog or multi website logs to every file. origin from solaris rotate script.
#! /bin/sh
# in crontab:
# 59 23 * * * /home/user/bin/rotateMailLog.sh
# save one or many logs in one folder to other folder
LOGDIR=/var/log
if test -d $LOGDIR
then
cd $LOGDIR
for LOG in maillog messages.log
do