Skip to content

Instantly share code, notes, and snippets.

View otype's full-sized avatar

Hans-Gunther Schmidt otype

View GitHub Profile
@otype
otype / aws-instances.py
Last active September 2, 2016 09:02
Python wrapper generating table of EC2 instances
#!/usr/bin/env python
#
# aws-instances.py
#
# A simple Python script that wraps the AWS CLI (https://aws.amazon.com/cli/)
# and generates a table view of instantiated EC2 instances running on AWS.
#
import json
import subprocess
import sys
@otype
otype / christmas.zsh
Created June 19, 2012 22:31
Christmas Tree in zsh
#!/bin/zsh
#
# Creating a nice christmas tree in zsh
#
# 1. Save this file as christmas.zsh
# 2. $ chmod +x christmas.zsh
# 3. ./christmas.zsh 10
#
COUNT=$1
@otype
otype / mysqld-example.php
Created February 1, 2012 12:49
MYSQLD Example for reading out credentials
<?php
/**
*
* Every deployment gets different credentials for each Add-on. Providers
* can change these credentials at any time. It is therefore required to read
* the credentials from the provided JSON file to keep the application running
* in case the credentials change.
*
* The path to the JSON file can be found in the CRED_FILE environment variable.
@otype
otype / wp-config-mysql-dedicated.php
Created February 1, 2012 12:46
Wordpress wp-config.php example for reading out credentials on cloudControl platform (MySQL Dedicated)
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
hgschmidt@mail:~$ ps aux | grep php
root 14259 0.0 0.7 95100 3712 ? Ss 00:07 0:00 /opt/php-fpm/bin/php-fpm --fpm-config /etc/php-fpm.conf
www-data 14260 0.0 5.4 121940 28800 ? S 00:07 0:03 /opt/php-fpm/bin/php-fpm --fpm-config /etc/php-fpm.conf
www-data 14261 0.0 5.2 121008 27520 ? S 00:07 0:03 /opt/php-fpm/bin/php-fpm --fpm-config /etc/php-fpm.conf
www-data 14262 0.0 5.4 121936 28736 ? S 00:07 0:03 /opt/php-fpm/bin/php-fpm --fpm-config /etc/php-fpm.conf
www-data 14263 0.0 5.9 124936 31108 ? S 00:07 0:03 /opt/php-fpm/bin/php-fpm --fpm-config /etc/php-fpm.conf
www-data 14264 0.0 5.3 124940 27896 ? S 00:07 0:03 /opt/php-fpm/bin/php-fpm --fpm-config /etc/php-fpm.conf
1000 14992 0.0 0.1 3872 604 pts/0 R+ 15:24 0:00 grep --color=auto php
hgschmidt@mail:~$
<value name="listen_options">
Set listen(2) backlog
<value name="backlog">-1</value>
Set permissions for unix socket, if one used.
In Linux read/write permissions must be set in order to allow connections from web server.
Many BSD-derrived systems allow connections regardless of permissions.
- <value name="owner">nobody</value>
+ <value name="owner"></value>
export LE_VER=1.4.12-stable
wget "http://www.monkey.org/~provos/libevent-$LE_VER.tar.gz"
tar -zxvf "libevent-$LE_VER.tar.gz"
cd "libevent-$LE_VER"
./configure --prefix=/opt/php-fpm && make
make install
export LIBEVENT_SEARCH_PATH="/opt/php-fpm"
export PHP_VER=5.3.1
wget "http://launchpad.net/php-fpm/master/0.6/+download/php-fpm-0.6~$PHP_VER.tar.gz"
$ update-projects v.0.2
Usage: update-projects [OPTIONS]
Options:
-d, --projectdir Location of repositories
-h, --help Print out this help menu
-v, --version Print out version
Information:
#!/bin/bash
#
# GLOBALS
#
FILENAME=""
TOOLNAME="`basename $0`"
VERSION="0.1"
USE_BIB=0
|:. bash build/host-setup.sh
Detecting host toolchain.
CC : compiler check ok (gcc)
LD : linker check ok (gcc)
CXX : C++ compiler check ok (g++)
Generate : out/host/config.mk
Toolchain : Checking for arm-eabi-4.2.1 prebuilt binaries
Host setup complete. Please read docs/OVERVIEW.TXT if you don't know what to do.