Skip to content

Instantly share code, notes, and snippets.

View h4cc's full-sized avatar

Julius Beckmann h4cc

  • ZENNER IoT Solutions
  • Hamburg, Germany
View GitHub Profile
mkdir scrutinizer && cd scrutinizer
# Install tools
# - Scrutinizer and composer
wget http://scrutinizer-ci.com/scrutinizer.phar
curl -sS https://getcomposer.org/installer | php
# - All needed CI tools
php composer.phar require h4cc/phpqatools:~1.2
cp -p composer.phar vendor/bin/composer
@h4cc
h4cc / ubuntu_13.10_apache2.4_hints.txt
Last active December 26, 2015 10:29
Ubuntu 13.10 with Apache 2.4 upgrade hints.
Apache2 Version 2.4 has two slight changes.
1. NameVirtualHost * is deprecated
-> Simply remove it.
2. Files sites-enabled have to end with '.conf'
in '/etc/apache2/apache2.conf' is now:
---
@h4cc
h4cc / foo.php
Created October 25, 2013 07:05
Test
<?php
echo "43";
@h4cc
h4cc / new_vhost
Created October 25, 2013 12:04
Script for creating a new Apache2 VHost and MySQL User + Database.
#!/usr/bin/php
<?php
/**
* Script for creating a new Apache2 VHost and MySQL User + Database.
*
* @author Julius Beckmann ([email protected])
*/
if(6 != count($argv)) {
echo "--- New Vhost ---
#!/usr/bin/env php
<?php
function wsse_header($username, $password) {
// Needed to change hashing, so not nounces with '/' inside will not be generated.
$nonce = sha1(uniqid(null, true) . uniqid());
$created = new DateTime('now', new DateTimezone('UTC'));
$created = $created->format(DateTime::ISO8601);
$digest = sha1($nonce.$created.$password, true);
@h4cc
h4cc / rsyslog_openvz_fix.sh
Created November 5, 2013 21:54
Using rsyslog on OpenVZ like Proxmox can lead to a problem, which symtoms are mostly >= 100% CPU usage of rsyslogd. Error message is "Cannot read proc file system: 1 - Operation not permitted.", because the file /proc/kmsg could not be read.
sed -i -e 's/^\$ModLoad imklog/#\$ModLoad imklog/g' /etc/rsyslog.conf
service rsyslog restart
# Source: https://github.com/devananda/openvz-tools/blob/master/install-openvz-kernel.sh
@h4cc
h4cc / developer-conference-hamburg-2013-notizen.md
Last active December 28, 2015 00:09
Notizen von der Developer Conference Hamburg 2013. http://www.developer-conference.eu/programm/
@h4cc
h4cc / server_monitoring
Created November 11, 2013 20:53
/etc/cron.d/server_monitoring apt-get -y install smartmontools
# Cronjob for poor man monitoring of server health
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Every sunday, check for apt-get upgrades.
33 3 * * 0 root apt-get update ; apt-get -q --simulate upgrade
# Every sunday, check for SMART errors.
34 3 * * 0 root echo 'SMART Sectors'; smartctl -a /dev/sda | grep -i sector ; smartctl -a /dev/sdb | grep -i sector; echo 'SMART All'; smartctl -a /dev/sda ; smartctl -a /dev/sdb
@h4cc
h4cc / ideas.md
Last active December 28, 2015 20:59
Ideas for stuff to do.

Ideas for stuff to do.

Console Process

A component that can run a symfony2 console command with easy from inside a symfony2 application.

@h4cc
h4cc / satis_github_auth.sh
Created November 27, 2013 17:50
Some notes on how to authenticate with composer/satis against github oauth, so the rate limit of 60 will be raised op to 5000. Can also be used for travis-ci.
# Create a new Token
curl -u 'githubuser' -d '{"note":"Your Application"}' https://api.github.com/authorizations
# It is: "ebab4dc37e654bb230a9c69ebcd5f38e9a81e210"
#{
# "created_at": "2013-01-04T18:00:28Z",
# "app": {
# "url": "http://developer.github.com/v3/oauth/#oauth-authorizations-api",