Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
VERSION="1.1"
REEV="http://rubyforge.org/frs/download.php/48623/ruby-enterprise-1.8.6-20081215.tar.gz"
REEF="ruby-enterprise-1.8.6-20081215.tar.gz"
REEFF=${REEF%".tar.gz"}
PASSENGER="2.0.6"
echo "#####################################"
echo "Welcome, let's get this party rollin'"
echo "#####################################"
# Enable .htaccess Files
# Place something like the following in your Apache configuration file,
# or your virtual host configuration file.
<Directory /home/billstemp/public_html/>
Options Indexes FollowSymLinks MultiViews
# THIS is the most important line
AllowOverride All
Order allow,deny
# Secure PHP *.inc files
# If your PHP application has files ending in '.inc', you will want to
# put this either in a .htaccess file in the root of the app, in the
# virtual host configuration file, or in your global Apache
# configuration file.
<Files ~ "\.inc$">
Order allow, deny
Deny from all
# Find all files containing a string with context
# Find all files containing a certain string, starting
# in the current directory, recursively.
# This will also provide some context, by printing 3 lines
# before and after the match (see the 'C3' argument to 'egrep').
find ./ -name '*.rb' | xargs egrep -nC3 'def initialize' | less
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" media="all" href="" />
</head>
<body>
</body>
</html>
# Grant Privileges to a user for a certain db in MySQL
grant all privileges on dbname.* to 'username'@'localhost' identified by 'thepasswd';
# Remove All Missing Files
# By 'missing files', I mean files that are flagged with an exclamation point.
# Let's say you went through and renamed all of *.ejs files to *.js.erb files,
# to be compatible with Rails 2.0. Now, you have all of these freakin' missing
# files, and you don't want to go through and delete them from SVN by hand. Do
# this:
svn status | grep '\!' | awk '{print $2;}' | xargs svn rm
# Remove '.svn' Directories Recursively
find . -type d -name ".svn" -exec rm -rf {} \;
# OR
rm -rf `find . -type d -name .svn`
# List Installed Packages
# This is a Debian-based tip.
dpkg --get-selections
# This can be used to grep for certain packages:
dpkg --get-selections | grep php
development:
adapter: sqlite3
database: db/dev.sqlite3
timeout: 5000
test:
adapter: sqlite3
database: db/test.sqlite3
timeout: 5000