Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ramimassoud on github.
  • I am ramimassoud (https://keybase.io/ramimassoud) on keybase.
  • I have a public key whose fingerprint is D88E 9BF0 FF08 4BBB 629B 7C41 EC93 7B6C 96A7 2374

To claim this, I am signing this object:

@ramimassoud
ramimassoud / statamic.conf
Created December 12, 2012 06:24
A sample configuration to get Statmic (http://statamic.com/) up and running on a Nginx webserver
server {
access_log /home/webroots/default/logs/access.log;
error_log /home/webroots/default/logs/error.log;
root /home/webroots/default/public_html;
index index.php;
# Make site accessible from http://localhost/
server_name localhost;
@ramimassoud
ramimassoud / key-map.el
Created August 30, 2011 03:58
Quick script of my global emacs key mapping taken from my config
(define-key global-map (kbd "`") 'hippie-expand)
(define-key global-map (kbd "M-g") 'goto-line)
(define-key global-map (kbd "M-'") 'expand-abbrev)
(define-key global-map (kbd "M-Q") 'unfill-paragraph)
(define-key global-map (kbd "C-c w") 'delete-trailing-whitespace)
(define-key global-map (kbd "C-c \\") 'toggle-truncate-lines)
(define-key global-map (kbd "C-c q") 'query-replace-string)
(define-key global-map (kbd "C-c M-q") 'query-replace-regexp)
(define-key global-map (kbd "C-c r") 'replace-string)
@ramimassoud
ramimassoud / functions.sh
Created August 28, 2011 03:24
Some quick bash function examples
# -*- mode: shell-script; -*-
# Search for matching files; list, verify, and delete them
function rmf {
name=$1
find . -type f -iname "$name"
echo " "
echo "Remove listed files? y/n"
@ramimassoud
ramimassoud / aliases.sh
Created August 21, 2011 03:39
Snapshot of my current global aliases
# -*- mode: shell-script; -*-
alias eamcs='emacs';
alias celar='clear';
alias cp='cp -i';
alias mv='mv -i';
alias rm='rm -i';
alias hg='history|grep';
alias exity='exit'
alias update='sudo apt-get check && sudo apt-get update && sudo apt-get upgrade &&
@ramimassoud
ramimassoud / web_stack.sh
Created August 12, 2011 03:38
Script to automatically configure the web stack and setup one or more websites. Part of https://github.com/ramimassoud/New-Server-Rollout
#!/bin/bash
BASEDIR=$(dirname $0)
# Get the ip address for the virtual host declaration
IP=$(ifconfig eth0 | grep -Po "inet addr:\d+\.\d+\.\d+\.\d+" | grep -Po "\d+\.\d+\.\d+\.\d+")
apt-get install apache2 php5 php5-mcrypt php-pear libapache2-mod-php5 \
mysql-server php5-mysql postgresql php5-pgsql
echo "Sites to configure (space delimited)"
@ramimassoud
ramimassoud / EncryptTest.php
Created March 27, 2011 01:54
Example of using PHP's mcrypt to decrypt data that was encrypted using MySQL's AES_ENCRYPT()
<?php
$con = mysql_connect('localhost', 'dbUser', 'dbPassword');
$key = '1234567890123456';
$table = "CREATE TABLE people (
id INT NOT NULL AUTO_INCREMENT,
full_name VARCHAR(255),
ssn VARCHAR(255),
PRIMARY KEY (id)