Skip to content

Instantly share code, notes, and snippets.

View FernandoEscher's full-sized avatar
🏠
Working from home

Fernando Irias Escher FernandoEscher

🏠
Working from home
  • Tegucigalpa, Honduras
View GitHub Profile
@FernandoEscher
FernandoEscher / RailsServerConfig_05_start_application
Created September 10, 2012 22:06
Server configuration for Rails: Start the application
# Create a symlink to the nginx bin file
sudo ln -s /opt/nginx/sbin/nginx /usr/local/sbin/
# Change the PID location
sudo vim /opt/nginx/conf/nginx.conf
pic /var/run/nginx.pid
# Go to the init.d folder
cd /etc/init.d/
@FernandoEscher
FernandoEscher / RailsServerConfig_04_web_server
Created September 10, 2012 21:55
Server configuration for Rails: Configuring the web server
# Enter the root account
sudo su
# Set your applications gemset
rvm gemset use MyAppName
# Install passenger
gem install passenger
# Install passenger module along with nginx
@FernandoEscher
FernandoEscher / RailsServerConfig_03_application_config
Created September 10, 2012 21:52
Server configuration for Rails: Configure the application
# Add your server's rsa public key to github (http://github.com/settings/ssh)
cat .ssh/id_MyAppName_rsa.pub
# Download your application to your home dir
git clone <repo>
# Enter your aplications folder
cd MyAppName/
# Go as root user
@FernandoEscher
FernandoEscher / RailsServerConfig_02_required_packages
Created September 10, 2012 21:51
Server configuration for Rails: Install required packages
# Install Git and Curl
sudo apt-get install git curl
# Install RVM from the website. It has to be Multiuser mode
curl -L https://get.rvm.io | sudo bash -s stable
# Add root and your user to the rvm group
sudo adduser root rvm
sudo adduser MyAppName rvm
@FernandoEscher
FernandoEscher / RailsServerConfig_01_admin_user
Created September 10, 2012 21:47
Server configuration for Rails: Creation of admin user.
# Some steps were taken from: http://blog.sofasurfer.org/2011/07/16/ubuntu-ec2-add-new-admin-user/
# Create new user and follow the steps
sudo adduser MyAppName
# Add the user to the admin group to have sudo access
sudo adduser MyAppName admin
# If you want to allow sudo access without password (Insecure)
sudo visudo
@FernandoEscher
FernandoEscher / alac2wav.sh
Created September 9, 2012 02:18
Convert recursively all the ALAC files to WAV
MAIN_DIR="parent/dir/here/" && for dir in "$MAIN_DIR"*/; do cd "$dir"; for f in *.m4a; do alac-decoder -v -f "$(basename "$f" .m4a).wav" "$f"; done; cd ..; done; && find "$MAIN_DIR" -name "*.m4a" -delete
@FernandoEscher
FernandoEscher / abcde_rename.sh
Created September 5, 2012 19:10
Renaming the folders generated by abcde CD ripper
#!/bin/bash
SEPARATOR="-"
DIRS="${PWD}/*"
for dir in $DIRS
do
if [[ -d $dir && $dir == *-* ]]
then
dirname=$(basename $dir)
@FernandoEscher
FernandoEscher / flac2ogg.sh
Created September 5, 2012 19:13
File splitter and converter from FLAC to OGG
#!/bin/bash
echo "Breacking file into tracks..."
cuebreakpoints *.cue | shnsplit -o flac *.flac
echo "Converting flac tracks to ogg quality 9..."
oggenc -q9 split-track*.flac
echo "Tagging files with info from the cue sheet..."
cuetag *.cue split-track*.ogg
sleep 7
echo "Renaming files according to tags..."
@FernandoEscher
FernandoEscher / ape2ogg.sh
Created September 5, 2012 19:12
File splitter and converter from APE to OGG
#!/bin/bash
echo "Breaking file into tracks..."
cuebreakpoints *.cue | shnsplit -o flac *.ape
echo "Converting flac tracks to ogg quality 9..."
oggenc -q9 split-track*.flac
echo "Tagging files with info from the cue sheet..."
cuetag *.cue split-track*.ogg
sleep 7
echo "Renaming files according to tags..."
@FernandoEscher
FernandoEscher / config.rb
Created July 6, 2012 04:14
Configuration file for backups of Ppostgresql to Dropbox.
# encoding: utf-8
##
# Backup
# Generated Main Config Template
#
# For more information:
#
# View the Git repository at https://github.com/meskyanichi/backup
# View the Wiki/Documentation at https://github.com/meskyanichi/backup/wiki