Archive for the ‘Tips’ Category.

Convert / Mogrify slow, try epeg

Recently I had a set of images to resize from 8000×10000 pixels down to 2048 pixels maximum. As previously I started with mogrify (mogrify -sample ‘2048>x2048>’ -monitor *.jpg) but it was terrible slow and slowed down my netbook to be totally unusable. Crap….

I looked for alternatives and found epeg. Download and compiled from https://github.com/mattes/epeg. After fetching libjpeg-dev and libexif-dev, it compiled without error. Finally needed to do ldconfig.

It was lightning fast and did not slow down my netbook (1GHz, 1GB, atom2 proc.). Unfortunately I had to convert file by file (i.e. epeg -v -w=2048 -h=2048 –max=2048 -p image01.jpg image01_.jpg), but that was done from a script.

If you ever look for fastest resizing give epeg a chance.

Enigma2 OpenEmbedded Enhanced Movie Center Trashfolder CleanUp

We own a great VuPlus Solo2 Linux based Satelit Receiver. We record some series and films and then delete them. The deleted media files are not deleted directly when using EMC to view and delete. The media files are moved to a trash folder first and should be automatically deleted after x days. But that does not work for whatever reason.

Recently I checked the trash folders I found, as I wondered why the box’s hard disk is getting filled up. And I found many, many old ‘deleted’ files, that are not removed from the hard disk.

I decided to write my own script (/home/root/deltrasholder7days.sh, yes, there is a typo ;-)) ) to finally remove ‘deleted’ files after 7 days. The script was then added to the root’s crontab.

#!/bin/sh
# delete old files
# delete trash files older than 7 days
/usr/bin/find /mnt/hdd/movie_trash -type f -mtime +7 -delete
/usr/bin/find /mnt/hdd/movie/trashcan -type f -mtime +7 -delete
cd /mnt/hdd/movie_trash/
rm last_cleanup*
touch last_cleanup_$( date '+%Y-%m-%d_%H-%M-%S' )
cd /mnt/hdd/movie/trashcan/
rm last_cleanup*
touch last_cleanup_$( date '+%Y-%m-%d_%H-%M-%S' )

The script deletes all files at /mnt/hdd/movie_trash and /mnt/hdd/movie/trashcan with a modification date of 7 days before current day. Then it adds a file with a timestamp as name to let me know, that the script has worked at what time.
… and the crontab (/etc/cron/crontabs/root):

1 1 * * * /home/root/deltrasholder7days.sh

This starts the script every day at 1pm.

That’s all, thank’s to the author of the find utility.

WICD does not reconnect after suspend: obtaining IP address

My Debian 8 Jessie installed Acer Aspire One netbook had problems reconnecting after suspend resume.

WICD showed obtaining IP address for a long time and finally gave up or so. Tried dhclient and dhcpcd, no change. Tried debug mode, which results in the netbook sometimes did not resume to the OS and I had to do a hard reset :-(. Disabled debug logging option in wicd.conf again. Could not live with hard resets.

Changed dhcp server from integrated one in router (tested with different models) to my Linux Debian SID server, no change.

I added the option nolink (for buggy interfaces, found in man dhcpcd and dhcp.conf and inspried by LinuxQuestions.Org) to /etc/dhcpcd.conf and now WICD reconnects fine and fast after setting dhcpcd as external DHCP Client. WICD is version 1.7.24.

Issue solved 🙂

UPDATE 31.8.2016:

Bad news: WICD still does not resolve DHCP address. I mostly have to Cancel the ‘Obtaining IP address…’ process and manually connect. Some times it connects on first time but some times on second or thrird attempt.

Now tested connman. But it behaves alsoe strange. After first install everything looked fine. But after reboot it stated no services available or other strange errors about no wifi and sh.. After some more tests I relaized that connman is not really integrated into Debian. Maybe it is good for ArchLinux? Fortunately I always got a connection using ifdown/ifup for wlan0.

Finally I switched to network-manager and network-manager-gnome. And that impressed me. It connects very, very fast. Hopefully that will be reliable. Suspend and resume also works fine without fiddeling in any conf files so far.

BTW: I am running two Cisco APs with same SSID/WPA2 passphrase, so the devices can roam (no AP controller, just the Cisco APs). Possibly that makes WICD nervous?

How to enable WPA2-PSK AES on Cisco AP1231G

I own two (I know these are older ones) Cisco 1231 with a G-radio, software version 12.3(8)JEE, RELEASE SOFTWARE (fc1), cisco AIR-AP1231G-E-K9.

The APs are setup using WPA-PSK TKIP and I would like to switch to WPA2. There are many pages describing how to enable WPA2-PSK AES, but my tries to enable wpa2 always stopped with an error message.

The normal documented way to enable WPA2-PSK is:

configure terminal
dot11 ssid <SSID_NAME>
authentication open
authentication key-management wpa version 2
guest-mode
wpa-psk ascii <SSID_PASSWORD>
!
interface Dot11Radio0
encryption mode ciphers aes-ccm
ssid <SSID_NAME>
no shutdown
!

Every time I got an error entering this line:

AP1(config-ssid)#authentication key-management wpa version 2
                                                    ^ 
% Invalid input detected at '^' marker.

The trick is to ignore the “version 2”. The software will automatically use WPA2 when you enter “aes-ccm” as the encryption mode cipher. So instead of the above use the following config commands:

configure terminal
dot11 ssid <SSID_NAME>
authentication open
authentication key-management wpa
guest-mode
wpa-psk ascii <SSID_PASSWORD>
!
interface Dot11Radio0
encryption mode ciphers aes-ccm
ssid <SSID_NAME>
no shutdown
!

Thanks to Cisco not mentioning that in there standard documenation and thanks for one or two guys pointing that out in internet.

*replace the text inside the <> brackets with your SSID and password.