Martin Karer http://sezz.at Martin Karer Sat, 07 Jan 2012 19:31:09 +0000 en hourly 1 http://wordpress.org/?v=3.1.3 SW:ToR Forum – Disable Link Popuphttp://sezz.at/blog/swtor/swtor-forum-disable-link-popup/ http://sezz.at/blog/swtor/swtor-forum-disable-link-popup/#comments Sat, 07 Jan 2012 19:31:09 +0000 Martin Karer http://sezz.at/?p=2186 Annoying warnings like this one won’t help making the web safe for idiots:

Install my userscript to disable it:

// ==UserScript==
// @name            SWTOR Forum: Disable Link Popup
// @description     Disables the annoying warning when clicking on external links. [Martin Karer, http://www.sezz.at]
// @namespace       sezz.at_swtor.com_disable_link_popup
// @include         http://*swtor.com*/community/*
// ==/UserScript==

var $ = unsafeWindow.jQuery;
$(document).ready(function() {
	$("a").die("click");
});

Download: SW:ToR Forum No Link Popup Userscript (413 bytes)

]]>
http://sezz.at/blog/swtor/swtor-forum-disable-link-popup/feed/ 1
Chrome: Anonymes Surfen (oder nicht?)http://sezz.at/blog/browser/chrome-anonymes-surfen-oder-nicht/ http://sezz.at/blog/browser/chrome-anonymes-surfen-oder-nicht/#comments Mon, 26 Sep 2011 20:29:22 +0000 Martin Karer http://sezz.at/?p=2170

Fakt: Das Inkognito-Fenster ist kein Ersatz für die seit vielen Jahren bewährte und universal einsetzbare Tarnkappe!

]]>
http://sezz.at/blog/browser/chrome-anonymes-surfen-oder-nicht/feed/ 0
iOS 5 Beta 4 OTA Update Installationhttp://sezz.at/blog/iphone/ios-5-beta-4-ota-update-installation/ http://sezz.at/blog/iphone/ios-5-beta-4-ota-update-installation/#comments Sat, 23 Jul 2011 22:33:58 +0000 Martin Karer http://sezz.at/?p=2080 Idiotensicher wie man es von Apple gewohnt ist:

Update Reminder Details zum Update Bestimmungen Download Abschluss

Dank Jailbreak schlägt das Update fehl. Um das OTA Update ohne JB durchzuführen soll Zurücksetzen der Einstellungen helfen (direkt am Gerät), dank iCloud Backup geht nichts verloren.

]]>
http://sezz.at/blog/iphone/ios-5-beta-4-ota-update-installation/feed/ 0
Addon Updates 4.2http://sezz.at/blog/wow/addon-updates-4-2/ http://sezz.at/blog/wow/addon-updates-4-2/#comments Sun, 03 Jul 2011 09:57:32 +0000 Martin Karer http://sezz.at/?p=2059 COMBAT_LOG_EVENT_UNFILTERED wurde mal wieder geändert – folgene Addons sollten nun wieder lauffähig sein:

]]>
http://sezz.at/blog/wow/addon-updates-4-2/feed/ 0
Pirelli PRGAV4202N Reboot Scripthttp://sezz.at/blog/internet/pirelli-prgav4202n-reboot-script/ http://sezz.at/blog/internet/pirelli-prgav4202n-reboot-script/#comments Sat, 02 Jul 2011 22:26:58 +0000 Martin Karer http://sezz.at/?p=2053 Da sich mein Pirelli PRGAV4202N von der Telekom Austria gelegentlich weigert, nach einem Disconnect die Verbindung neu aufzubauen und auch ein manueller Reconnect nicht mehr möglich ist habe ich mir ein kleines Bash Script geschrieben, dass den Router automatisch per Telnet neustartet.

Das Script wird bei mir per Cronjob alle 5 Minuten ausgeführt und überprüft den Status der Einwählverbindung (ppp0) – wenn die Verbindung beim 2. Aufruf noch offline ist wird das Gerät neu gestartet.

Wichtig: Der angegebene User benötigt Administrator Rechte (s. hier oder bei neuerer Firmware hier)!

#!/bin/bash

SLEEP=1
PIRELLI_STATUS=/tmp/pirelli
PIRELLI_LOG=/root/pirelli.log
PIRELLI_IP=192.168.0.3
PIRELLI_USER=admin
PIRELLI_PASS=

if [ ! -f $PIRELLI_STATUS ]; then
        echo "1" > $PIRELLI_STATUS
fi

pirelli_telnet() {
        (
                sleep $(( 2 * $SLEEP ))
                echo $PIRELLI_USER
                sleep $SLEEP
                echo $PIRELLI_PASS
                sleep $SLEEP
                echo "$1"
                sleep $SLEEP
                echo "quit"
        ) | telnet $PIRELLI_IP 2> /dev/null
}

ONLINE=`pirelli_telnet "net ifconfig ppp0" | grep "state=running" | wc -l`
ONLINE_BEFORE=`cat $PIRELLI_STATUS`

if [ $ONLINE -eq 0 ] && [ $ONLINE_BEFORE -eq 0 ]; then
        NOW=`date +"%Y/%m/%d %H:%M:%S"`
        echo "$NOW - Rebooting..." >> $PIRELLI_LOG
        pirelli_telnet "system reboot"
fi

echo "$ONLINE" > $PIRELLI_STATUS
]]>
http://sezz.at/blog/internet/pirelli-prgav4202n-reboot-script/feed/ 2
Word: Dokument automatisiert ausdrucken und beendenhttp://sezz.at/blog/batch/word-dokument-automatisiert-ausdrucken-und-beenden/ http://sezz.at/blog/batch/word-dokument-automatisiert-ausdrucken-und-beenden/#comments Thu, 23 Jun 2011 13:07:10 +0000 Martin Karer http://sezz.at/?p=1934 Für den Einsatz als Verknüpfung (zB beim Start von Windows), Batch-Datei oder ähnlichem – das Dokument wird geöffnet, auf dem Standarddrucker ausgedruckt, gespeichert und anschließend schließt sich Word wieder:

Word 2003:

"%ProgramFiles%\Microsoft Office\Office12\WINWORD.EXE" <Pfad zum Dokument> /q /mFilePrintDefault /mFileSave /mFileExit

Word 2010:

"%ProgramFiles%\Microsoft Office\Office14\WINWORD.EXE" <Pfad zum Dokument> /q /mFilePrintDefault /mFileSave /mFileClose /mFileExit

]]>
http://sezz.at/blog/batch/word-dokument-automatisiert-ausdrucken-und-beenden/feed/ 0
Hardware IDs auslesen (Batch + WMI)http://sezz.at/blog/batch/get-device-ids-with-batch-wmi/ http://sezz.at/blog/batch/get-device-ids-with-batch-wmi/#comments Thu, 23 Jun 2011 13:05:33 +0000 Martin Karer http://sezz.at/?p=1931 Ich weiß zwar nicht mehr wofür ich das verwendet habe, aber so funktionierts:

FOR /F "TOKENS=1 SKIP=1" %%V IN ('WMIC PATH Win32_PnPEntity GET DeviceID') DO (
ECHO Device: %%V
)
]]>
http://sezz.at/blog/batch/get-device-ids-with-batch-wmi/feed/ 0
Blockieren von Hosts mittels Batch-Filehttp://sezz.at/blog/batch/update-hosts-file-block-hosts/ http://sezz.at/blog/batch/update-hosts-file-block-hosts/#comments Thu, 23 Jun 2011 13:04:32 +0000 Martin Karer http://sezz.at/?p=1928 Hin und wieder ganz nützlich, um automatisches Aktualisieren von Programmen zu verhindern oder einfach zum Filtern von Werbung. Die Funktion BlockHost überprüft ob der Eintrag im HOSTS-File existiert und legt ihn bei Bedarf an:

@ECHO OFF
CALL :BlockHost example.com
CALL :BlockHost another-example.com
CALL :BlockHost another-example.org
GOTO End

:BlockHost
ECHO Host/IP: %*
FIND /C /I "%*" "%WINDIR%\SYSTEM32\DRIVERS\ETC\HOSTS" > NUL
IF %ERRORLEVEL% NEQ 0 ECHO 127.0.0.1 %* >> "%WINDIR%\SYSTEM32\DRIVERS\ETC\HOSTS"
GOTO :EOF

:End
]]>
http://sezz.at/blog/batch/update-hosts-file-block-hosts/feed/ 0
Administrator-Rechte in einer Batch-Dateihttp://sezz.at/blog/batch/administrator-privileges/ http://sezz.at/blog/batch/administrator-privileges/#comments Wed, 15 Jun 2011 22:20:07 +0000 Martin Karer http://sezz.at/?p=1879 Kleines Beispiel, wie in einer Batch Datei überprüft werden kann ob der aktuelle Benutzer Admin-Rechte besitzt. Sollten die erforderlichen Rechte nicht vorhanden sein, wird das Programm erneut über ein VBScript aufgerufen, welches den bekannten UAC Dialog anzeigt und die Eingabe des Administrator-Passwortes ermöglicht.

Alternativ zum VBScript kann auch ELEVATE.EXE verwendet werden.

Getestet unter Windows 7/Windows 2008.

@echo off
%windir%\SYSTEM32\FSUTIL.exe > nul 2> nul && (GOTO admin) || (GOTO nonadmin)

:admin
REM Everything's fine!
echo ADMIN
goto end

:nonadmin
REM Prompt for elevation using VBScript and re-run batch file.
echo USER
set tempvbs=%temp%\%~n0.vbs

echo Dim oShell > "%tempvbs%"
echo Set oShell = CreateObject("Shell.Application") >> "%tempvbs%"
echo oShell.ShellExecute "%~f0", WScript.ScriptFullName, vbNullString, "runas" >> "%tempvbs%"
echo Set oShell = CreateObject("Shell.Application") >> "%tempvbs%"
cscript "%tempvbs%" //nologo
del "%tempvbs%"
goto end

:end
pause
]]>
http://sezz.at/blog/batch/administrator-privileges/feed/ 0
WordPress in Unterverzeichnis: Jahresarchiv Fixhttp://sezz.at/blog/wordpress/non-root-wordpress-blog-year-archives-fix/ http://sezz.at/blog/wordpress/non-root-wordpress-blog-year-archives-fix/#comments Wed, 15 Jun 2011 20:23:27 +0000 Martin Karer http://sezz.at/?p=1867 Da mich der Google Bot durch massives Generieren von 404-Fehlern fleißig darauf aufmerksam gemacht hat, dass meine Jahresarchive im Blog wohl nicht erreichbar sind, bin ich der Sache nachgegangen.

Ich habe mein Blog wie im WordPress Codex beschrieben konfiguriert – funktioniert zwar grundsätzlich, allerdings sind die Jahresarchive nicht erreichbar. Für die eigene Seite “Blog” werden wie für alle anderen Seiten Rewrite Rules angelegt – das Problem daran ist, dass diese auch beim Aufruf von zB /blog/2011 greifen und somit nie die erste Seite des gewünschten Archivs (blog/([0-9]{4})/?$) angezeigt werden kann. Unterseiten oder Monatsarchive funktionieren weiterhin wie gewünscht, da es dafür eigene Regeln gibt.

Ich habe das Problem über folgenden Code in der functions.php meines Themes gelöst:

/**
 * Year-based archive fix [YAF]
 *
 * My blog is accessable via a subdirectory called /blog
 * Permalink structure: /blog/%category%/%postname%/
 * Page ID of my blog page: 13
 *
 * It seem's that if you create a "page" for your blog in a subdirectory as suggested
 * by the WordPress Codex (http://codex.wordpress.org/Making_Your_Blog_Appear_in_a_Non-Root_Folder)
 * the page-related rewrite rule get's executed first and it bypasses the pattern for
 * year-based archives (blog/([0-9]{4})/?$ in my example).
 *
 * To fix this behavior I changed the slug for my "blog page" to archives and
 * added a filter to page_link that changes the link from "archives" to "blog".
 *
 * DON'T FORGET TO SAVE THE PERMALINK STRUCTURE AT LEAST ONCE!
 * DON'T FORGET TO REPLACE THE PAGE ID (13) WITH YOUR BLOG PAGE ID!
 */
$permalink_structure = get_option('permalink_structure');
if (preg_match(':/([^/%]+)/.*:', $permalink_structure, $blog_page)) {
	// blog is located in a subdirectory
	$sezz_blog_subdirectory = $blog_page[1];

	add_filter('rewrite_rules_array', 'sezz_yaf_rewrite_rules');
	function sezz_yaf_rewrite_rules( $rewrite_rules ) {
		global $sezz_blog_subdirectory;

		$new_rules = array(
			$sezz_blog_subdirectory.'/?$' => 'index.php?cat=-0',
			$sezz_blog_subdirectory.'/page/?([0-9]{1,})/?$' => 'index.php?cat=-0&paged=$matches[1]',
		);

		$rewrite_rules = $new_rules + $rewrite_rules;
		return $rewrite_rules;
	}

	if (!is_admin()) {
		add_filter('page_link', 'sezz_yaf_page_link', 1, 2);
		function sezz_yaf_page_link( $link, $id ) {
			if ($id == 13) {
				global $sezz_blog_subdirectory;

				return home_url().'/'.$sezz_blog_subdirectory.'/';
			} else {
				return $link;
			}
		}
	}
}

Update: home_url() anstatt WP_HOME

]]>
http://sezz.at/blog/wordpress/non-root-wordpress-blog-year-archives-fix/feed/ 0