use github as website, server, a database, maven repository, portfolio,
maven repo, wiki, cms, file storage, web server, blog, cdn, backup, group,
hosting, web host, javascript, mirror, number, quiz, resume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 <[email protected]> | |
# | |
# 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias ls='ls --color=auto' | |
alias v='ls -l' | |
alias lh='ls -lh' | |
alias dh='df -h' | |
alias ll='ls -al' | |
alias irb='irb --simple-prompt' | |
alias ltips='less $HOME/tips.txt' | |
alias path='echo $PATH | sed -e "s/:/\n/g"' | |
# old linux server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# crontab for schedule to play music | |
39 * * * * /usr/sbin/ntpdate -s ntp.ntu.edu.tw > /dev/null 2>&1 | |
0 10 * * 1-5 /usr/bin/mpg321 --list /home/user/M/ten.txt | |
0 12 * * 1-5 /usr/bin/mpg321 -g 40 --list /home/user/M/noon.txt | |
0 13 * * 1-5 /usr/bin/mpg321 --list /home/user/M/wakeup.txt | |
0 15 * * 1-5 /usr/bin/mpg321 --list /home/user/M/teatime.txt |
- [knockout.js] (http://knockoutjs.com/)
- [wijmo] (http://wijmo.com/)
- [bootstrap] (http://twitter.github.io/bootstrap/)
- [jquery] (http://jquery.com/)
- [jquery UI] (http://jqueryui.com/)
- [zepto.js] (http://zeptojs.com/)
- [lorem.js] (https://github.com/shyiko/lorem)
- [sammy.js] (http://sammyjs.org)
- [jquery shuffle] (http://yelotofu.com/labs/jquery/snippets/shuffle/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create systemd service file for rails 2.3.x startup | |
[Unit] | |
Description=rails 2.3.x web server | |
[Service] | |
Type=simple | |
RemainAfterExit=yes | |
User=username | |
PIDFile=/home/username/WEBSERVER/tmp/pids/thin.pid | |
WorkingDirectory=/home/username/WEBSERVER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# _*_ encoding: utf-8 _*_ | |
# parse nations rank in http://ngam.natixis.com/docs/12/1010/Global_Retirement_Index,0.pdf | |
line=File.readlines('./rank.txt').map(&:chomp)[0] | |
hash = {} | |
@index = 1 | |
line.split(/(\d+)/).each do |x,i| | |
unless x.to_i.zero? | |
@index = x.to_i | |
else | |
hash[@index] = x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
# detail at http://ithelp.ithome.com.tw/question/10103736 | |
require 'sinatra' | |
require 'net/http' | |
require 'open-uri' | |
require 'json' | |
require 'yaml' | |
get '/' do | |
"Hi, 鐵人五<br /><a href='/env'>環境變數</a>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get count number from html file | |
require 'hpricot' | |
doc=Hpricot(open('online.txt')) | |
>> doc.search("tr").size | |
=> 61 | |
>> doc.search("tr")[0].at('td').innerText | |
=> "online people : 50" | |
msg = doc.search("tr")[0].at('td').innerText | |
count = msg.split(':')[1].strip |
NewerOlder