Skip to content

Instantly share code, notes, and snippets.

View nikiink's full-sized avatar

Nicola Inchingolo nikiink

  • Andria, BT, Italy
View GitHub Profile
@nikiink
nikiink / lgmemo2enex.php
Last active August 29, 2015 14:22
Export Enex file to be imported in Evernote from LG Memo db file richnote
<?php
# The lg memo db file richnote is at this location:
# /storage/sdcard0/Memo/backup.nrt
# this file is created after making a backup and this is a zip file,
# the file richnote is inside the zip
# see:
# https://nikiink.wordpress.com/2015/05/28/evernote-importing-from-lg-memo-and-from-colornote/
#
$db = new SQLite3("richnote");
@nikiink
nikiink / colornote2enex.php
Last active February 11, 2024 18:57
Export Enex file to be imported in Evernote from ColorNote db file colornote.db
<?php
# The file colornote.db is at this location:
# /data/data/com.socialnmobile.dictapps.notepad.color.note/databases/colornote.db
# this path is visible if your device is rooted and viewing as root with ES File Explorer for example
# see:
# https://nikiink.wordpress.com/2015/05/28/evernote-importing-from-lg-memo-and-from-colornote/
#
$db = new SQLite3("colornote.db");
$query = "SELECT * FROM notes";
<?php
function waitUntilPortIsListening($host, $port, $options = array('usleep' => 300000, 'limit' => 20)) {
$limit = array_key_exists('limit',$options)?$options['limit']:20;
$retries = 0;
while (true) {
$connection = @fsockopen($host, $port);
if (is_resource($connection)) {
echo "is listening\n";
@nikiink
nikiink / UpsmonActionsScheduler.php
Last active August 29, 2015 14:22
Upsmon actions scheduler by eventlog. Start scheduled tasks based on the events logged on the eventlog file by Upsmon.
<?php
/*
PHPTail class from:
https://github.com/taktos/php-tail
https://code.google.com/p/php-tail/
*/
class PHPTail {
/**
* Location of the log file we're tailing
* @var string
/*
Il server sia in grado di gestire un metodo get condizionale
sulla base dell'ultima data di modifica della risorsa.
Se la richiesta condizionale va a buon fine l'header
della risposta deve contenere almeno i campi Date, Content-Length
e Last-Modified correttamente determinati.
Altrimenti il corpo della risposta sara' vuoto e l'header
della risposta dovra' contenere soltanto Date e Last-Modified
Il server sara' in grado di gestire i seguenti casi
@nikiink
nikiink / readfile.js
Last active April 14, 2016 09:26
Sitecom WL-153 v1 002 administration interface chrome support
/*
==============================================================
Created by Xploïse: www.xploise.nl
for Sitecom Europe: www.sitecom.com
==============================================================
*/
// ADDING THE NEXT ROW THE ADMIN INTERFACE WORKS ON CHROME
// Replace the readfile.js with this readfile.js. It can be done
// using the chrome extension Requestly. Add a redirect request rule
@nikiink
nikiink / WUA_SearchDownloadInstall.bat
Last active July 14, 2016 07:26
With this system you can automatically download windows updates, install them and reboot, and repeat these steps until no other updates are needed. Copy these files in the folder C:\WUA and import the task in scheduler.
cscript "C:\WUA\WUA_SearchDownloadInstall.vbs" >> "C:\WUA\WUA-log.txt" 2>&1
#INSERIRE MAIL E PASSWORD ###################
mail = "........@......it"
password = "........"
#############################################
server = "mail.it.net"
cartella_spam = "Posta indesiderata"
import imaplib, sys
M = imaplib.IMAP4(server)
@nikiink
nikiink / XenBackup.ps1
Last active December 11, 2018 18:36
Powershell script for backup Xenserver and XCP-ng VMs while running (tested with Xenserver 7.0 and XCP-ng 7.5 VMs)
# This script reads virtual machines to backup from an xml
# configuration file by default named XenBackup.xml.
# The configuration file can be given as parameter -config, for example
#
# XenBackup.ps1 -config "XenBackup-test.xml"
#
# [If not given is used the file XenBackup.xml]
#
# The values of maxBackups and backupDir
# can be overridden on specific machine.
@nikiink
nikiink / RAI17.java
Last active June 30, 2017 07:21
Creazione file per dichiarazione non detenzione apparecchi televisivi e altre dichiarazioni relative al canone TV da utilizzare nel desktop telematico dell'agenzia delle entrate
import java.io.FileWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
public class Rai17 {
// SPECIFICHE TECNICHE