Friday, April 25, 2014

Flash Player with QtWeb

QtWeb 3.8.5 on Linux uses the following location to load the Flash Player plugin:
/usr/lib64/nsbrowser/plugins/libflashplayer.so
The file should be marked as executable.
Note, according to Qt Project documentation QtWebKit will also search other paths - for details see:
http://qt-project.org/doc/qt-4.8/qtwebkit.html#netscape-plugin-support

Because QtWeb is 32-bit this can conflict with other web browsers installed on 64-bit Linux.  To avoid this issue put the libflashplayer.so file in another location such as:
/usr/local/lib32/qtweb/plugins/libflashplayer.so
Then edit the desktop file to use an Exec line such as:
Exec=env MOZ_PLUGIN_PATH=":/usr/local/lib32/qtweb/plugins" /usr/local/bin/QtWeb
 - this will apply the environment variable only to the process where QtWeb is launched.


To see other files and locations that QtWeb is trying to access you can use strace:
strace -e open QtWeb
or to grep a specific keyword (e.g. plugin):
strace -e open QtWeb 2>&1 grep -i plugin

Saturday, January 11, 2014

Enable NTP in Sabayon

To enable NTP time synchronization in Sabayon linux:

1. Install ntp package.
2. Customize configuration if required: /etc/ntp.conf
2. As root enable the service in systemd:
systemctl enable ntpd.service
3. Start the service:
systemctl start ntpd.service

It takes several minutes for the service to adjust the time. If the clock is skewed by more than 17 minutes then use the following command to perform a manual time sync:
ntpdate 0.gentoo.pool.ntp.org
To verify the NTP daemon is running:
ps -lA|grep ntp

Sunday, November 24, 2013

PCManFM File manager has no icons in Razor-Qt

When using Razor-Qt desktop environment, if the PCManFM file manager has blank icons then you may need to use LXappearance to set an icon theme.  LXappearance can be started from command line:
lxappearance
or from Start menu -> Preferences -> Customize Look and Feel -> Icon Theme





Monday, November 18, 2013

Setting locale in Sabayon 13.11

To set the system default locale to en_AU.UTF-8 in Sabayon 13.11:
sudo nano /etc/locale.gen
  en_AU.UTF-8 UTF-8
  en_AU ISO-8859-1

sudo nano /etc/locale.conf
  LANG=en_AU.UTF-8

sudo env-update   (applies the changes to /etc/profile.env)
source /etc/profile (makes the change effective in the current shell - restart if not effective)


Sunday, November 17, 2013

Zenity 3.8 list output bug on Sabayon

Zenity 3.8.0 on Sabayon 13.12 has a bug that doubles the output of list with seperating pipe, as explained here:
https://bugs.launchpad.net/ubuntu/+source/zenity/+bug/1247137
 My workaround was to download latest source from:
https://git.gnome.org/browse/zenity
Download the package:
ZENITY_3_10_0.tar.gz
Ensure the following are installed:
automake
gcc
gnome-common (small)
yelp-tools
Extract, make and install:
cd ZENITY_3_10_0
autogen.sh
make
sudo make install

Sunday, October 6, 2013

LXDE Default Browser shortcut link for panel

LXDE includes the "Preferred Applications" (libfm-pref-apps) program to set the preferred web browser. It works by changing the following entry:
~/.local/share/applications/mimeapps.list
[Default Applications]
x-scheme-handler/http=iceweasel.desktop
The problem with this is if you have a shortcut on the LXPanel, or Desktop, then the link is not updated automatically.  Exo-open is designed for XFCE and is ineffective to fix this issue, xdg-open cannot be used in a shortcut unless a parameter is passed - which is no good if you just want to open the browser.

A workaround is to create a new script that uses xdg-mime to query for the default http handler and create a .desktop file that runs this new script:

 sudo nano /usr/local/bin/x-www-mime-browser
#!/bin/sh

# This script uses xdg-mime to check the default browser
# and executes the .desktop from ~/.local/share/applications
# or /usr/share/applications.

URL="$1"
HANDLER=`xdg-mime query default x-scheme-handler/http`
# If handler is customized, extract from .local/... and execute
if [ -f ~/.local/share/applications/$HANDLER ]; then
    `grep Exec ~/.local/share/applications/$HANDLER \\
    | awk -F= '{ print $2 }' \\
    | awk '{ print $1 }';`
else
    `xdg-mime query default x-scheme-handler/http | awk -F. '{ print $1 }'`
fi
 sudo chmod +x /usr/local/bin/x-www-mime-browser
 sudo nano /usr/share/applications/x-www-mime-browser.desktop
[Desktop Entry]
Name=Web Browser (default)
Exec=x-www-mime-browser %u
MimeType=application/x-xdg-web-browser
Terminal=false
Type=Application
Categories=WebBrowser;Other
Icon=web-browser
NoDisplay=false
When using the LXDE Application Launch Bar Settings the "Web Browser (default)" selection will be tucked away under the "Other" category - this will prevent an extra copy visible in the "Internet" category.

Wednesday, September 25, 2013

Wordpress on Debian Wheezy

  1. apt-get install wordpress
  2. apt-get install mysql
  3. apt-get install sendmail
  4. ln -s /usr/share/wordpress /var/www
  5. ln -s /usr/share/wordpress /srv/www
  6. Create & Run script:
    1. cp /usr/.../wordpress/examples/mysql-setup /usr/share/doc/wordpress/examples/mysql-setup2
    2. chmod o+x /usr/.../examples/mysql-setup2
    3. /usr/.../examples/mysql-setup2
  7. Fix permissions: 
    1. chown -R /usr/share/wordpress www-data
    2. chown -R /var/lib/wordpress www-data
  8. Edit /etc/apache2/sites-enabled/000-default
    1. RewriteRule ^/wp-content/plugins/var/lib/(.*)$ /var/lib/$1
    2. RewriteRule ^/wp-content/(.*)$ /var/www/wordpress/wp-content/%{HTTP_HOST}/$1
  9. http://mydomain.name/...
  10. Install recommended plugins:
    1. Clean and simple contact form
    2. Custom meta widget
    3. Easy table
    4. Lightbox gallery
    5. Twenty Eleven Theme Extensions

If plugins don't work check the source from loaded pages to identify incorrect URL's, adjust rewrite rules to fix.