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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Exposition to JSON Converter</title> | |
</head> | |
<body> | |
<h1>Exposition to JSON Converter</h1> | |
<form id="expositionForm"> | |
<label for="expositionInput">Exposition String:</label> | |
<br> |
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
import socket, os, sys | |
addr = ("", 4444) | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.bind(addr) | |
s.listen(1) | |
conn, addr = s.accept() | |
while 1: | |
data = conn.recv(1024) | |
if not data: break |
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
{ | |
"mapping": { | |
"1,58,1": "key_leftctrl", | |
"1,56,1+1,38,1": "key_pageup", | |
"1,56,1+1,52,1": "key_pagedown", | |
"1,56,1": "disable", | |
"1,56,1+1,2,1": "key_f1", | |
"1,56,1+1,3,1": "key_f2", | |
"1,56,1+1,5,1": "key_f4", | |
"1,56,1+1,6,1": "key_f5", |
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/python | |
import os, sys, re, os.path, shutil | |
from datetime import date, timedelta | |
RESERVED_DAYS = 30 | |
date_pattern = re.compile('[0-9]+-[0-9]+-[0-9]+') | |
def logcleanup(reserveddays, dirname, names): | |
for name in names: |
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
import org.springframework.orm.hibernate4.HibernateTransactionManager | |
import org.springframework.jdbc.datasource.embedded.* | |
import org.springframework.orm.hibernate4.LocalSessionFactoryBean | |
beans { | |
importBeans("classpath:META-INF/spring/cwep-popularity-storage/data-access.xml") | |
importBeans("classpath:META-INF/spring/cwep-popularity-storage/service.xml") | |
dataSource(EmbeddedDatabaseFactoryBean) { | |
databaseType = EmbeddedDatabaseType.H2 | |
} |
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
*.iml | |
*.ipr | |
.classpath | |
.gradle | |
.idea | |
.project | |
.settings | |
build | |
classes | |
bin |
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
<IfModule proxy_module> | |
<IfModule proxy_http_module> | |
#LogLevel alert trace3 | |
################# | |
# Reverse Proxy # | |
################# | |
ProxyRequests Off | |
ProxyTimeout 3600 | |
# turn this on if there are https URL to handle with. |
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
$ su | |
# postgresql-setup initdb | |
# su - postgres | |
$ psql | |
\password postgres | |
$ echo "host all all 192.168.133.0/24 md5" >> /var/lib/pgsql/data/pg_hba.conf | |
$ exit | |
# service postgres start | |
# exit |
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/bash | |
mkdir -p ~/bin | |
mkdir -p ~/workspace | |
# startup environment | |
cat >> ~/.profile <<EOF | |
export PATH=~/bin:$PATH | |
export TEMP=${TEMP:-"/tmp"} | |
EOF | |
chmod u+x ~/.profile |
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/bash | |
echo "edit this file before you execute it!!" | |
echo "make sure keytool and openssl commands are in PATH" | |
echo "Contiune?" | read ANS | |
echo "give me CN(www.xxx.com.tw)" | read CN | |
echo "give me default password(length >= 8)" | read -s PASS | |
set -e | |
# Edit these arguments |
NewerOlder