Skip to content

Instantly share code, notes, and snippets.

Avatar

Marius Voila mariusv

View GitHub Profile
@mariusv
mariusv / fixUUID.sh
Last active Dec 11, 2015
This fixes the UUID issue on Racksapce Cloud servers with Ubuntu 12.04 or any Ubuntu servers after upgrading the GRUB to GRUB2 and chose to install the maintainer version of menu.lst
View fixUUID.sh
#!/bin/sh
file="/mnt/boot/grub/menu.lst"
back="/mnt/boot/grub/menu.lst~"
word="UUID"
mount -o rw /dev/xvdb1 /mnt
if [ -x "$file" ]; then
echo "File $file does not exist."
@mariusv
mariusv / girlybookclub
Last active Dec 10, 2015
vhost for girlybookclub.com
View girlybookclub
<VirtualHost *>
ServerAdmin contact@girlybookclub.com
ServerName
ServerAlias *.girlybookclub.com www.girlybookclub.com
DirectoryIndex index.html index.htm index.php
DocumentRoot /home/tgbc/girlybookclub/
<Directory /home/tgbc/girlybookclub/>
Options Indexes FollowSymLinks MultiViews
View thegirlybookclub
<VirtualHost *>
ServerAdmin contact@thegirlybookclub.com
ServerName thegirlybookclub.com
ServerAlias *.thegirlybookclub.com www.thegirlybookclub.com
DirectoryIndex index.html index.htm index.php
DocumentRoot /home/tgbc/thegirlybookclub/
<Directory /home/tgbc/thegirlybookclub/>
Options Indexes FollowSymLinks MultiViews
@mariusv
mariusv / lamp.sh
Created Dec 21, 2012
Install apache/mysql/php
View lamp.sh
#!/bin/bash
set -e
MY_PATH="$( cd "$( dirname "$0" )" && pwd )"
echo Now w are updating the system please wait till the process will end
apt-get update && apt-get upgrade -y
@mariusv
mariusv / remi.yml
Last active Nov 13, 2015
Ansible playbook to enable EPEL + REMI on a AWS Linux AMI. This gist is created for /u/AngleMan on https://www.reddit.com/r/ansible .
View remi.yml
---
- hosts: all
sudo: yes
tasks:
- name: Enable EPEL
command: yum-config-manager --enable epel
- name: Install remi repo.
@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`
@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 / 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
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 nginx.conf
user nginx nginx;
worker_processes 5;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {