Skip to content

Instantly share code, notes, and snippets.

Avatar

Marius Voila mariusv

View GitHub Profile
View Vsftpd virtual users conf
###
# VSFTPD.CONF for virtual users with write/read/delete permissions
###
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
xferlog_enable=YES
connect_from_port_20=YES
chown_uploads=YES
View server.sh
#!/bin/sh
#
# server.sh
# Author: Marius Voila
# Created: 06/25/2010
# Updated: 07/19/2010
#
# See my blog post on this script: http://mariusv.com/rackspace-cloud-new-server-script
#
# This script installs everything needed to run a Ruby on Rails application on
View nginx
#!/bin/bash
#chkconfig: 2345 80 05
#description: Nginx
. /etc/rc.d/init.d/functions
INITLOG_ARGS=""
nginx=/usr/local/nginx/sbin/nginx
prog=nginx
View nginx.conf
user nginx nginx;
worker_processes 5;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
View file_example.conf
server {
listen 80;
server_name example.com;
root /var/www/example.com/public;
#rails_env development;
passenger_enabled on;
charset utf-8;
}
View example.conf
server {
listen 80;
server_name example.com;
root /var/www/example.com/public;
#rails_env development;
passenger_enabled on;
charset utf-8;
}
View after.sh
#!/bin/sh
#
# after.sh
# Author: Marius Voila
# Created: 06/25/2010
# Updated: 07/19/2010
#
# This script is more specific to my needs. I run it after server.sh.
# To get the pg gem to install, I generally have to restart my shell so
# the path to pg_config works.
@mariusv
mariusv / root
Created Jan 15, 2011
#!/bin/sh DEV1=ppp0 IP1=100.0.1.1 GW1=100.0.1.254 TABLE2=connection2 DEV2=ppp1 IP2=100.0.2.1 GW2=100.0.2.254 ip route flush table $TABLE1 ip route flush table $TABLE2 ip route show table main | grep -Ev '(^default|ppp)' | while read ROUTE ; do
View root
#!/bin/sh
DEV1=ppp0
IP1=100.0.1.1
GW1=100.0.1.254
TABLE2=connection2
DEV2=ppp1
IP2=100.0.2.1
GW2=100.0.2.254
ip route flush table $TABLE1
ip route flush table $TABLE2
@mariusv
mariusv / syncany.sh
Created Jun 3, 2011
backup script and upload via sftp
View syncany.sh
#!/bin/sh
# Settings
#############################
REMOTEHOST="example.com"
REMOTEBACKUPDIR="backup/sql"
SQLHOST="localhost"
SQLDB="database_name"
SQLUSER="username"
SQLPASS="password"
SQLFILE="database_name.sql"
@mariusv
mariusv / stats
Created May 9, 2012
Linux script to collect system statistics and send to your email
View stats
#!/bin/bash
SERVER="mydomain.com"
EMAIL_TO="your_email@gmail.com"
EMAIL_FROM="stat@mydomain.com"
# logged in users and what are they running
WHO=`w`