Skip to content

Instantly share code, notes, and snippets.

@cdwilson
cdwilson / gitosis_setup_fedora.sh
Created July 27, 2010 17:29
Gitosis setup instructions for Fedora
# Gitosis setup instructions for Fedora
# copied from http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way
# and modified to work on Fedora
# Comment out the next two lines after you've changed this script to match your config
echo "This is not meant to be run as a script!"
exit 0
# do you have setuptools or distribute? if not, run these commands
cd ~/src
@cdwilson
cdwilson / create_git_user_osx.sh
Created July 28, 2010 06:15
This script creates a git group and user account under Mac OS X for gitosis
#!/bin/bash
# This script creates a git group and user account under Mac OS X
# Assumes git was installed via macports (i.e. /opt/local)
USERNAME="git"
GROUPNAME="$USERNAME"
REALNAME="git version control"
PASSWORD="*"
@cdwilson
cdwilson / etc_gitweb.conf
Created August 4, 2010 05:03
Mac OS X Snow Leopard - /etc/gitweb.conf
# http://repo.or.cz/w/alt-git.git?a=blob_plain;f=gitweb/README
# Site name
$site_name = "git.cdwilson.us";
# $my_uri = "/";
# $home_link = "/";
# Point to projects.list file generated by gitosis.
# Here gitosis manages the user "git", who has a
@cdwilson
cdwilson / private_etc_apache2_httpd.conf
Created August 4, 2010 05:06
Mac OS X Snow Leopard - /private/etc/apache2/httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@cdwilson
cdwilson / private_etc_apache2_extra_httpd-vhosts.conf
Created August 4, 2010 05:11
Mac OS X Snow Leopard - /private/etc/apache2/extra/httpd-vhosts.conf
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
@cdwilson
cdwilson / .profile
Created September 12, 2010 22:58
My .profile
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
alias la="ls -a" # list all, includes dot files
alias ll="ls -l" # long list, excludes dot files
alias lla="ls -la" # long list all, includes dot files
# Setup some colors to use later in interactive shell or scripts
@cdwilson
cdwilson / org.kernel.git.git-daemon.plist
Created September 15, 2010 19:09
Mac OS X Snow Leopard - /Library/LaunchDaemons/org.kernel.git.git-daemon.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.kernel.git.git-daemon</string>
<key>UserName</key>
<string>git</string>
<key>GroupName</key>
@cdwilson
cdwilson / git_setup_chwilso3_ubuntu
Created December 14, 2010 20:19
Git setup script for ubuntu
#!/bin/sh
# Install meld
sudo apt-get -y install meld
# Install lighttpd so that 'git instaweb' works
# sudo apt-get -y install lighttpd
# Install git
sudo apt-get -y install git-core git-doc git-cvs git-svn git-email git-daemon-run git-gui gitk
@cdwilson
cdwilson / helpful_commands.sh
Last active May 6, 2024 05:35
Helpful commands
# Find "text" in some /path/to/search
find /path/to/search -type f -print0 | xargs -0 grep -l "text"
# Restore the deleted files in a git repository
git ls-files -d | xargs git checkout --
# Move all files in a directory including .files
# http://superuser.com/questions/62141/linux-how-to-move-all-files-from-current-directory-to-upper-directory
(shopt -s dotglob; mv -- * /path/to/destination)
@cdwilson
cdwilson / git
Created May 8, 2011 21:39
ubuntu apache config for git virtual host - /etc/apache2/conf.d/git
<VirtualHost *:80>
ServerName git.server
ServerAdmin webmaster@git.server
DocumentRoot /usr/share/gitweb
<Directory /usr/share/gitweb>
Options FollowSymLinks ExecCGI
AddHandler cgi-script cgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f