Skip to content

Instantly share code, notes, and snippets.

View ruyrocha's full-sized avatar

Ruy Rocha ruyrocha

  • Anywhere with internet connection.
View GitHub Profile
@ruyrocha
ruyrocha / gist:772318
Created January 10, 2011 03:42
install nginx on centos using passenger
First, create nginx user account:
useradd -c 'Nginx user' -d /var/lib/nginx -s /bin/false nginx
Then download nginx and nginx-upstream-fair* module sources:
cd /usr/src
wget http://sysoev.ru/nginx/nginx-0.8.53.tar.gz
wget --no-check-certificate http://github.com/gnosek/nginx-upstream-fair/tarball/master
Extract those files and you'll got two directories:
/usr/src/nginx-0.8.53
@ruyrocha
ruyrocha / gist:772319
Created January 10, 2011 03:44
nginx start/stop script (move to /etc/init.d/nginx)
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
@ruyrocha
ruyrocha / gist:772327
Created January 10, 2011 03:49
nginx.conf - gzip enhanced
#user nobody;
worker_processes 4;
error_log /var/log/nginx/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@ruyrocha
ruyrocha / rails_admin.pt-BR.yml
Created June 24, 2012 16:42 — forked from krsmurata/rails_admin.pt-BR.yml
Portuguese (pt-BR) translation for RailsAdmin 3.2
pt-BR:
views:
admin:
home:
name: Home
pagination:
previous: "« Anterior"
next: "Próximo »"
truncate: "…"
misc:
@ruyrocha
ruyrocha / gist:4567354
Created January 18, 2013 19:08
GitLab on CentOS 5.x (minor tweaks)
3. System Users
~ # adduser -s /bin/sh -c 'Git Version Control' git
~ # adduser -s /sbin/nologin -c 'GitLab' gitlab
then proceed with normal steps.
4. Gitolite
Fix "git" directory permissions:
@ruyrocha
ruyrocha / sql-client-patch
Created July 14, 2013 04:57
MariaDB client patch to prevent local command execution as root user
--- mariadb-5.5.31/client/mysql.cc 2013-07-14 01:13:16.594865591 -0300
+++ mariadb-5.5.31-safe-client/client/mysql.cc 2013-07-14 01:13:19.358678907 -0300
@@ -93,6 +93,11 @@
#define HAVE_READLINE
#define USE_POPEN
#endif
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif /* HAVE_PWD_H */
@ruyrocha
ruyrocha / CustomEventHandler
Last active December 26, 2015 10:49
This version of CustomEventHandler.pm will throw debug output for API calls into /usr/local/cpanel/logs/error_log
package Cpanel::CustomEventHandler;
# cpanel12 - CustomEventHandler.pm Copyright(c) 2008 cPanel, Inc.
# All rights Reserved.
# [email protected] http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited
#
# VERSION 1.0
#
@ruyrocha
ruyrocha / .irbrc
Created February 5, 2014 12:34 — forked from amokan/.irbrc
# Info/code for this file were borrowed from the following places:
# http://bit.ly/174dkWL
# https://gist.github.com/adamcrown/932231
# https://gist.github.com/patmcnally/893833
begin
# ansi colors
ANSI = {}
ANSI[:RESET] = "\e[0m"
~ # redis-benchmark -s /var/run/redis/redis.sock -q -n 10000
PING_INLINE: 156250.00 requests per second
PING_BULK: 196078.44 requests per second
SET: 212765.97 requests per second
GET: 185185.19 requests per second
INCR: 217391.30 requests per second
LPUSH: 200000.00 requests per second
LPOP: 222222.22 requests per second
SADD: 204081.64 requests per second
SPOP: 217391.30 requests per second
@ruyrocha
ruyrocha / set_dns_on_boot2docker.sh
Created November 24, 2015 13:32
Set a __good__ DNS when you cannot download images on Docker (while using boot2docker)
➜ ~ boot2docker ssh
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
_ _ ____ _ _