Skip to content

Instantly share code, notes, and snippets.

View tsertkov's full-sized avatar
🖐️
Say Hello

Aleks Tsertkov tsertkov

🖐️
Say Hello
View GitHub Profile
@tsertkov
tsertkov / apache-fisheye.conf
Last active December 22, 2015 14:49
SVN mailer.py configuration for sending easy filterable on-commit emails with link to revision diff in fisheye.
<VirtualHost *:80>
ServerName fisheye.dev.example.com
# redirection of websvn urls generated by svnmailer
RewriteEngine On
RewriteCond %{QUERY_STRING} sc=[0-9]+&rev=([0-9]+)
RewriteRule ^/([^/]+)/websvn/$ http://%{SERVER_NAME}/changelog/$1/?cs=%1 [R,L]
# proxy to fisheye port
ProxyPass / http://fisheye.dev.example.com:8060/
@tsertkov
tsertkov / apache-svn.conf
Last active December 22, 2015 14:49
Apache virtualhost configuration for svn over webdav server. Works with system users via pwauth and virtual ones using htpasswd file.
<VirtualHost *:80>
ServerName svn.example.com
RewriteEngine on
RewriteRule (.*) https://svn.example.com$1 [R=301,L]
</VirtualHost>
<VirtualHost *:443>
ServerName svn.example.com
Include example-ssl.conf
@tsertkov
tsertkov / daemontools-run-apache.sh
Last active December 22, 2015 15:39
Daemontools (http://cr.yp.to/daemontools.html) run script for starting apache. Service directory basename is passed to apache via -D command line option and can be checked with <IfDefine>. For example for the script located at "/etc/service/php55/run" "php55" is defined with -D.
#!/bin/bash
SNAME=${PWD%/*}
SNAME=${SNAME##*/}
exec 2>&1
exec \
env -i PATH=/bin:/usr/bin PHPRC=/opt/apache-dev/servers/$SNAME \
setuidgid www-dev \
/opt/apache-dev/bin/httpd -D FOREGROUND -D $SNAME
@tsertkov
tsertkov / daemontools-run-fecru.sh
Created September 9, 2013 11:35
Daemontools (http://cr.yp.to/daemontools.html) run script for starting Atlassian Fisheye+Crucible.
#!/bin/sh
exec 2>&1
exec env -i FISHEYE_INST=/opt/fecru-inst setuidgid www-data /opt/fecru/bin/run.sh
@tsertkov
tsertkov / apache-ssl-example.com.conf
Created September 9, 2013 11:43
Apache partial configuration script included from VirtualHosts to decouple and reuse ssl configuration.
SSLEngine on
SSLCertificateFile /etc/ssl/example.com.pem
<FilesMatch "\.(phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
@tsertkov
tsertkov / apache-extfilter.conf
Created September 9, 2013 12:19
Example of using Apache mod_ext_filter to replacing urls in proxied data (phpundercontrol).
<VirtualHost *:80>
ServerName phpuc.dev.example.com
# NB! It must be slow :-)
ExtFilterDefine fixurls mode=output intype=text/html \
cmd="/bin/sed \
-e s/http:\\/\\/localhost:/http:\\/\\/phpuc.dev.example.com:/g \
-e s/\\/phpundercontrol\\//\\//g \
-e s/\\/cruisecontrol\\/artifacts\\//\\/artifacts\\//g \
-e s/\\/cruisecontrol\\/logs\\//\\/logs\\//g \
@tsertkov
tsertkov / my-configure-apache.sh
Last active December 22, 2015 15:49
Script for executing "configure" from apache source directory with predefined configuration and compiler options.
export CHOST="x86_64-pc-linux-gnu"
export CFLAGS="-O2 -march=native -pipe"
export CXXFLAGS="${CFLAGS}"
./configure \
--prefix=/opt/apache-dev \
--disable-filter \
--disable-version \
--disable-asis \
--disable-negotiation \
--disable-actions \
@tsertkov
tsertkov / my-configure-php.sh
Created September 9, 2013 12:43
Script for executing "configure" from php source directory with predefined configuration and compiler options.
export CHOST="x86_64-pc-linux-gnu"
export CFLAGS="-O2 -march=native -pipe"
export CXXFLAGS="${CFLAGS}"
./configure \
--prefix=/opt/${PWD##/*/} \
--with-apxs2=/opt/apache-dev/bin/apxs \
--disable-cgi \
--with-openssl \
--with-zlib \
--enable-bcmath \
@tsertkov
tsertkov / apache-account-macro.conf
Created September 9, 2013 12:55
Apache developer folder configuration with mod_macro.
<Macro Account $name>
<Directory "/home/$name/vhosts/">
php_admin_value open_basedir "/home/$name/:/usr/share/php/:/tmp/:/usr/bin/"
php_value error_log "/home/$name/vhosts/php_error.log"
php_value include_path ".:/usr/share/php"
php_flag log_errors On
php_flag short_open_tag On
</Directory>
</Macro>
@tsertkov
tsertkov / rules-unix-philosophy.md
Created September 9, 2013 15:38
Unix Philosophy Rules

Unix Philosophy Rules

  • Write simple parts connected by clean interfaces. (Modularity)
  • Clarity is better than cleverness. (Clarity)
  • Design programs to be connected to other programs. (Composition)
  • Separate policy from mechanism; separate interfaces from engines. (Separation)
  • Design for simplicity; add complexity only where you must. (Simplicity)
  • Write a big program only when it is clear by demonstration that nothing else will do. (Parsimony)
  • Design for visibility to make inspection and debugging easier. (Transparency)