Skip to content

Instantly share code, notes, and snippets.

View maxgalbu's full-sized avatar

Massimo Galbusera maxgalbu

  • hotelscan.com
  • Switzerland
View GitHub Profile

This tutorial assumes you know how vim works. Please google for it. If it turns out too hard for too many i'll write the commands to use it here. To get this to work, the easiest way was to install a debian chroot. This means you're basicly running a debian environment on your qnap.

The chroot setup tutorial is based on nemozny wonderful tutorial on http://forum.qnap.com/viewtopic.php?f=91&t=20174&p=223728 I had to modify some steps of this tutorial as this will be harmful to your qnap if you do it as listed there. This is due to /opt/ that is mounted on a 32 mb ramfs, and not your harddisk. You'll just run out of space, and ipkg's will mess up. So i copied the full tutorial here with the needed modifications:

I made a share called "Storage" on my harddrive. You could name it anything you want. Just modify the paths accordingly.

@interface NSObject (Debounce)
- (void)debounce:(SEL)action delay:(NSTimeInterval)delay;
@end
@maxgalbu
maxgalbu / Switch_Node.php
Last active December 31, 2019 16:03
Switch tag for Twig, updated from https://github.com/fabpot/Twig/pull/185 to work with Twig >= 1.12
<?php
//To be added under Twig/Node/Switch.php
/*
* This file is part of Twig.
*
* (c) 2009 Fabien Potencier
* (c) 2009 Armin Ronacher
*
@maxgalbu
maxgalbu / backup.python2.py
Last active August 16, 2020 10:05
Updated API version + Python 2 version of https://stackoverflow.com/a/34469893/2265500
import os
import errno
from subprocess import call
from gitlab import Gitlab
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
@maxgalbu
maxgalbu / monitor.php
Created January 28, 2014 14:40
Automatically monitor and email PHP error log content - See more at: http://www.jamescaws.com/notes/automatically-email-php-error-log-content/#sthash.Tqmac9Rw.dpuf
<?php
/**
* A script that can be called from cron to automatically email the content
* of a PHP error log file to a developer or webmaster.
*
* Author: James Caws
* Website: http://www.jamescaws.com
*
* It uses the freely available PHPMailer class available from