mafflog
random stuff for teh interwebs
  • About
  • Projects
  • Archives
Home » bash

gitosis-create-repo

March 22, 2009 · in Development, Server

A simple script to create a new gitosis-repository on the fly. I’m not really familiar with bash scripting so don’t expect too much ;)

#!/bin/bash
if [ -z $1 ]; then
    echo "Please specify a repository."
    exit 1
fi

if [ -z $2 ]; then
    echo "Please specify a remote url."
    exit 1
fi

if [ -d $1 ]; then
    echo "Repository already exists."
    exit 1
fi

mkdir $1
cd $1
git init
touch .gitignore
git add .gitignore
git commit -a -m "Initial commit."
git remote add origin $2:$1.git
git push origin master:refs/heads/master

Please make sure you set the correct permissions in gitosis.conf. Example:

[group me]
members = me@example.com
writable = test</pre>

Then you can run the script to create a new repository test on myhost.example.org:

$ gitosis-create-repo test git@myhost.example.org
Use PuTTY as Cygwin terminal

Use PuTTY as Cygwin terminal

September 29, 2008 · in Development, How-Tos

“Cygwin is a Linux-like environment for Windows.” This means, you can use linux/unix commandline tools like ls, grep and find on your Windows system. However, the default installation of Cygwin uses Windows’ default commandline terminal cmd.exe, which is not really handy. Fortunately, there’s a solution to use PuTTY as Cygwin terminal.

  1. Download and install Cygwin. The setup will download all needed packages, so make sure you check what you need (my main reason to install Cygwin was to have a Git client on Windows)
  2. Download PuTTYcyg and extract the contents of the archive anywhere on you hard drive
  3. Start putty.exe, select Cygterm as connection type and enter - (dash) as command. Enter a session name (e.g. cygwin) in the text field below Saved Sessions and click on Save.
  4. Create a shortcut to putty.exe. Right click the shortcut, select Properties and append the following string to the target field: -load "cygwin". Of course you have to replace cygwin with the name of the session you saved in PuTTYcyg.
  5. Open the shortcut and you should directly get into your Cygwin shell

Nützliche bash-Tastaturkürzel

July 7, 2008 · in Linux

Einige nützliche bash-Tastaturkürzel:

Kürzel Beschreibung
ALT+B, ALT+F Cursor ein Wort zurück / weiter bewegen
CTRL+A, CTRL+E Cursor an den Anfang / Ende der Zeile setzen
CTRL+K Bis zum Ende der Zeile löschen
CTRL+T Die vorigen beiden Zeichen vertauschen
ALT+T Die vorigen beiden Wörter vertauschen
CTRL+L Bildschirm löschen
CTRL+R, CTRL+S Nach vorher eingegebenen Kommandos suchen
github github github

Search

Categories

  • Android
  • Development
  • Fun
  • General
  • Hardware
  • How-Tos
  • Kitchen
  • Linux
  • No Comment
  • Projects
  • Server
  • Snippets
  • Software
  • Video
  • Web
  • Windows
  • Wordpress

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Copyright © 2008-2013 mafflog