SiteBar development moved to GitHub

March 4th, 2014 6 comments

Almost 7 years since the last release, finally SiteBar 3.4 has been released. The source code has been moved from publicly accessible but privately hosted subversion repository to GitHub – .

Actually I do not expect any rush in getting contributions, but it is kind of nice to see, that something with a codebase from 2005 can still be useful for someone.

I will use this post and move here comments, that landed on other pages of this blog.

Categories: SiteBar Tags:

How to export videos from iPhoto and keep their date

January 13th, 2014 No comments

When importing files from family iPhones on MacBook Air, Google Picasa does not process rotation properly. I have to use iPhoto. However iPhoto does not export properly date of videos. In order to keep my archive on disk properly organized, I wrote myself two scripts.

I export images and videos from iPhoto using:

Field Value
Kind Original
File name Use filename
Subfolder Format Event Name

This will place them into subfolder on the disk. Now in each directory I run script iphoto-touch-mov-by-prev-image, which will touch the videos to have the same date/time as the closest image.

Afterwards I run all files through a script iphoto-copy-export-to-archive-dir which will put them into YEAR/YEAR-MONTH-DAY subfolder in my archive.

In order to process multiple subdirectories I use:

for DIR in `find . -type d`; do
    iphoto-touch-mov-by-prev-image $DIR
    iphoto-copy-export-to-archive-dir /Volumes/Archive $DIR/*.*
Categories: MacOSX, Missing Answers Tags:

QNAP QAirPlay and standalone web applications not accessible on port 8081

December 30th, 2013 1 comment

Probably with firmware 4.0.2 or 4.0.5 I have lost possibility to run music station and QAirPlay and other applications which run on secure port 8081. I have tracked the problem down to the fact, that /etc/config/apache/extra/apache-ssl.conf is not included. Looking at /etc/init.d/ I have discovered, that it is because /sbin/getcfg QWEB Enable_SSL -u -d NULL returns 0 instead of expected 1. I have fixed the problem by running:

/sbin/setcfg QWEB Enable_SSL 1
/etc/init.d/ restart

Now apache listens on por 8081 again and I can run QNAP applications. About two hours of lost time by Googling a solution. Proper answer was missing. There have not been any nonstandard changes on my side, I just wanted to run everything on secure ports.

Categories: Missing Answers Tags:

After restart of Asus RT-N66U router a strange page occurs and does not go away

November 13th, 2013 2 comments

I have configured a something unrelated on my router and after restart it came with strange message:

Settings have been updated. Web page will now refresh.
Changes have been made to the IP address or port number. You will now be disconnected from RT-N66U.
To access the settings of RT-N66U, reconnect to the wireless network and use the updated IP address and port number.

What a wonderful message, it must have been created by some excellent creative mind!

However, this page would not go away. Deleting HTTP authentication would not help, deleting cookies either, certificates nop. Finally I remembered that there was some strange request to allow saving offline data. And here it is:

Screen Shot 2013-11-13 at 20.14.58

Just delete the data. It was my first touch with offline data and it did not work! Great experience, now I will never let any application to store its data.

Categories: Missing Answers Tags:

One liner to backup all MySQL databases

October 14th, 2013 No comments

echo "show databases" \
| mysql --skip-column-names \
| grep -v -P '^(performance|information)_schema$' \
| awk '{ print "mysqldump --events --routines --triggers " $1 " | bzip2 > /var/backups/" $1 ".sql.bz2" }' \
| sh

Categories: Missing Answers Tags:

Add GMail MX to Plesk from command line

October 10th, 2013 No comments

This is something every admin must need, but I have not found such script. So here you are.



echo "\
" | awk '{print "/usr/local/psa/bin/dns -a '$1' -mx \"\" -mailexchanger " $1 " -priority " $2 }' | sh

Categories: Missing Answers Tags:

Plesk 11.5.30 with Watchdog 2.0.7 on Centos 6.4 – workaround for startup/shutdown problems

September 21st, 2013 1 comment

I have a brand new machine with configuration stated above, moreover I’m using Nginx as proxy server to Apache. And it comes loaded with a lot of problems.

  • Machine cannot be shutdown – with last message in the console:

    init: psa-monit main process ended, respawning

  • After restart the machine reports following problems to console:

    Starting nginx: nginx: [emerg] bind() to [2001:8d8:8ae:e500::ae:4abd]:80 failed (99: Cannot assign requested address)[FAILED]

  • httpd process gets loaded with strange settins – it does not see VirtualHosts and serves all requests from default host, although it has opened all virtual host log files

Root Cause

Is unclear to me, but probably it is caused by incorrect change of starting scripts from Plesk. The scripts moved between Centos 5 and Centos 6 from /etc/inittab to /etc/init/psa-monit.conf and /etc/init/psa-wdcollect.conf . And I believe the scripts are not correct. They execute too early and respawn does not correctly handle situation when stopping machine.

Premature execution seems to cause that Apache gets started on port 80, Nginx refuses start consequently. Restarting Nginx seems to fix the port binding (strange) but Apache still does not serve proper pages. As if the started instance did not have NameVirtualHost setup properly and is serving default VirtualHost.


I’m not familiar with Centos init procedure good enough, and I believe the problem is inside Plesk code, not just in the init configuration. Changing the init script as shown below would solve all the problems. It will however disable automatic restart when the watchdog fails itself. But this seems acceptable for me – it is bettern than machine which cannot be restarted.

Yes I admit, the sleep is funny ;-)

Categories: Missing Answers Tags:

Phabricator: Settings for LDAP authenticator and SBS Active Directory

August 21st, 2013 No comments

I’m trying Phabricator (perhaps switching from Bugzilla after 10 years) and I wanted an integration with LDAP service on the Active Directory of the Microsoft Windows Small Business Server – users should use their usernames to login.

It took me a while to find out correct parameters, the error provided by Phabricator was not very helpfull:

Argument 1 passed to PhutilAuthAdapterLDAP::readLDAPRecordAccountID() must be an array, null given, called in /usr/share/phabricator/libphutil/src/auth/PhutilAuthAdapterLDAP.php on line 111 and defined

Correct settings for Small Business Server are:

Setting Value
LDAP Port 3268
Base Distinguished Name OU=SBSUsers,OU=Users,OU=MyBusiness,DC=YOURDOMAIN,DC=local
Search Attribute mailNickname
Username Attribute mailNickname
Realname Attributes sn, givenName
Anonymous Username anonymous
Anonymous Password <empty>
ActiveDirectory Domain YOURDOMAIN.local
Categories: Missing Answers Tags:

Import CSV with UTF-8 into Excel for Mac

June 28th, 2013 3 comments

Excel for Mac 2011  does not support UTF-8 in CSV files. On Windows you can simply add Byte Order Mark (BOM) to the file and it will open correctly in Excel. This does not work on Mac. You can try importing the file with different encoding and some people declare success with UTF-16 Little Endian, but for me this simply does not work.

The best solution that I have found is a script made by Konrad Foerstner, which I have improved little bit, to support different colum delimiters.

Download the script from Github, install library for writing Excel format sudo easy_install openpyxl.

Now you can covert the file from CSV to XLSX.

Categories: MacOSX, Missing Answers Tags:

Mac OS X: Cannot edit crontab

February 26th, 2013 4 comments

I wanted to edit crontab for a user on Mountain Lion and it did not work. Repairing permissions with Disk Utility did not help. I saw following error messages:

$ crontab -e
crontab: no crontab for player - using an empty one
crontab: "/usr/bin/vi" exited with status 1

$ EDITOR=vim crontab -e
crontab: no crontab for player - using an empty one
crontab: temp file must be edited in place

$ EDITOR=mcedit crontab -e
crontab: no crontab for player - using an empty one
crontab: installing new crontab
crontab: tmp/tmp.13840: No such file or directory
crontab: edits left in /tmp/crontab.Gyxvel8v43

$ crontab path-to-file-to-replace-current-tab
crontab: tmp/tmp.13784: No such file or directory

To reduce the problem, I have used mcedit. I have found that someone had this issue in 2007 – UNSOLVED. If you were a programmer you would be suspicious about the path without the leading slash. But how to find the real path? I made me comfortable with dtruss (strace for Mac) but it did not move me forward, I just saw that it is problem when opening the file for writing. But hey, this is BSD! We should find sources … and indeed they are available. Now it took just a while to go through the C code and finally find file

The solution of this problem is to create missing tmp directory in /var/at!

mkdir /var/at/tmp
chmod 700 /var/at/tmp

I have no idea where I have lost the tmp directory. But I should not be supposed to drill into the source code. Am I?

UPDATED: I believe this problem was caused by my attempt to wipe Parallels out of the system. I was deleting all files installed by the package and afterwards I was deleting empty directories system wide.

Categories: MacOSX, Missing Answers Tags: