Sonntag, 8. Juli 2012

GMail CleanUp WebApp

GMail CleanUp can now be used as StandAlone WebApp without Google Spreadsheets:
https://script.google.com/macros/s/AKfycbz05MyWn_hJwj8_dRtNFHHWRQVwzrJ-jr8p-i4JtQ/exec


After submiting Your settings, a new Trigger will be set automatically.
The CleanUp will be done every day between 1am and 2am.

The close button can only be used, if the GUI is opened from a Spreadsheet.

Freitag, 6. Juli 2012

Dreambox InfoBarTunerState 1.0.1 Beta 1

Change-List:

New Icon (Thanks CoolST)

New Config-Option:
Number of pending records: 0 - 5 of the upcoming timers can be displayed

Very simple update mechanism added.
If IBTS is shown, a timer will update the content every 60 seconds.

If an entry will be exceed the screen width, the title field will be shorten.


Bug Fixes:

For a finished record, following information will be displayed:
Time Left / Duration = Duration
Elapsed = Duration
Time Left = 0
Extract and copy to:
/usr/lib/enigma2/python/Plugins/Extensions/InfoBarTunerState

Archive:
Update: GitHub Repository

Donnerstag, 14. Juni 2012

Dreambox: Migrate existing Ext3 filesystems to Ext4

After reading several articles about migrating existing Ext3 filesystems to Ext4, I decided to try it with my one drive.

Before You start:

  • make sure You have the latest OE2.0 DMM experimental image!
  • it can take several hours to complete the migration!

Open a telnet connection:

# Stop Enigma2
init 4


# Display mounted disks
mount
/dev/disk/by-uuid/aaaabbbbcccc on /media/hdd type ext3 ( rw,relatime,errors=continue,barrier=1,data=writeback)


# Unmount the disk
umount /media/hdd
# List available devices
fdisk -l
Device Boot Start End Blocks Id System
/dev/sda1 1 121601 976760032 83 Linux

# Convert the filesystem # The first step will run fairly fast
tune2fs -O extents,uninit_bg,dir_index /dev/sda1
tune2fs 1.42.1 (17-Feb-2012)


# Repair it
# The second step will take a while, in my case for 1TB about 1 hour
fsck.ext4 -yfD /dev/sda1
e2fsck 1.42.1 (17-Feb-2012)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda1: ***** FILE SYSTEM WAS MODIFIED *****
/dev/sda1: 1545/953984 files (28.3% non-contiguous), 216730948/244190008 blocks


reboot

Donnerstag, 31. Mai 2012

VPN-Verbindung mit Android zur FRITZ!Box

Im AVM VPN-Portal gibt es eine sehr ausführliche Anleitung zum VPN Verbindungsaufbau zwischen einem Android Gerät und einer Fritz Box:
AVM Android VPN Anleitung

Ein letzter Punkt fehlt noch in der Anleitung:
Die IP der FritzBox sollte noch im NCP Konfigurationstool im Feld DNS-Server eingetragen werden, dann funktioniert auch die Namensauflösung über VPN.

Donnerstag, 26. April 2012

Google Analytics PHP Client: Send page information with Events

I'm using the TrackPageView and TrackEvent features of php-ga.

During studying the Events on my Google Analytics page, I saw there are no page information attachted to the Events.
I take a look into the very well commented code, and could implement it in a few minutes.
Attached to the Issue You will find a zip archive containing two unified diffs of the changed files:
Tracker.php 
EventRequest.php 
Now You can also send the page information with the Events.
Actually it is a required parameter, it could also be changed to an optional.

You can find the Feature Request and Patch here:
Issue 16: Send page information with Events

Update:
The patch is now part of php-ga 1.2

Mittwoch, 25. April 2012

Google Analytics without utilizing the clients

If You want to use Google Analytics without JavaScript, You can use the Google or the Galvanize script, but both will utilize the clients by using an Image tag.

The alternative way to avoid this, is a little tweak over the Google Script.
Just follow their instructions and download the ga.php.

You have to comment out:
ga.php line 182:
writeGifData();

Instead of using thier PHP code snipped insert this one before Your own Code:

  // Google Analytics without utilizing the clients
  // URL
  $GA_ACCOUNT = "MO-ACCOUNT_ID";
  $GA_PHP = "ga.php";

  function
sendPageView() {
    global $GA_ACCOUNT, $GA_PHP;
   
    $_GET["utmac"] = $GA_ACCOUNT;
    $_GET["utmn"] = rand(0, 0x7fffffff);
   
    $referer = $_SERVER["HTTP_REFERER"];
    $query = $_SERVER["QUERY_STRING"];
    $path = $_SERVER["REQUEST_URI"];
    if (empty($referer)) {
      $referer = "-";
    }
    $_GET["utmr"] = $referer;
    if (!empty($path)) {
      $_GET["utmp"] = $path;
    }
    $_GET["guid"] = "ON";
   
    include($GA_PHP);
    // Only if You want to debug something
    print_r(error_get_last());
  }
   
  // Avoid sending anything before else You will get:
  // Warning: Cannot modify header information
  sendPageView();
 
  // YOUR PHP CODE GOES HERE
Attention:
Avoid sending anything before else You will get the warning:
Cannot modify header information

More advanced Version:
You have to comment out also:
ga.php line 154 - 158: 
setrawcookie(...)
And comment out at the end of the file:
trackPageView();

Now You can send it also after Your code, just call:
trackPageView();
Maybe You want also to rename our function sendPageView to initGoogleAnalytics, because it will never send anything.

Further:
If You want to use the whole Google Analytics functionalities, You may take a look on the Server-Side Google Analytics PHP Client

Montag, 9. April 2012

KeePass AutoType Enhancement

Just a small improvement to the KeePass AutoType feature.

Do You also have the situation, that programs store the username.
Then the default KeePass AutoType won't work and You have to change the entries AutoType.

So why not change the overall AutoType to avoid this behaviour.

Select Your "Database" and "Edit Group".
Go to the tab "AutoType" and add the Prefix (Ctrl+A): ^a

The complete AutoType should look like:
^a{UserName}{TAB}{Password}{ENTER}

KeePass will now select the complete Username before starting typing it.

Dienstag, 27. März 2012

Share via Bookmarklet on Google Reader

Description of Ridllr:
Google Reader’s sharing features are going away, but Ridllr will let you continue to share and consume content using Google Reader. http://www.ridllr.com


Source Code:

javascript:location.href='http://www.ridllr.com/sendto?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(location.href);
HowTo install:
Just add this link to Your Bookmarks:
Share via Ridllr
HowTo use it:
If You find page, You want to share with Your Ridllr Contacts on Google Reader, just click the Bookmarklet.

Alternative Service:
http://sharebro.org
More on Bookmarklets:
http://en.wikipedia.org/wiki/Bookmarklet
http://marklets.com

Montag, 27. Februar 2012

Dreambox-Blog PushService

The publication of the beta release have passed less than 24 hours and here is the very first review:
http://www.dreambox-blog.com/index.php/6576/pushservice-automatische-e-mail-benachrichtigung-bei-bestimmten-events

Dreambox PushService

PushService (kurz PS) hält euch immer auf dem aktuellen Stand was auf eurer Dreambox passiert.

Dazu wird PS in konfigurierbaren, regelmäßigen Abständen oder zu bestimmten Events ausgeführt, prüft Eure Dreambox nach Euren Vorgaben und benachrichtigt euch per eMail über Vorgänge/Unstimmigkeiten.

Hier ein Beispiel für eine EMail-Benachrichtigung:
Subject: DM8000 PushService: Free space warning
Free disk space limit has been reached:
Path:  /media/hdd/movie
Limit: 100 GB
Left:  88 GB
Provided by Dreambox Plugin PushService 0.1
C 2012 by betonme @ IHAD

Tastenbelegung im Setup:
  • Grün: Speichern und schließen
  • Rot/Exit: Beenden ohne zu speichern
  • Blau: Neues Plugin hinzufügen
  • Gelb: Plugin entfernen
  • Text: Aktuelle nicht gespeicherte eMail Konfiguration testen
  • Info: Testlauf ohne eine eMail zu versenden

Die Grundkonfiguration von PS wird in der E2 Config abgespeichert.
Alle Plugin-Einstellungen werden in einer XML-Datei abgelegt (Default = /etc/enigma2/pushservice.xml).

PS Grundkonfiguration:
  • Enable PushService = True
  • Dreambox name (Mail Subject) = Dreambox
  • Config file = /etc/enigma2/pushservice.xml
  • Start time (HH:MM) = 1:00 Uhr
  • Period in hours (0=disabled) = 24
  • Run on boot = True
  • SMTP Server = smtp.server.com
  • SMTP Port = 587
  • SMTP SSL = True
  • User name
  • Password
  • Mail from = [EMAIL]abc@provider.com[/EMAIL]
  • Mail to or leave empty

Aktuelle Plugins mit Beispielen und Optionen:
  • FreeSpace:
Ihr gebt einen Pfad vor und den gewünschten freien Speicher, liegt der ermittelte freie Speicherplatz darunter, bekommt Ihr eine eMail.
Kann mehrfach hinzugefügt werden, damit verschiedene Speicher geprüft werden können.
-Allow HDD wake up = False
-Where to check free space = /media/hdd/movie
-Free space limit in GB = 100GB
  • DeactivatedTimers:
Der AutoTimer trifft auf einen Timerkonflikt und kann eine Sendung nicht aufnehmen und erstellt deswegen einen deaktivierten Timer (muss aktiviert werden). PS würde euch in dem Fall direkt eine eMail mit dem betreffenden Timer zuschicken.
- Remove deactivated timer(s) after successful transmission = False (On False PS will tag them as DeactivatedTimerPushed)
  • CrashLog:
Angelehnt an die DMM Funktion. Ihr seid außer Haus und es tritt ein GS auf, die Dreambox startet automatisch neu und sendet euch eine Benachrichtigung mit dem CrashLog im Anhang.
-Delete crashlog(s) after successful transmission = False (On False PS will rename them to .pushed)
  • RecordSummary:
Eine Liste aller getätigten Aufnahmen wird euch zugeschickt.
-Remove finished timer(s) only after = False  (On False PS will tag them as FinishedTimerPushed)
  • RecordNotification:
Ihr bekommt eine sofortige Benachrichtigung, wenn eine Aufnahme startet oder beendet wird.
-Send notification on record start = False
-Send notification on record end = True
  • IPKGUpdateNotification:
Wenn Updates bereitstehen bekommt Ihr eine Liste aller Plugins mit der aktuell installierter Version und der Version des Updates.
-Start update check if not done yet = False

Weitere Plugin-Module können sehr einfach zur Laufzeit ohne Neustart hinzugefügt werden.
Wenn das Setup geöffnet wird, werden die Einstellungen und Module neu eingelesen.
Jedes Modul kann weitere Einstellungen bereitstellen, die dann automatisch in der Config eingebunden werden.
(Erklärung für Entwickler folgt)

Roadmap:
Konfiguration / Optionen übersetzen
Öffentlicher Beta-Test
Schwerkraft GIT -> Feed
Lokalisierung ist vorbereitet, somit kann jeder dazu beisteuern.

Installation:
Zip entpacken und nach /usr/lib/enigma2/python/Plugins/Extensions/PushService kopieren

Dependancies:
  • python-twisted-core
  • python-twisted-mail
  • python-twisted-names
  • python-twisted-protocols
  • python-twisted-web  
  • python-pyopenssl
Anleitung zum Erstellen eines Plugin-Moduls:
Es gibt ein Paar Rahmenbedingungen für die Module:
  • Die py-Datei und der class-Namen müssen übereinstimmen
  • Die class muss eine subclass der PluginBase sein
Alles weitere ist optional und hängt von Eurem Modul ab:
  • init: Sollte die Optionen behinhalten (self.setOptions ...) Das Speichern/Laden/Setup-Eintrag wird alles von der PluginBase erledigt.
  • run: Führt eure Prüfungen durch und gebt Subject, Body(optional), Attachments(optional) zurück. Wenn ihr None, False oder "" zurückgebt, wird keine eMail versendet.
  • success: Callback bei erfolgreichem Versand
  • error: Callback wenn ein Fehler beim Versenden auftritt
  • begin: Wird aufgerufen, wenn PS gestartet wird
  • end: Wird aufgerufen, wenn PS gestoppt wird
Die Bedingungen werden Beim Laden der Module auch geprüft, Fehler werden auf der Konsole ausgegeben.

Link

Donnerstag, 16. Februar 2012

Google Apps Script: GMail CleanUp

I wrote a small script, which can automatically clean Your GMail Inbox.


Update is now available via Scriptgalerie.


Description:

Select the label(s) You want to be cleaned regularily. All mails / threads which are older then the configured age are moved automatically to Your trash.

1. Installation:
Open a new new Google Spreadsheet: Google Docs and go to Tools and Scriptgalerie.
Search for GMail Cleanup, install it and grant authorization.

2. Configuration:
Opent the Scriptmanager via the Tools.
Select the onOpen function and click execute, the config screen should appear.

Set Your options, click Submit and Close.

3. Trigger:

Go to the Scripteditor, Triggers menu and choose "current scripts triggers". Click the link to set up a new trigger, choosing the "moveToTrash" function, a "time-driven" event, "day timer," and then for example "midnight to 1am." Click save and you are done.

You can also setup an email alert if something goes wrong.

Run manually:
Via Scriptmanager, execute the function moveToTrash.

Source-Code:
You can view and edit the code, if You installed it.
To view it,open Your spreadsheet and go to Tools and select Scripteditor.
A new Tab with the script source will be opened.


Deinstallation: 
You can deinstall it via the Scripteditor.
Select on the left side the top level GMail Cleanup Script and choose Menu, delete.


Dienstag, 14. Februar 2012

IMDBPHP2 Ticket: Undefined property in pilotsearch.class.php

I'm actually using the IMDBPHP2 for a new project and found a small problem:

For example search for "Alien", it will echo:
Notice: Undefined property: stdClass::$imdb in imdbphp2\pilotsearch.class.php on line 123
Just encapsule the lines with follwing if statement:
if (isset($movie→alternative_identifiers→imdb)) {
and the problem is solved.

Ticket: Undefined property in pilotsearch.class.php
http://projects.izzysoft.de/trac/imdbphp/ticket/288

Update from Author:
Thanx! I set an additional layer on top just to make sure (in case alternate_identifiers itself is not defined). So consider it fixed at r504

Dienstag, 31. Januar 2012

IHAD to RSS Feeds

Beobachtet das IHAD Forum mit eurem Feed-Reader und verpasst kein Update mehr!

Das IHAD-Forum bietet zwar eine RSS-Feeds Schnittstelle, nur leider sind die Links nirgends gelistet.
Die API habe ich vor längerem mal hier beschrieben: IHAD RSS Feed Integration 

http://betonme.lima-city.de/ihadtorss.php