Skip to content

Instantly share code, notes, and snippets.

View cedriczirtacic's full-sized avatar
🐗
æ

cedric cedriczirtacic

🐗
æ
View GitHub Profile
@cedriczirtacic
cedriczirtacic / webmin_postgresql_backup_compress.patch
Created December 18, 2013 14:14
Patch for webmin's postgresql backup script to enable gzip/bzip2 compression.
--- postgresql/backup.pl.old 2013-12-17 14:50:06.000000000 -0300
+++ postgresql/backup.pl 2013-12-17 16:25:52.000000000 -0300
@@ -2,6 +2,7 @@
# backup.pl
# Called by cron to backup a database
+my $compress;
$no_acl_check++;
require './postgresql-lib.pl';
@cedriczirtacic
cedriczirtacic / gist:7459317
Created November 14, 2013 00:48
Quick way to get current battery status (tested on Fedora 18).
( cd /sys/class/power_supply/BAT1/ && perl -e "printf(\"%%%d\n\",(( "`cat charge_now`" / "`cat charge_full`" ) * 100));" )