Chronological list of the "systemd for Administrators" series published on 0pointer.net/blog:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream backend { | |
server localhost:8080; | |
#server backup1.example.com:8080 backup; | |
#server backup2.example.com:8080 backup; | |
} | |
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=one:10m; | |
# Set cache key to include identifying components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .config/i3/config | |
set $mod Mod4 | |
set $alt Mod1 | |
font pango:Segoe UI 8 | |
# Use Mouse+$mod to drag floating windows to their wanted position | |
floating_modifier $mod | |
## Solarized colorshema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<project name="Ant Condition Example"> | |
<target name="myConditionalTask" depends="myConditionalTask-check, myConditionalTask-fail" if="myConditionalTask-check-property"> | |
<echo message="EXECUTE myConditionalTask" /> | |
</target> | |
<target name="myConditionalTask-fail" unless="myConditionalTask-check-property"> | |
<echo message="SKIPPED myConditionalTask" /> | |
</target> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir source | |
cd source | |
wget http://museum.php.net/php5/php-5.2.17.tar.gz | |
tar xvf php-5.2.17.tar.gz | |
cd php-5.2.17 | |
./configure --disable-all --enable-static --enable-cli | |
make | |
cp sapi/cli/php ~/bin/php5.2.17-x64-static |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## See: https://serverfault.com/a/915845/17736 | |
FROM percona/percona-server:5.7 as builder | |
USER root | |
RUN mkdir -p /initialized-db && chown -R mysql:mysql /initialized-db | |
# That file does the DB initialization but also runs mysql daemon, by removing the last line it will only init | |
RUN ["sed", "-i", "s/exec \"$@\"/echo \"not running $@\"/", "/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class BaseTestCase extends PHPUnit\Framework\TestCase | |
{ | |
/** | |
* Reset the properties to save memory after each test. | |
* @see https://kriswallsmith.net/post/18029585104/faster-phpunit | |
*/ | |
protected function tearDown(): void | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// see https://confluence.jetbrains.com/display/PhpStorm/PhpStorm+Advanced+Metadata | |
namespace PHPSTORM_META { | |
override(\Doctrine\ORM\EntityManager::find(0), map([ | |
'' => '@', | |
])); | |
override(\Interop\Container\ContainerInterface::get(0), map([ | |
'' => '@', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
## extract once using https://github.com/inAudible-NG/audible-activator | |
activationBytes="" | |
for m in *.aax; do | |
basename=${m%.aax} | |
# extract audio stream | |
ffmpeg -activation_bytes $activationBytes -i ${basename}.aax -vn -c:a copy ${basename}.m4a | |
# extract thumbnail | |
ffmpeg -activation_bytes $activationBytes -i ${basename}.aax -an -vcodec copy ${basename}.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://pecl.php.net/package/APCu | |
# http://pecl.php.net/package/ZendOpcache | |
# Install ZendOpcache | |
sudo pecl install ZendOpcache-beta | |
sudo -i | |
cat > /etc/php5/mods-available/opcache.ini << EOF | |
zend_extension=/usr/lib/php5/20100525/opcache.so | |
opcache.memory_consumption=128 | |
opcache.interned_strings_buffer=8 |
NewerOlder