Skip to content

Instantly share code, notes, and snippets.

View alexrinass's full-sized avatar

Alexander Rinass alexrinass

View GitHub Profile
@alexrinass
alexrinass / addsvnrepo
Created May 7, 2011 12:06
Creates a new SVN repo
#!/bin/sh
#
# Creates a Subversion repository under /var/lib/svn and imports the default
# SVN directory layout (trunk branches tags) as initial commit.
#
SCRIPT_NAME="`basename $0`"
SVN_REPOSITORY_PATH="/var/lib/svn"
SVN_HOOKS_PATH="/usr/local/share/subversion/repository-creation/hooks"
@alexrinass
alexrinass / index.html
Created May 7, 2011 12:36
HTML5 Base template
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf8" />
<meta name="DC.Title" content="" />
<meta name="DC.Description" content="" />
<meta name="description" content="" />
<meta name="DC.Author" content="" />
<meta name="DC.Publisher" content="" />
<meta name="DC.Copyright" content="" />
@alexrinass
alexrinass / addgitrepo
Created May 7, 2011 18:46
Create a new shared git repo on linux
#/bin/sh
#
# Script to create an empty Git-Repository.
#
GIT_BASEPATH=/var/cache/git
SCRIPT_NAME="`basename $0`"
PROJECT_NAME="$1"
if [ -z "$PROJECT_NAME" ]; then
@alexrinass
alexrinass / gist:960724
Created May 7, 2011 18:48
Git config aliases
[alias]
st = status -sb
ci = commit
co = checkout
ls = "log --oneline --decorate --color"
lsg = "log --oneline --decorate --color --graph"
untrack = "rm --cached --"
unstage = "reset HEAD --"
@alexrinass
alexrinass / gist:960729
Created May 7, 2011 18:50
Git+Kaleidoscope difftool configuration
[alias]
ksdiff = difftool
[diff]
tool = ksdiff
[difftool "ksdiff"]
cmd = "ksdiff $LOCAL $REMOTE"
[difftool]
@alexrinass
alexrinass / gist:960730
Created May 7, 2011 18:50
TextMate as git editor
[core]
editor = mate -w
@alexrinass
alexrinass / gist:960731
Created May 7, 2011 18:52
chmod dirs/files only
# dirs only
find "$DIRECTORY" -type d -exec chmod "$MODE" {} \;
# files only
find "$DIRECTORY" -type f -exec chmod "$MODE" {} \;
@alexrinass
alexrinass / gist:960733
Created May 7, 2011 18:55
Absolute path of script file in shell
$(cd $(dirname $0);pwd)
@alexrinass
alexrinass / gist:960734
Created May 7, 2011 18:56
Create new restricted MySQL user
CREATE USER 'USER'@'localhost' IDENTIFIED BY 'PASSWORD';
INSERT INTO `db` (`Host`, `Db`, `User`, `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Grant_priv`, `References_priv`, `Index_priv`, `Alter_priv`, `Create_tmp_table_priv`, `Lock_tables_priv`, `Create_view_priv`, `Show_view_priv`, `Create_routine_priv`, `Alter_routine_priv`, `Execute_priv`) VALUES
('localhost', 'DATABASE', 'USER', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N');
@alexrinass
alexrinass / gist:960735
Created May 7, 2011 18:56
Create new MySQL UTF-8 database
CREATE DATABASE `DATABASE` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;