This file contains hidden or 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
[program:redmine] | |
command = /usr/bin/ruby /path/to/redmine/script/fastcgi | |
process_name = redmine | |
autostart = true | |
startsecs = 40 | |
user = www-data | |
redirect_stderr = true | |
stdout_logfile = /var/log/redmine.log | |
environment = RAILS_ENV=production |
This file contains hidden or 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
int r; | |
int g; | |
int b; | |
if (point <= 128) // 1/8 | |
{ | |
r = 0; | |
g = 0; | |
b = 127 + point; // 0.5 ... 1 | |
} | |
else if (point <= 384) // 3/8 |
This file contains hidden or 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
import pytz | |
from datetime import datetime, timedelta | |
time_cet = datetime(2013,04,18, 6,0,0, tzinfo=pytz.utc) | |
for tz in pytz.all_timezones: | |
print tz.ljust(30), time_cet.astimezone(pytz.timezone(tz)).strftime('%Y %B %d, %H:%M') |
This file contains hidden or 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
root@rescue:~# mkdir --parent /dev/md | |
root@rescue:~# mdadm --assemble --scan --auto=yes --symlink=no | |
mdadm: /dev/md/le02:1 has been started with 1 drive (out of 2). | |
mdadm: /dev/md/le02:0 has been started with 1 drive (out of 2). | |
root@rescue:~# cat /proc/mdstat | |
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] [raid4] [multipath] [faulty] | |
md126 : active raid1 sdb1[1] | |
40957880 blocks super 1.2 [2/1] |
This file contains hidden or 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
#!/bin/bash | |
/usr/bin/varnishadm quit >/dev/null 2>&1 | |
RETVAL=$? | |
if [ $RETVAL -eq 2 ] | |
then | |
/etc/init.d/varnish restart | |
fi |
This file contains hidden or 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
v_bytes=`varnishstat -1 | grep s0.g_bytes | awk '{print $2}'` | |
v_space=`varnishstat -1 | grep s0.g_space | awk '{print $2}'` | |
v_total=$(( v_bytes + v_space )) | |
v_percent=$(( 100 * v_bytes / v_total )) | |
v_total_mb=$(( v_total/1024/1024 )) | |
v_bytes_mb=$(( v_bytes/1024/1024 )) | |
echo $v_percent % \($v_bytes_mb / $v_total_mb MB\) |
This file contains hidden or 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
# One-liner to detect Linux distro and version | |
cat /etc/issue;uname -a;if [ -f /etc/lsb-release ]; then echo "Ubuntu"; cat /etc/lsb-release; fi;if [ -f /etc/debian_version ]; then echo "Debian"; cat /etc/debian_version; fi;if [ -f /etc/redhat-release ]; then echo "RHEL"; cat /etc/redhat-release; fi;if [ -f /etc/SuSE-release ]; then echo "SuSE"; cat /etc/SuSE-release; fi; | |
# One-liner to detect Linux distro and version |
This file contains hidden or 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
# cd /your/joomla/directory | |
if [ -f includes/version.php ]; then echo 1.0 DETECTED; grep var\ \$RELEASE includes/version.php; grep var\ \$DEV_LEVEL includes/version.php; fi; if [ -f libraries/joomla/version.php ]; then echo 1.5 DETECTED; grep var\ \$RELEASE libraries/joomla/version.php; grep var\ \$DEV_LEVEL libraries/joomla/version.php; fi; if [ -f joomla.xml ]; then echo 2.5+ DETECTED; grep \<version\> joomla.xml; fi; if [ -f libraries/cms/version/version.php ]; then echo 2.5+ DETECTED; grep public\ \$RELEASE libraries/cms/version/version.php; grep public\ \$DEV_LEVEL libraries/cms/version/version.php; fi; | |
# One-liner to detect Joomla version |
This file contains hidden or 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
{ | |
"bankier.pl": { | |
"type": "xpath", | |
"xpath": "div[@id='article_body']" | |
}, | |
"makowskimarcin.pl": { | |
"type": "xpath", | |
"xpath": "div[@class='entry-content post_content']" | |
}, | |
"niebezipecznik.pl": { |
This file contains hidden or 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
[master] gdr@gdr-desktop:~/Downloads/optipng-zopfli$ cat src/zopfli/makefile | |
make: | |
gcc *.c -O2 -W -Wall -Wextra -ansi -pedantic -lm -o zopfli | |
debug: | |
gcc *.c -g3 -lm -o zopfli | |
CFLAGS = -O2 -W -Wall -Wextra -ansi -pedantic -lm |