Skip to content

Instantly share code, notes, and snippets.

View panggi's full-sized avatar
Brewing something

Panggi Libersa Jasri Akadol panggi

Brewing something
View GitHub Profile
@panggi
panggi / rails_logrotate
Created December 9, 2014 10:02
rails logrotate script
/opt/username/shared/log/*log {
create 0644 username username
su root username
daily
rotate 1
compress
missingok
notifempty
sharedscripts
postrotate
@panggi
panggi / unicorn-init
Created December 9, 2014 09:45
init script for unicorn
#!/bin/sh
set -e
TIMEOUT=${TIMEOUT-60}
RAILS_ENV=production
APP_ROOT=/opt/username/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
PATH=$PATH:/home/username/.rbenv/shims
CMD="$APP_ROOT/bin/unicorn -D -c $APP_ROOT/config/unicorn.rb -E $RAILS_ENV"
action="$1"
$ java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Server VM (build 17.1-b03, mixed mode)
#........
if [ $OPEN_JDK -eq 0 ]; then
echo WARNING: You are launching IDE using OpenJDK Java runtime
echo
echo THIS IS STRICTLY UNSUPPORTED DUE TO KNOWN PERFORMANCE AND GRAPHICS PROBLEMS
echo
echo NOTE: If you have both Sun JDK and OpenJDK installed
echo please validate either RUBYMINE_JDK or JDK_HOME points to valid Sun JDK installation
echo
echo Press Enter to continue.
sudo update-alternatives --config java
$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.2) (6b20-1.9.2-0ubuntu2)
OpenJDK Server VM (build 19.0-b09, mixed mode)
$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 auto mode
1 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode
Press enter to keep the current choice[*], or type selection number: 2
@panggi
panggi / rvm.txt
Created January 25, 2011 14:38
using multiple rails versions in one GNU/Linux machine
$ rvm list
rvm rubies
ruby-1.8.6-p399 [ i386 ]
ruby-1.8.7-p302 [ i386 ]
ruby-1.8.7-p330 [ i386 ]
ruby-1.9.1-p378 [ i386 ]
ruby-1.9.2-p0 [ i386 ]
=> ruby-1.9.2-p136 [ i386 ]
+ /cgi.cgi/.access: Contains authorization information
+ /webcgi/.access: Contains authorization information
+ /cgi-914/.access: Contains authorization information
+ /cgi-915/.access: Contains authorization information
+ /bin/.access: Contains authorization information
+ /cgi/.access: Contains authorization information
+ /mpcgi/.access: Contains authorization information
+ /cgi-bin/.access: Contains authorization information
+ /ows-bin/.access: Contains authorization information
+ /cgi-sys/.access: Contains authorization information
<script>...NEVER PUT UNTRUSTED DATA HERE...</script> directly in a script
<!--...NEVER PUT UNTRUSTED DATA HERE...--> inside an HTML comment
<div ...NEVER PUT UNTRUSTED DATA HERE...=test /> in an attribute name
<NEVER PUT UNTRUSTED DATA HERE... href="/test" /> in a tag name