Skip to content

Instantly share code, notes, and snippets.

$ cd
$ git clone http://github.com/senchalabs/connect.git
$ cd connect/
$ sudo make install
cp -f docs/index.1 /usr/local/share/man/man1/connect.1
cp: cannot create regular file `/usr/local/share/man/man1/connect.1': No such file or directory
make: *** [install-docs] Error 1
$ sudo mkdir -p /usr/local/share/man/man1/
$ sudo make install
cp -f docs/index.1 /usr/local/share/man/man1/connect.1
#!/bin/bash
echo testing write performance
sync; date; time dd if=/dev/zero of=1000m bs=1024k count=5000; date
echo testing read performance
sync; date; time dd if=1000m of=/dev/null bs=1024k; date
rm 1000m
@miebach
miebach / tree
Created March 31, 2011 14:04
Unix Tree / Linux Tree by Dem Pilafian - http://www.centerkey.com/tree/
#!/bin/sh
# Unix Tree / Linux Tree by Dem Pilafian
# http://www.centerkey.com/tree/
# mirrored on https://gist.github.com/896397
#######################################################
# UNIX TREE #
# Version: 2.3 #
# File: ~/apps/tree/tree.sh #
# #
# Displays Structure of Directory Hierarchy #
@micrypt
micrypt / gist:1048924
Created June 27, 2011 14:10
Riak Quick Start from GitHub
# Install Erlang
$ sudo apt-get install autoconf
$ curl -O https://raw.github.com/dreverri/kerl/master/kerl; chmod a+x kerl
$ ./kerl build R14B03 r14b03
$ ./kerl install r14b03 /opt/erlang/r14b03
$ . ~/.kerl/installs/r14b03/activate
# Build Riak from source
$ git clone git://github.com/basho/riak.git
$ cd riak
@miebach
miebach / README
Created July 2, 2011 06:49
"cygwin here" registry patch, CygwinHere0.1.3 see http://software.ellerton.net/cygwin/
Note: Use the first reg-file if the cygwin dir is c:\ and the other on if cygwin is installed to c:\cygwin\ - otherwise adjust the path in the file.
See also https://gist.github.com/1641943 for unattended cygwin update and package install
----
README
NAME:
Cygwin Here
@miebach
miebach / print_environ.py
Created July 2, 2011 13:26
Print the environment array in python
import os
for param in os.environ.keys():
print "%20s %s" % (param,os.environ[param])
# from http://www.wellho.net/resources/ex.php4?item=y115/penv.py
@miebach
miebach / dos2unix_using_tr.sh
Created July 11, 2011 12:07
Convert a DOS text-file to unix by removing cr and ^Z characters
#!/bin/sh
# remove cr and ^Z characters from a dos file:
# the codes are octal, oct15 = dec13 and oct32 = dec26
tr -d '\15\32' < winfile.txt > unixfile.txt
@miebach
miebach / create-ram-disk.sh
Created July 12, 2011 01:14
Create a ramdisk in linux on th fly
#!/bin/sh
mkdir -p /tmp/ramdisk
sudo mount -t tmpfs -o size=512M tmpfs /tmp/ramdisk
#sudo mount -t tmpfs -o size=1G tmpfs /tmp/ramdisk
@miebach
miebach / gist:1083152
Created July 14, 2011 18:58
Show only relevant lines in linux config files
cat some.conf | sed 's/^[ \t]*//' |grep -v ^# | sed '/^$/d'
# as result all non-blank lines from some.conf that do not start with a "#" (which means this only a comment line) are printed to the terminal
# in short: show the lines that contain something relevant
# the first sed removes trailing spaces from all lines
# the grep removes all lines that start with a "#"
# the second sed removes all blank lines
@miebach
miebach / mysql_test_db_connection.php
Created October 7, 2011 11:45
Testing MySQL connection and select DB with PHP
<?php
echo "Connecting to MySQL Server ... ";
mysql_connect(
"localhost",
"admin",
"pass123")
or die(mysql_error());
echo "[OK]<br />";