Skip to content

Instantly share code, notes, and snippets.

View pelgrim's full-sized avatar

Lucas Vieira pelgrim

  • revelo
  • sao paulo - brazil
View GitHub Profile
#!/bin/bash
# Ruby
useradd -d /home/app -m -s /bin/bash app
apt-get update
apt-get -y install git curl
su - app
#!/bin/bash
repository="$1"
destination="$2"
git clone https://github.com/$repository $destination
@pelgrim
pelgrim / old_file_killer.rb
Created July 6, 2012 15:29
A Ruby script to delete files older than X days in a given directory.
#!/usr/bin/env ruby
# A Ruby script to delete files older than X days in a given directory. Pretty simple.
# Like this: file_control.rb /User/pelgrim/Documents '*.pdf' 7
# The command above you remove ALL your pdfs inside Documents older than SEVEN DAYS.
# Quickly written by pelgrim < guskald at gmail dot com >
unless ARGV.size == 3
puts "Usage: file_control <directory> <filename pattern> <max age>"
exit 1
@pelgrim
pelgrim / create_dpkg.sh
Created August 24, 2011 17:08
Just a script for generating deb packages Like a Boss :-)
#!/bin/bash
# Script for generating deb packages Like a Boss
# Developed by Lucas Vieira <lucas at heap dot com dot br>
# Exit with error when things go bad
if [ $# -ne 1 ] || [ ! -e "$1/DEBIAN/control" ]; then
echo "Bad argumentation. Try ./create_pkg [package_dir]"
exit 1
@pelgrim
pelgrim / birtmd.rb
Created July 13, 2011 18:00
Birtmd Is a Rails Template for Mongoid and Devise
#BIRTMD Is a Rails Template for Mongoid and Devise
#rails new your_project_name -m birtmd.rb
#Doesn't work for rails 3.1 (:()
gem('jquery-rails','1.0.12')
generate('jquery:install')
gem('mongoid','2.0.2')
gem('bson_ext')
generate('mongoid:config')
gem('devise','1.4.2')