Skip to content

Instantly share code, notes, and snippets.

@AlD
AlD / Blogger.pm
Created September 29, 2010 20:31 — forked from vispillo/test2.pl
package WebService::Blogger;
use warnings;
use strict;
use Moose;
use LWP::UserAgent;
use HTTP::Request::Common;
use XML::Simple;
use File::stat;
Nov 21 10:25:00 test-8 kernel: [2826834.365586] no space left, need 4096, 8192 delalloc bytes, 70447325184 bytes_used, 0 bytes_reserved, 0 bytes_pinned, 0 bytes_readonly, 0 may use 70447333376 total
Nov 21 10:25:38 test-8 kernel: [2826873.187640] no space left, need 4096, 8192 delalloc bytes, 70447325184 bytes_used, 0 bytes_reserved, 0 bytes_pinned, 0 bytes_readonly, 0 may use 70447333376 total
Nov 21 10:27:13 test-8 kernel: [2826921.953237] no space left, need 4096, 8192 delalloc bytes, 70447325184 bytes_used, 0 bytes_reserved, 0 bytes_pinned, 0 bytes_readonly, 0 may use 70447333376 total
Nov 21 10:27:45 test-8 kernel: [2826955.606982] no space left, need 4096, 8192 delalloc bytes, 7044732510 bytes_reserved, 0 bytes_pinned, 0 bytes_readonly, 0 may use 70447333376 total
Nov 21 10:29:01 test-8 kernel: [2827000.405176] no space left, need 4096, 8192 delalloc bytes, 70447325184 bytes_used, 0 bytes_reserved, 0 bytes_pinned, 0 bytes_readonly, 0 may use 70447333376 total
Nov 21 10:30:11 test-8 kernel: [2827061.0764
@AlD
AlD / heat.sh
Created December 29, 2011 15:31
;-)
#!/bin/bash
# target temperature
ttemp=22
# heating slope
slope=5
############################################
WATCHPATH=/watch/this
IFS=$'\t'
/usr/bin/inotifywait -mrqe create -e moved_to --format "%w${IFS}%e${IFS}%f" $WATCHPATH |
while read BASEPATH ACTIONS OBJECTPATH; do
case "$ACTIONS" in
*ISDIR*)
echo $BASEPATH $ACTIONS $OBJECTPATH
;;
esac
$r->add_shortcut(resource => sub {
my ($r, $name) = @_;
# Generate "/$name" route
my $resource = $r->route("/$name/:action")->to("$name#");
# POST /foo/bar -> {controller => 'foo', action => 'bar'}
$resource->post->to();
# GET /foo/bar -> {controller => 'foo', action => 'bar_form'}
@AlD
AlD / reset_changed_hostkeys.sh
Created January 20, 2012 10:59
NeDi - remove changed hostkeys from known_hosts
#!/bin/sh
mysql nedi --column-names=false -Be '
SELECT INET_NTOA(d.ip)
FROM messages m
JOIN devices d
ON m.source = d.name
WHERE m.time > UNIX_TIMESTAMP() - 86400
AND m.info LIKE "%hostkey changed%";
' | (
$ tx push -t
Pushing translations for resource quassel.master:
Pushing 'el' translations (file: po/el.po)
Pushing 'fr' translations (file: po/fr.po)
Pushing 'pt_BR' translations (file: po/pt_BR.po)
Pushing 'tr' translations (file: po/tr.po)
Skipping 'de' translation (file: po/de.po).
Pushing 'it' translations (file: po/it.po)
Pushing 'hu' translations (file: po/hu.po)
Pushing 'ja' translations (file: po/ja.po)
$ /usr/bin/lconvert -i cs.po -of ts -o /usr/src/quassel-build/po/cs.ts; echo $?
0
$ /usr/bin/lconvert -i ./cs.po -of ts -o /usr/src/quassel-build/po/cs.ts; echo $?
Removed plural forms as the target language has less forms.
If this sounds wrong, possibly the target language is not set or recognized.
0
$ /usr/bin/lconvert -i $PWD/cs.po -of ts -o /usr/src/quassel-build/po/cs.ts; echo $?
Removed plural forms as the target language has less forms.
$ git reset --hard; echo ===; git diff; echo ===; tx pull -l de -f; echo ===; git diff
HEAD is now at c83924a fix plurals in some translations and a typo in ChannelListDlg
===
===
Pulling translations for resource quassel.master (source: po/quassel.pot)
-> de: po/de.po
Done.
===
diff --git a/po/de.po b/po/de.po
index a1024a0..2614b51 100644
// ==UserScript==
// @match https://*/sgdadmin/*
// ==/UserScript==
var a = document.all;
for (var i = 0; i < a.length; i++) {
var e = a[i];
if(e.id.match("Form:")) {
e.hidden = false;
}