Skip to content

Instantly share code, notes, and snippets.

View identityclash's full-sized avatar

Jerome A. C. Ngo identityclash

View GitHub Profile
@identityclash
identityclash / debian-graphicsmagick.sh
Created November 11, 2015 06:05 — forked from genediazjr/graphicsmagick.sh
install graphicsmagick on debian with png, jpeg, tiff, and webp support
apt-get install make git g++ gcc zlib1g zlib1g-dev libxml2 libxml2-dev -y
# https://developers.google.com/speed/webp/docs/compiling#building
cd /usr/local/src
wget http://downloads.webmproject.org/releases/webp/libwebp-0.4.3.tar.gz
tar -xvzf libwebp-0.4.3.tar.gz
cd libwebp-0.4.3
./configure
@identityclash
identityclash / debian-nginx-src.sh
Created November 11, 2015 06:05
Nginx compile from source on Debian
apt-get -y install build-essential zlib1g-dev libpcre3 libpcre3-dev libssl-dev libbz2-dev libpcrecpp0 tar unzip
# http://nginx.org/en/download.html
cd /tmp
wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -xzvf nginx-1.8.0.tar.gz
mkdir /nginx-modules
cd /nginx-modules
@identityclash
identityclash / debian-haproxy.sh
Created November 11, 2015 06:06 — forked from genediazjr/haproxy.sh
HAProxy with SSL on Debian to nginx and node backends
echo "deb http://ftp.debian.org/debian sid main" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian experimental main" >> /etc/apt/sources.list
apt-get update
apt-get -t sid install libc6 libc6-dev libc6-dbg
# reboot machine
apt-get -t experimental install haproxy
@identityclash
identityclash / comodo-ssl-cer-pem.sh
Created November 11, 2015 06:07 — forked from genediazjr/comodo-ssl.sh
Convert Comodo Positivessl to cer and pem
# generate OpenSSL CSR here
# https://www.digicert.com/easy-csr/openssl.htm
# to cer
cat COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > yourdomain.com.cer
# to pem
cat yourdomain.com.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt yourdomain.com.key > yourdomain.com.pem
@identityclash
identityclash / debian-redis.sh
Created November 11, 2015 06:07 — forked from genediazjr/debian-redis.sh
Redis on Debian
apt-get install vim redis-server
vim /etc/redis/redis.conf
-----------------------------------------------------------------------------
bind 0.0.0.0
-----------------------------------------------------------------------------
appendonly yes
-----------------------------------------------------------------------------
vim /etc/sysctl.conf
@identityclash
identityclash / deploy.sh
Created November 11, 2015 06:08 — forked from genediazjr/deploy.sh
Tomcat deployment script on Debian EC2
#!/bin/sh
echo "\n Killing the cat..."
/etc/init.d/tomcat7 stop
echo "\n Removing internal organs..."
rm -rf /var/lib/tomcat7/webapps/ROOT
rm -rf /var/lib/tomcat7/webapps/ROOT.war
echo "\n Placing new organs..."
@identityclash
identityclash / .gitignore
Created November 11, 2015 06:08 — forked from genediazjr/.gitignore
Gitignore Preset
.DS_Store
.lock-wscript
.komodotools
.classpath
.settings
.project
.dropbox
.tmproj
.grunt
.cache
<!-- Append to pom.xml -->
<dependency>
<groupId>com.thetransactioncompany</groupId>
<artifactId>cors-filter</artifactId>
<version>1.8</version>
</dependency>
<!-- Append to web.xml -->
<filter>
@identityclash
identityclash / SerializeObject.js
Created November 11, 2015 06:08 — forked from genediazjr/SerializeObject.js
prepare form objects for JSON.stringify
$.fn.serializeObject = function () {
var o = {};
var a = this.serializeArray();
$.each(a, function () {
if (o[this.name] !== undefined) {
if (!o[this.name].push) {
o[this.name] = [o[this.name]];
}
o[this.name].push(this.value || '');
} else {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
};
function guid() {
return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
s4() + '-' + s4() + s4() + s4();
}