Skip to content

Instantly share code, notes, and snippets.

View mentholiptuz's full-sized avatar

Mentholiptuz mentholiptuz

  • Bangkok, Thailand
View GitHub Profile
#!/bin/sh
# Install OpenERP 7 on Digital Ocean
# Fernando Altuzar
# Modified script from Carlos E. Fonseca Zorrilla & Mario Gielissen
# First: Create a Droplet with CentOS 32 bits
# Then:
yum -y install wget unzip
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
@mentholiptuz
mentholiptuz / Recent Post Shortcode Wordpress
Last active December 22, 2015 13:58
Add this shortcode to the page where you would like to pull in your recent posts. Shortcode: [recent-posts]
function my_recent_posts_shortcode($atts){
$q = new WP_Query(
array( 'orderby' => 'date', 'posts_per_page' => '4')
);
$list = '<ul class="recent-posts">';
while($q->have_posts()) : $q->the_post();
$list .= '<li>' . get_the_date() . '<a href="' . get_permalink() . '">' . get_the_title() . '</a>' . '<br />' . get_the_excerpt() . '</li>';
server {
# output compression saves bandwidth
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# make sure gzip does not lose large gzipped js or css files
@mentholiptuz
mentholiptuz / base.conf
Created June 9, 2013 04:47
nginx.conf + base.conf for ruby on rail
## base.conf
server {
listen 80;
server_name base.com;
rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
}
server {
listen 80 default;
@mentholiptuz
mentholiptuz / installation.sh
Created June 9, 2013 04:40 — forked from mikhailov/installation.sh
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz