Using tray-icons on IceWM window-manager

20161228_tray_icons_under_icewm.org_icewm.png

IceWM is my favourite window-manager on linux. It’s fast, small and clean – the opposite of Gnome and KDE.

But there was one thing missing: tray-icons. I didn’t care much about this until last week where i’ve installed linux on my notebook. It was very easy to install the whole system but at least there was no possibility to configure my wifi/wlan. In mainstream-configurations there is a tool called nm-applet which put’s itself into the tray-bar, but without a tray-bar nothing will be shown instead.

My old .xinitrc looks as followed:

xbindkeys
xhost +
gkrellm &
nm-applet &
exec icewm

But that’s not the way how IceWM should be started! It should look like as followed:

xbindkeys
xhost +
gkrellm &
nm-applet &
exec icewm-session

Important is that IceWM will be started as icewm-session and thats a big difference. Doing so will end up in showing a nice tray-bar where nm-applet can put itself.

Adding attachments to a PDF-File

20161225_pdftk_add_attachments.org_20161225_125410_29162Z-p.png

There’s an easy way to add attachments to an existing pdf-file. Just install the pdftk-package of your favourite linux-distribution und use it like followed:

pdftk input.pdf attach_files file1.tex file2.tex output new_doc.pdf

This command will use the existing input.pdf and attaches the existing files file1.tex and file2.tex. A new file called new_doc.pdf will be created which contains those 2 attachments.

You can attach any file you want! I use it to include the Latex-sources to the my pdf’s but there are many other reason’s to add attachments.

Ripping HD-Videos with Audio from Youtube

download_icon.png

A few days ago i’ve downloaded some videos from youtube using a dedicated portal as youtube-dl won’t work with most of them.

I prefer to download the best quality (HD-videos) but i wasn’t able to download them with audio (only available without!)

So i’ve downloaded the hd-version without audio and the same video in a lower quality but with audio. With the following script (save it as youtube_merge.sh) i was able to merge the to videos and so i got a full hd-video with audio:

#!/bin/bash
FILE_WITH_AUDIO="$1"
FILE_WITH_GOOD_VIDEO="$2"

TMP_AUDIO=$(basename "$FILE_WITH_AUDIO")
NEW_FILE="NEW_$TMP_AUDIO"
TMP_AUDIO="/tmp/$TMP_AUDIO.aac"

ffmpeg -i "$FILE_WITH_AUDIO" -vn -acodec copy "$TMP_AUDIO"
ffmpeg -i "$FILE_WITH_GOOD_VIDEO" -i "$TMP_AUDIO" -c:v copy -c:a aac -bsf:a aac_adtstoasc -strict experimental "$NEW_FILE"

Call it like

youtube_merge.sh video_with_audio.mp4 hd_video_without_audio.mp4

und you’ll get a file called NEW_video_with_audio.mp4 which can be played fined using mplayer, vlc and others …

You also need to have ffmpeg installed!

Goodbye Sendmail, Hello Postfix

postfix.png

I had a very complex mail-configuration with several domains, virtual-users and aliases, pop-before-smtp functionality, spamassassin-plugins and much more.

It was a real pain to configure all those important features into my sendmail-configuration. At first directly into sendmail.cf and later using sendmail.mc. I always thought that it would be difficult or impossible to change from sendmail to some other mail-system because of my current configuration but i was completely wrong …

Configuring a sendmailer, even with sendmail.mc, isn’t really user-friendly. My configuration has grown in the last past years but last week i had some issues with spammers and sendmail wasn’t really helpful in that case. That was the reason for me to look to other mail-systems. At that time i didn’t want to change sendmail but i tried to test other systems only to see if they run into the same problems and wooahh – Postfix supports all features and plugins which are used in my Sendmail-configuraton. Not “out of the box” but nearly.

I’m sure that Sendmail can handle all kinds of problems too and even the problematic with my spam-issues could be solved using sendmail. But i don’t want to spend days/weeks just to configure some mail-features. I also find out that Sendmail is using some strange website with commercial interests and “enterprise solutions”. Ok, there is a small link labeled “Open Source” but that commercial-stuff was another reason to throw that software away, Now i’m happily using postfix.

RollerCoaster Tycoon 2 – OpenSource alternative

20161101_openrct2.org_20161101_184033_19596nEI.png

Did you know the original RollerCoaster Tycoon 2 game from many decades ago?

Now there’s project called OpenRCT2 which can be found at http://openrct2.org/ It allow’s you to play this game under linux (or even windows or macOS)

You still need the original game-data but that’s no problem as you can still buy this game on well known online-markets (at a very cheap price)

This is one of my favourites as i’m a great fan of this genre (Starting with ThemePark) and the developer’s are still working on this great game (Maybe for bugfixes or features as this game is currently playable) Last updates were 3 hours ago as i’ve written that blog-entry.

Have a look at this great game!

aMule 2.3.2 released

20161008_amule_2_3_2.org_20161008_194202_229217FJ.png

The new release was published on 16th september but i’ve just found it today. Good news for Debian-User – This release will build without errors as seen in 2.3.1!

Reason for that could be found in the Changelog:

– Use the C++ compiler to check for features we’re about to use in C++ source files (#1572)

So there’s no patch needed anymore to handle different C++-compilers.

Thanks to the developer for this great tool! Have a look at http://www.amule.org/

Freeserf – Build error on Debian

20161008_freeserf_bugfix.org_20161008_194434_22921IQP.png

The current release of Freeserf (20161008) won’t build using Linux/Debian. The reason for this are some C++-issues.

It seem’s that CLang/VC will have no problems but gcc. See the GameObject-class in src/objects.h. The command = delete won’t work/build with gcc (Debian 4.9.2-10)

See https://github.com/wittnet/freeserf for a quick’n dirty workaround so you can build it again.

Manually executing a logfile rotation using logrotate

If you change some parameters in /etc/logrotate.conf or /etc/logrotate.d/* the most common way to use the new configuration is to call logrotate like:

logrotate /etc/logrotate.conf

That way will read the whole configuration of logrotate using parameters like minsize, age and so on.

But you can force logrotate to ignore those parameters so the rotation will happen even if the size is smaller than minsize (minsize as an example)

Simply call logrotate as seen from above with the -f parameter:

logrotate -f /etc/logrotate.conf

How to find currently used ip’s of a linux-system

The primary tool for this job was called ifconfig. This tool shows the IP addresses of all available network adapters. So regardless of whether it is an ethernet interface or a wireless adapter (of course there are much more types of network connections)

However, ifconfig should no longer be used at the present time will. Above all, in times of IPSec, ifconfig won’t correctly display all available interfaces.

The successor of ifconfig is simply called ip. The ip command shows not only the IP addresses. To give a similar output as ifconfig get used to ip with the following parameters:

ip addr show

The command from above will produce the following (or similar) output:

root@xxx:~# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group
default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
group default qlen 1000
    link/ether 00:50:56:90:78:4d brd ff:ff:ff:ff:ff:ff
    inet 10.2.10.7/16 brd 10.2.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe90:784d/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP
group default qlen 1000
    link/ether 00:50:56:90:0a:54 brd ff:ff:ff:ff:ff:ff
    inet 10.1.200.7/24 brd 10.1.200.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::250:56ff:fe90:a54/64 scope link
       valid_lft forever preferred_lft forever

VPN-IP’s, like the one allocated by StrongSwan (IPSec), will be also listed in here but won’t be shown with ifconfig!

Playing Westwood’s Red Alert 2 under Linux/Qemu (XP)

At first the bad news: The game can’t be played native under Linux. There are some possibilities to get it run using Wine but that’s some kind of gambling.

There are also many OpenSource-variants like OpenRa or FreeRa (discontinued?) but thats not the same as playing the real game.

20160716_red_alert2_qemu.org_20160716_110429_10182Kmg_thumb.png

So the best way (for me) is playing Red Alert2 using the virtualization-software Qemu with the guest-os Windows-XP.

But hey, why Windows-XP? This operating system shouldn’t be used anymore because of missing updates and therefore many security-holes will appear in the future.

That’s right, but if you’re using Windows-XP only to play some older games it shouldn’t be any problem, even if you disallow access to the internet from the machine. Windows-XP is also the best solution to play those older games. Not only Red Alert 2. Also Stronghold, Sim-City, Freeserf, … can be perfectly played under XP.

Another good reason is the price. You’ll get cheap copies of Windows-XP using eBay or Amazon.

I don’t explain how to install Windows-XP or Red Alert 2 in a virtual environment as this could be found using google. Instead i will show you the perfect command-line which should be used:

kvm -smp 2 -m 4096M -vga cirrus -cpu host -drive file=disk.qcow2,cache=none -boot order=d -net nic,model=rtl8139 -np -cdrom /tmp/ra2.iso -soundhw ac97

Be sure to use the cirrus vga-adapter. Other values like std or vmware won’t work or you’ll get some blank screens when starting Red Alert 2 (But you can hear some sound at least ;-))

Also take care about the iso-file which is used here as /tmp/ra2.iso. The original cd’s can’t be used as they will be not detected by the copyright-protection of Westwood (But it seem’s that qemu can’t forward all low-level calls to the cdrom-driver of linux) So you have to rip the iso’s from the original cd’s. But here’s another problem: The cd’s can’t be easily ripped using dd or similiar commands because of another copyright-protection of the cd itself. You will have to use some special kind of ripping-software like Alcohol or similar.

Another problem is sound-jittering. You can try to decrease the screen resolution of the guest but that won’t work in all cases. A good way will be the use of an external usb-soundcard which will be only used by the virtual guest.

An external usb-soundcard can be included in qemu using the following command-line:

kvm -smp 2 -m 4096M -vga cirrus -cpu host -drive file=disk.qcow2,cache=none -boot order=d -net nic,model=rtl8139 -np -cdrom /tmp/ra2.iso -soundhw ac97 -usb -device usb-host,hostbus=4,hostaddr=4

You can get your values for hostbus and hostaddr using the lsusb-command of linux (So please don’t use the values of my configuration!)

The output of lsusb will be something like:

Bus 004 Device 004: ID 0480:a006 Toshiba America Info. Systems, Inc. 
Bus 004 Device 003: ID 0bc2:5031 Seagate RSS LLC FreeAgent GoFlex USB 3.0
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 004: ID 03f0:134a Hewlett-Packard 
Bus 003 Device 003: ID 046d:c312 Logitech, Inc. DeLuxe 250 Keyboard
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The first values (Bus and Device) are the values which have to be used as hostbus and hostaddr.

Now it’s time play a game and i hope you’ll enjoy playing some classic games from the last decade(s).