The well known Midnight Commander (mc) uses the Insert-Key to select multiple files.
This key is not available on a Mac keyboard, but there is an alternative shortcut to select multiple files in midnight commander on Mac OS X:
Ctrl + T
Using this in the terminal of Mac OS X has the same effect than the insert key.
2012-05-31
2011-09-01
Apple Keyboard on linux
To be able to use an Apple keyboard (MB110D/A) on a linux system, the correct layout must be set first. Select the corresponding in the Keyboard Preferences. In this case Germany Macintosh is added to the layouts list.
Keyboard model should be Apple.
Unfortunately, the keys [^/°] and [] remain reversed. To fix this the key codes have the be reassigned:
1) Find out the keycode
With help of the programm xev the keycode can be figured out. Start the programm as follows and press the keys [^/°] and [] afterwards. The keycodes should be displayed.
2) Show current key assignment
The current key assignment can be displayed using xmodmap.
3) Change key assignment
With xmodmap the key assignement can be changed.
Keyboard model should be Apple.
Unfortunately, the keys [^/°] and [] remain reversed. To fix this the key codes have the be reassigned:
1) Find out the keycode
With help of the programm xev the keycode can be figured out. Start the programm as follows and press the keys [^/°] and [] afterwards. The keycodes should be displayed.
$ xev | grep keycode
state 0x10, keycode 94 (keysym 0xfe52, dead_circumflex), same_screen YES,
state 0x10, keycode 94 (keysym 0xfe52, dead_circumflex), same_screen YES,
state 0x10, keycode 49 (keysym 0x3c, less), same_screen YES,
state 0x10, keycode 49 (keysym 0x3c, less), same_screen YES,
So we need to fix the assignment for the keycodes 94 and 49.2) Show current key assignment
The current key assignment can be displayed using xmodmap.
$ xmodmap -pke | grep " 94"
keycode 94 = less greater less greater bar brokenbar bar
$ xmodmap -pke | grep " 49"
keycode 49 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032
Here you can already see the problem. On the button [^ / °] with keycode 94 are the signs for smaller, bigger, ...3) Change key assignment
With xmodmap the key assignement can be changed.
$ xmodmap -e 'keycode 49 = less greater less greater bar brokenbar bar'
$ xmodmap -e 'keycode 94 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032'
However, this change only lasts until the next reboot. In order to implement this change permanent or restore after a reboot, the new assignments must be stored in the file ~/.Xmodmap.
$ xmodmap -pke | grep " 49" >> ~/.Xmodmap
$ xmodmap -pke | grep " 94" >> ~/.Xmodmap
The file should look like this now:keycode 94 = dead_circumflex degree dead_circumflex degree U2032 U2033 U2032
keycode 49 = less greater less greater bar brokenbar bar
2011-07-15
Patch files with git diff
In order to create a patch file that is usable with "patch -p0 < patchfile" with "git diff", the option "--no-prefix" has to be used:
git diff --no-prefix > patchfile
Now the patch can be applied using:
patch -p0 < patchfile
If you already have a patch file out of "git diff" where the "--no-prefix" option was not specified, the patch must be applied as follows:
patch -p1 < patchfile
This way the standard prefixes a/ and b/ are ignored.
2011-06-18
Auto-Update for Java Applications
Java WebStart-Applications have a great update mechanism using JNLP. It checks during launch if there is a new version available on the server and downloads the new version to the client automatically. This way the client always runs with the latests version available on the server. But what about standalone Java applications?
Appcast - an RSS 2.0 update feed
Similar to podcasts a appcast is a RSS 2.0 feed to announce a new release of a software product. It basically uses standard RSS 2.0. The reference to the new version file can be specified in the enclosure tag:
Just place this as appcast.xml on some host that is accessible by the application. The application can check if there is a new update available using this appcast.xml.
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>MyApp Changelog</title>
<link>http://example.com/MyApp/appcast.xml</link>
<description>Latest changes and updates.</description>
<language>en</language>
<item>
<title>Version 1.3.2</title>
<pubDate>Wed, 18 Jun 2011 09:20:11 +0000</pubDate>
<enclosure url="http://example.com/MyApp-1.3.2.zip" length="1234567" type="application/octet-stream" />
</item>
</channel>
</rss>
Just place this as appcast.xml on some host that is accessible by the application. The application can check if there is a new update available using this appcast.xml.
Appcast Framework for Mac OS X
Andy Matuschak's Sparkle is a free software update framework for Mac OS X that is very widespread. It has some appcast extensions for custom version strings and DSA signature for the update file. An complete sparkle appcast example can be found here. With these extensions is also possible to include a link to the release notes file.
Appcast updates for Java Applications?
The RSS 2.0 structure is very easy and there are already java parsers available. The sparkle extensions can also be parsed in Java. You can use JAXB to get the values out of the enclosure tag:
But how do you handle applications with multiple JAR files if every component has it's own versioning? The version string from the MANIFEST.MF file can be used or one can add a new version string, e.g. 'Appcast-Version: 1.2.3', to the JAR's MANIFEST.MF file. This can be read easily at runtime with java.util.jar.Manifest class:
The appcast URL itself can also be placed inside the MANIFEST.MF file for each application module, e.g. using "Appcast-Url: http://example.com/MyApp/appcast.xml".
Keep in mind that it is not possible to replace a JAR file of a currently running application. So you need a bootstrap mechanism to check and download updates and apply them during next start of the application.
@XmlAccessorType(XmlAccessType.FIELD)
public class Enclosure {
@XmlAttribute
String url;
@XmlAttribute
long length;
@XmlAttribute
String type;
@XmlAttribute(namespace="http://www.andymatuschak.org/xml-namespaces/sparkle")
String version;
@XmlAttribute(namespace="http://www.andymatuschak.org/xml-namespaces/sparkle")
String shortVersionString;
@XmlAttribute(namespace="http://www.andymatuschak.org/xml-namespaces/sparkle")
String dsaSignature;
...
The other tags can be processed the same way.
You only need to compare the current application version string with the one from the appcast enclosure. If the appcast version is newer, download the update file.But how do you handle applications with multiple JAR files if every component has it's own versioning? The version string from the MANIFEST.MF file can be used or one can add a new version string, e.g. 'Appcast-Version: 1.2.3', to the JAR's MANIFEST.MF file. This can be read easily at runtime with java.util.jar.Manifest class:
Manifest manifest = new Manifest(new FileInputStream(new File("manifest.mf")));
Attributes mainAttributes = manifest.getMainAttributes();
if (mainAttributes != null) {
return mainAttributes.getValue("Appcast-Version");
}
The appcast URL itself can also be placed inside the MANIFEST.MF file for each application module, e.g. using "Appcast-Url: http://example.com/MyApp/appcast.xml".
Keep in mind that it is not possible to replace a JAR file of a currently running application. So you need a bootstrap mechanism to check and download updates and apply them during next start of the application.
2011-02-12
Enable colors for git on Mac OS X
To enable colors for all git commands on Mac OS X use:
$ git config --global color.ui true
2011-01-08
top command on OS X
On Linux systems the top command shows the running processes sorted by the highest CPU consumption by default.
This is not the case on Mac OS X systems. There the processes are sorted by their PID in descending order (highest PID on top).
For those that are interested in the processes that consume much CPU use the following:
This is for sorting the processes according their CPU usage.
For easier access you can create an alias.
Add the following line in you .profile file:
This is not the case on Mac OS X systems. There the processes are sorted by their PID in descending order (highest PID on top).
For those that are interested in the processes that consume much CPU use the following:
top -o cpu
This is for sorting the processes according their CPU usage.
For easier access you can create an alias.
Add the following line in you .profile file:
alias top='top -o cpu'
2010-04-25
Umlaute im DOS-Fenster unter Windows 7
Unter Windows 7 funktionierten die Umlaute in der DOS-Box bei älteren DOS-Programmen nicht mehr richtig.
Die Lösung brachte folgende zusätzliche Zeile in C:\Windows\system32\autoexec.nt:
LH KB16 GR,,%Systemroot%\system32\keyboard.sys
2010-02-15
FritzBox 7270 hinter Speedport 920V - Fernwartung
Betreibt man so wie ich eine FritzBox 7270 hinter einem Speedport 920V, der auch die Internetverbindung herstellt, so ergibt sich ein Problem mit der Fernwartung der FritzBox:
Auf dem Speedport 920V muss man natürlich ein Portforwarding für die Fernwartung der FritzBox einrichten. Ich hab einfach mal den SSL-Port 443 auf die FritzBox gesetzt.
Das klappt dann alles ganz gut bis zur Anmeldung an der FritzBox. Nach Eingabe von Benutzername und Passwort kommt nur noch eine leere weiße Seite.
Das Problem sind scheinbar die Referrer-Header, die die Browser mitschicken.
Schaltet man die nämlich aus, so funktioniert alles wunderbar:
Im Firefox in der Adresszeile
about:config
eingeben und nach
network.http.sendRefererHeader (Achtung: Referer mit einem 'r' !) suchen.
Der Standardwert ist 2. Ändert man den Wert auf 0, klappt die Fernwartung.
Leider ist das soweit ich weiß nur im Firefox möglich und auf anderen Internetseiten durchaus mit Problemen verbunden.
Auf dem Speedport 920V muss man natürlich ein Portforwarding für die Fernwartung der FritzBox einrichten. Ich hab einfach mal den SSL-Port 443 auf die FritzBox gesetzt.
Das klappt dann alles ganz gut bis zur Anmeldung an der FritzBox. Nach Eingabe von Benutzername und Passwort kommt nur noch eine leere weiße Seite.
Das Problem sind scheinbar die Referrer-Header, die die Browser mitschicken.
Schaltet man die nämlich aus, so funktioniert alles wunderbar:
Im Firefox in der Adresszeile
about:config
eingeben und nach
network.http.sendRefererHeader (Achtung: Referer mit einem 'r' !) suchen.
Der Standardwert ist 2. Ändert man den Wert auf 0, klappt die Fernwartung.
Leider ist das soweit ich weiß nur im Firefox möglich und auf anderen Internetseiten durchaus mit Problemen verbunden.
FritzBox 7270 hinter Speedport 920V
Wenn man VDSL nutzen möchte, bleibt einem - zumindest bei T-Home - nichts anderes übrig, als ein zusätzliches VDSL2-fähiges Modem zu verwenden. Die FritzBox 7270 hat ja leider keins.
Ich verwende hier den Speedport 920V.
Nach längeren Tests mit den unterschiedlichsten Konfigurationen hat sich folgendes Setup als am Besten erwiesen:

Splitter
|
Speedport 920V (als Router)
|
FritzBox 7270 (als IP-Client/Switch/WLAN)
Der 920V bietet zwar in der Konfiguration die Möglichkeit ihn nur als Modem zu verwenden, allerdings scheiterten bei mir alle Einwahlversuche mit der FritzBox. Also lass ich die Verbindung nun vom 920V herstellen.
Hoffentlich kommt endlich bald die FritzBox 7390 mit eingebautem VDSL2-Modem!
Ich verwende hier den Speedport 920V.
Nach längeren Tests mit den unterschiedlichsten Konfigurationen hat sich folgendes Setup als am Besten erwiesen:

Splitter
|
Speedport 920V (als Router)
|
FritzBox 7270 (als IP-Client/Switch/WLAN)
Der 920V bietet zwar in der Konfiguration die Möglichkeit ihn nur als Modem zu verwenden, allerdings scheiterten bei mir alle Einwahlversuche mit der FritzBox. Also lass ich die Verbindung nun vom 920V herstellen.
Hoffentlich kommt endlich bald die FritzBox 7390 mit eingebautem VDSL2-Modem!
2009-12-30
Fritz!Box Anfragen an Port 14013
Meine FritzBox 7270 macht seit dem letzten Firmware-Update ständig Anfragen an Port 14013 aller Clients. Wie sich herausgestellt hat, liegt das an dem neuen Feature Kindersicherung.
Nachdem ich das in der FritzBox deaktiviert hatte, war Ruhe.
Nachdem ich das in der FritzBox deaktiviert hatte, war Ruhe.
2009-08-29
Date And Time Handling On Distributed Systems
Da es immer wieder Probleme mit dem Umgang von Datums- und Zeitwerten gibt, habe ich dazu mal einen entsprechenden Artikel verfasst, der die aktuellen Problemstellungen aufzeigt und "Best Practice" Empfehlungen gibt.
2009-06-01
Subscribe to:
Posts (Atom)


