Skip to content

Instantly share code, notes, and snippets.

View EugenMayer's full-sized avatar
🏠
Working from home

Eugen Mayer EugenMayer

🏠
Working from home
View GitHub Profile
$vc = $tag['original'];
drush_op('drush_shell_exec', "git --git-dir={$this->path}/.git --work-tree={$this->path} checkout refs/tags/{$vc}");
drush_op('drush_shell_exec', "git --git-dir={$this->path}/.git --work-tree={$this->path} log -1 --pretty=format:'%%d' {$vc}");
$info = drush_shell_exec_output();
drush_print_r($info);
$this->FserverProject->write_package_info($tag, array('.git'));
$path = $this->path;
if (!empty($this->FserverProject->repo_subdir)) {
$path .= '/' . $this->FserverProject->repo_subdir;
}
/**
* Write packaging information for a release.
*/
function write_package_info($tag, $exclude_mask = array('.', '..', 'CVS')) {
if (isset($this->backend)) {
$fserver_url = url("fserver", array('purl' => array('disabled' => TRUE), 'absolute' => TRUE));
$packaging = array();
$packaging[] = "; Information added by fserver";
$packaging[] = "core = \"{$tag['core']}\"";
define service{
use generic-service
host_name pluto.proxmox.lan
service_description check_linux_raid
check_command check_nrpe_1arg!check_linux_raid
}
define command {
command_name check_dummy
command_line /usr/lib/nagios/plugins/check_dummy 0
}
define service{
use generic-service
hostgroup_name remote-hosts
service_description Chef client run status
check_command check_dummy
function calculateTextBox($text, $fontFile, $fontSize, $fontAngle) {
$boundingbox = imageTTFBbox($fontSize, $fontAngle, $fontFile, $text);
$minX = min(array($boundingbox[0], $boundingbox[2], $boundingbox[4], $boundingbox[6]));
$maxX = max(array($boundingbox[0], $boundingbox[2], $boundingbox[4], $boundingbox[6]));
$minY = min(array($boundingbox[1], $boundingbox[3], $boundingbox[5], $boundingbox[7]));
$maxY = max(array($boundingbox[1], $boundingbox[3], $boundingbox[5], $boundingbox[7]));
return array(
"left" => abs($minX) - 1,
@EugenMayer
EugenMayer / Dockerfile
Created July 11, 2016 05:37
eugenmayer/rsync
FROM debian:jessie
MAINTAINER Eugen Mayer <eugen.mayer@kontextwork.de>
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends rsync && \
apt-get clean autoclean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
EXPOSE 873
@EugenMayer
EugenMayer / segfault
Created July 11, 2016 09:58
valgrind --leak-check=full --leak-check=full --show-leak-kinds=all /usr/bin/php7.0 -S localhost:8085
==87== HEAP SUMMARY:
==87== in use at exit: 26,038 bytes in 1,015 blocks
==87== total heap usage: 14,587 allocs, 13,572 frees, 1,524,818 bytes allocated
==87==
==87== 5 bytes in 1 blocks are still reachable in loss record 1 of 34
==87== at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==87== by 0x5A84E88: xmlStrndup (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.1)
==87== by 0x5A0C6A3: xmlNewCharEncodingHandler (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.1)
==87== by 0x5A150B4: ??? (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.1)
==87== by 0x21C538: php_libxml_initialize (in /usr/bin/php7.0)
$aliases['drupalwiki'] = array(
'parent' => '@parent',
'site' => 'drupalwiki',
'root' => '/var/www',
'uri' => 'drupalwiki.dev',
);
def wait_for_db(ip, port)
$stdout.sync = true
begin
puts 'Waiting for consul...'
Timeout::timeout(50) do
print '.'
begin
s = TCPSocket.new(ip, port)
s.close
version: '2'
services:
web:
volumes_from:
- container:filesync:ro # started externally
volumes:
filesync:
external: true