Skip to content

Instantly share code, notes, and snippets.

@phstudy
phstudy / index.jsp
Created December 7, 2012 12:29
Twitter4j Scriptlet version
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="twitter4j.Twitter"%>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>Sign in with Twitter example</title>
</head>
<body>
<%
sudo mkdir -p /usr/share/fonts/truetype/ttf-microsoft
sudo cp msjh.ttc msjhbd.ttc /usr/share/fonts/truetype/ttf-microsoft
sudo apt-get install fontconfig
sudo fc-cache -f -v
@phstudy
phstudy / startup.sh
Created July 2, 2013 17:23
AWS Elastic Beanstalk Tomcat 7 startup script
/usr/lib/jvm/jre/bin/java -DAWS_ACCESS_KEY_ID= -DAWS_SECRET_KEY= -DJDBC_CONNECTION_STRING= -DPARAM1= -DPARAM2= -DPARAM3= -DPARAM4= -DPARAM5= -Xms256m -Xmx256m -XX:MaxPermSize=64m -classpath :/usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat7 -Dcatalina.home=/usr/share/tomcat7 -Djava.awt.headless=true -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat7/temp -Djava.util.logging.config.file=/usr/share/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start
@phstudy
phstudy / custom.config
Created August 29, 2013 18:01
nginx forward setting for Elastic Beanstalk
files:
"/etc/nginx/conf.d/custom.conf" :
content: |
server {
listen 8080;
server_name foo.chief-motp.com;
location / {
proxy_pass http://nodejs/foo/;
proxy_set_header Connection "";
proxy_http_version 1.1;
@phstudy
phstudy / 01ssl.config
Created September 4, 2013 19:26
Manually enable Amazon Elastic Beanstalk Single instance type SSL
#
# This is the Apache server configuration file providing SSL support.
# It contains the configuration directives to instruct the server how to
# serve pages over an https connection. For detailing information about these
# directives see <URL:http://httpd.apache.org/docs/2.2/mod/mod_ssl.html>
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
@phstudy
phstudy / gist:8594404
Last active January 4, 2016 08:19
S3 sync region check.
# File "/usr/lib/python2.6/site-packages/awscli/customizations/s3/s3.py", line 746, in check_region
if not region and not parsed_region and parsed_endpoint_url is None:
raise Exception("A region must be specified --region or "
"specifying the region\nin a configuration "
"file or as an environment variable.\n"
"Alternately, an endpoint can be specified "
"with --endpoint-url")
@phstudy
phstudy / hibernate-use-eclipselink-converter
Created March 10, 2014 14:59
hibernate use eclipselink converter for hstore without generics
@phstudy
phstudy / DBRE.roo
Last active August 29, 2015 13:57
Database Reverse Engineering
// MySQL sample database
// https://dev.mysql.com/doc/employee/en/employees-installation.html
// https://launchpad.net/test-db/
project --topLevelPackage org.phstudy --projectName DBRE --java 6 --packaging JAR
persistence setup --database MYSQL --provider HIBERNATE --userName root --databaseName employees
database reverse engineer --package ~.model --schema PUBLIC
@phstudy
phstudy / hadoop-install-etu.sh
Created April 20, 2014 18:05
hadoop-install-etu.sh
# enable eth0
cd /etc/sysconfig/network-scripts/
sed -i -e 's@^ONBOOT="no@ONBOOT="yes@' ifcfg-eth0
ifup eth0
# update repository (may not required.)
# yum update
# install openjdk
yum install java-1.7.0-openjdk.x86_64
@phstudy
phstudy / bigtop-standby-NN-package-analysis
Last active August 29, 2015 14:01
bigtop-standby-NN-package-analysis
[root@bigtop1 usr]# yum list installed | grep Bigtop #(Active NN)
bigtop-jsvc.x86_64 1.0.10.5-1.el6 @Bigtop
bigtop-utils.noarch 0.7.0.5-1.el6 @Bigtop
hadoop.x86_64 2.0.6.5-1.el6 @Bigtop
hadoop-hdfs.x86_64 2.0.6.5-1.el6 @Bigtop
2.0.6.5-1.el6 @Bigtop
2.0.6.5-1.el6 @Bigtop
hbase.noarch 0.94.12.5-1.el6 @Bigtop
hbase-master.noarch 0.94.12.5-1.el6 @Bigtop
0.94.12.5-1.el6 @Bigtop