Skip to content

Instantly share code, notes, and snippets.

@zuckercode
zuckercode / idsbs
Created September 7, 2012 11:57
install development server by script
#!/bin/bash
#
# These lines installing the complete software for a nginx - php5-fpm - mysql machine
# This script runs on:
# - Hetzner Root EX4 (Debian6 minimal installation)
# - Strato Root Server Linux Level 3 (v1209.1.42) Debian 6.0 64bit
# Installation:
# copy this lines to /root/install.sh
# if vim is not already installed
@zuckercode
zuckercode / issf
Created September 7, 2012 12:39
Debian squeeze init script in lsb style for spawn-fcgi
#! /bin/sh
### BEGIN INIT INFO
# Provides: spawn-fcgi
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
@zuckercode
zuckercode / phalcon_installer
Created September 12, 2012 11:12
phalcon installer
#!/bin/bash
read -p "do you want to install release or development version of phalcon? [default=release] " typeq
if [ "$typeq" == "" ]; then
TYPE="release"
else
TYPE=$typeq
fi
@zuckercode
zuckercode / gist:3714230
Created September 13, 2012 13:20
redmine installer
# add database 'redmine' and user 'redmine' to mysql
aptitude -y install ruby libruby libopenssl-ruby libpgsql-ruby rubygems apache2 libapache2-mod-passenger
aptitude -y install subversion
aptitude -y install install libmysql-ruby libmysqlclient-dev
aptitude install libpq-dev libsqlite3-dev libmagick9-dev graphicsmagick-libmagick-dev-compat
cd /var/www
svn co http://redmine.rubyforge.org/svn/branches/2.0-stable redmine
cd redmine
cp config/database.yml.example config/database.yml
vim config/database.yml
@zuckercode
zuckercode / gist:3720747
Created September 14, 2012 08:27
add new user with zsh as default shell
#!/bin/bash
read -p "please provide a name for a new user:" name
if [ "$name" == "" ]; then
echo "You did not entered a user name, so no user will be added."
exit;
fi
USER=$name
HOME=/home/$USER
@zuckercode
zuckercode / gist:3790075
Created September 26, 2012 19:35
webcyradm sql strcuture
# ************************************************************
# Sequel Pro SQL dump
# Version 3408
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.5.27-1~dotdeb.0)
# Datenbank: mail
# Erstellungsdauer: 2012-09-26 19:30:53 +0000
@zuckercode
zuckercode / gist:3794092
Created September 27, 2012 13:46
x largest files in all directories
du -hsx * | sort -rh | head -10
@zuckercode
zuckercode / install_opengeodb.sh
Created October 23, 2012 21:01
Installer for opengeodb
#!/bin/bash
# - INSTALL instructions:
# mkdir /your/preferred/path/opengeodb
# cd /your/preferred/path/opengeodb
# - copy this script to install_opengeodb.sh
# - make script executable:
# chmod +x install_opengeodb.sh
# - edit you mysql credentials
#
@zuckercode
zuckercode / gist:3942008
Created October 23, 2012 22:13
opengeodb Umkreissuche
/* http://opengeodb.org/wiki/OpenGeoDB_-_Umkreissuche */
/* create zip table */
CREATE TABLE `zip_coordinates` (
zc_id INT NOT NULL auto_increment PRIMARY KEY,
zc_loc_id INT NOT NULL ,
zc_zip VARCHAR( 10 ) NOT NULL ,
zc_location_name VARCHAR( 255 ) NOT NULL ,
zc_lat DOUBLE NOT NULL ,
zc_lon DOUBLE NOT NULL
@zuckercode
zuckercode / gist:3942110
Created October 23, 2012 22:26
opengeodb select
/* select one test zip */
SELECT zc_id, zc_location_name, zc_lat, zc_lon
FROM zip_coordinates
WHERE zc_zip = '13187';
/* calculate with the found data from above the zip in the radius < 20km */
SELECT
zc_zip,
zc_location_name,
ACOS(