Wednesday, August 10, 2011

extundelete

An interesting tool that can be used to to undelete files/dirs in ext3/ext4 filesystems. For its website :

extundelete is a utility that can recover deleted files from an ext3 or ext4 partition. The ext3 file system is the most common file system when using Linux, and ext4 is its successor. extundelete uses the information stored in the partition's journal to attempt to recover a file that has been deleted from the partition. There is no guarantee that any particular file will be able to be undeleted, so always try to have a good backup system in place, or at least put one in place after recovering your files!

Get it at http://extundelete.sourceforge.net/

Or for openSUSE users you can add this repo:

http://download.opensuse.org/repositories/home:/dkukawka/openSUSE_Factory/


Thursday, July 21, 2011

Java Plugin for Firefox in Fedora 15 64-bit

Due to a personal preference, I still feel that the Oracle/SUN JRE is superior to OpenJDK.

It is a pain to enable Oracle/Sun JRE plugin for Firefox in Fedora 15; they just force you to do their OpenJDK and IcedTea for browser. For some sites, unfortunately, these FOSS variants just won't work .

To enable the "real" JRE support for FF, just create a symbolic link of the plugin lib from $JAVA_HOME to /usr/lib64/mozilla/plugins e.g. :

ln -s $JAVA_HOME/lib/amd64/default/libnpjp2.so /usr/lib64/mozilla/plugins

Ensure that your JAVA_HOME variable is defined.

Wednesday, June 1, 2011

Samba issue in openSUSE 11.4 - Failed to open /etc/samba/secrets.tdb

If you ever encounter this issue where you get errors like:

primus:/etc/samba # rcsmb restart
Shutting down Samba SMB daemon Warning: daemon not running.

And from your /var/log/messages you get:

Failed to open /etc/samba/secrets.tdb

Just disable AppArmor.

Google Chrome incognito

It just occurred to me that I cannot automatically clear all private data from Google Chrome when I exit unlike in Firefox.

Well if I launch Chrome in incognito mode (or porn mode) it doesn't retain any private data.

Just do a chromium --incognito


Configuring pure-ftpd with Authorised User access on SUSE Linux

  1. Install the pure-ftpd package
    zypper in pure-ftpd

  2. Edit the /etc/pure-ftpd/pure-ftpd.conf file and modify and save the following directives with the values stated:
    ChrootEveryone YES
    Demonize YES

    AnonymousOnly NO

    NoAnonymos YES
    PureDB /etc/pure-ftpd/pureftpd.pdb #(This line needs to be uncommented)


  3. Create a UNIX dummy user account and a home directory for an authorised user
    • Create a UNIX dummy account
      useradd -s /dev/null ftpduser


    • Create a chrooted ftp home directory for the authorised user (it can be anywhere on the system - just get the UNIX file permission/ownership correct)
      mkdir /srv/ftp/ftpduser

      chown -R ftpduser /srv/ftp/ftpduser


  4. Creating and associating pure-ftpd virtual user account (we call it jim) to UNIX system account
    pure-pw useradd jim -u ftpduser -d /srv/ftp/ftpduser

    • Then update the /etc/pure-ftpd/pureftpd.pdb database
      pure-pw mkdb
      (required for each time user added/removed/modified)

    * You may associate multiple virtual user accounts to one UNIX user account. All virtual user accounts will use the local permissions permissible to the UNIX user account.

    * You may also do a one-to-one matching i.e. one virtual account to one UNIX account - but you may need to create multiple home directories.


  5. Restart the pure-ftpd daemon and you are good to go. Ensure that the appropriate firewall port is opened.

Tuesday, May 31, 2011

Configure Apache with OpenSSL in SUSE

  1. Create a random data file
    cat /dev/random > randomfile

  2. Create key pair
    openssl genrsa -des3 -out server.key -rand randomfile

  3. Sign the created Public Key and create a digital certificate
    openssl req -new -x509 -key server.key -out server.crt
    Answer the questions posed and then copy the Public Key and digital certificate into appropriate directories:
    server.key --> /etc/apache2/ssl.key/
    server.crt --> /etc/apache2/ssl.crt/


  4. Configure Apache to use OpenSSL
    Edit the /etc/sysconfig/apache2 file
    APACHE_START_TIMEOUT="10" - the httpd start time out
    APACHE_SERVER_FLAGS="SSL"


  5. Configure the main site to use HTTPS
    Edit the /etc/apache2/default-server.conf file and add the following directives from the /etc/apache2/vhost.d/vhost-ssl.template file
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /etc/apache2/ssl.crt/server.crt
    SSLCertificateKeyFile /etc/apache2/ssl.key/server.key


  6. Configure a Virtual Host to use HTTPS
    • Follow steps 1 to 3 to create the key and digital certificate
    • Edit the /etc/apaches2/vhost.d/.conf file
    • Change VirtualHost :80 to VirtualHost *:443
    • Append the ServerName directive with 443 e.g. vhost.mydomain.lan to vhost.mydomain.lan:443

Friday, May 27, 2011

How to upgrade openSUSE 11.4 to use GNOME 3

Just managed to get GNOME 3 running on my openSUSE 11.4 desktop. GNOME 3 is pretty and does need getting used to but so far I have been pretty happy with it on Fedora 15. I have an old Pentium D with 2GB of RAM and an ancient NVIDIA GeForce 7600GT. To upgrade to GNOME 3 you need to add the repo.

Adding the repo:
zypper ar -f obs://GNOME:STABLE:3.0/openSUSE_11.4 GNOME_STABLE_3.0

The do a distribution upgrade:
zypper dup

Before you reboot the system to enjoy the GNOME 3 goodness, install the gnome-shell and theme packages:
zypper in gnome-shell metatheme-adwaita-common

The GNOME tweak tool is a must to modify the GNOME 3 desktop:
zypper in gnome-tweak-tool

Enjoy!!