[PCLinuxOS] Manually upgrading Bind / Named to version 9.9.2-P2 [Security patches].

Hi folks.

Latest Bind / Named version was released several days ago to patch this vulnerability.

I will try to show how to download, extract, configure and install the latest version.

Open terminal window and follow this set of instructions:

su

root's password

export PREFIX=`echo /usr/`

export PATH=$PREFIX/bin:$PATH

export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig

cd /opt/

mkdir Bind

cd Bind

wget -c ftp://ftp.isc.org/isc/bind9/9.9.2-P2/bind-9.9.2-P2.tar.gz

tar xvzf ./bind-9.9.2-P2.tar.gz

cd bind-9.9.2-P2

./configure --prefix=$PREFIX --sysconfdir=/etc/

You can expect missing dependencies here. I had no problems whatsoever as I have a good few “devel” packages installed – try figuring out what You’re missing if You do run into a snag, then install it from Synaptic (without closing this window) and re-run the above configure step till there are no errors.

make

make install

ls --full /var/lib/named/var/

one of the listed items should look like this:

drwxr-xr-x 7 root root 4096 2013-03-22 09:08:02.163308440 +0100 named/

ls --full /var/lib/named/var/named

chown named:named /var/lib/named/var/named/

drwxr-xr-x 7 named named 4096 2013-03-22 09:08:08.221303100 +0100 named/

Now in this terminal window type in

named -v

the reply should look like this:

BIND 9.9.2-P2

service named restart

and the reply should look something like this:

Stopping named: [ Failed ]
Starting named: [ OK ]

This should be it… You have compiled and are running latest patched version of Bind…

Regards.

Andy

Testing Mozilla Thunderbird Central Daily 20 safely on PCLinuxOS 2012.x

Hi all.

I wanted to test the latest version of the e-mail client from Mozilla. I am a huge fan of Thunderbird and it always was my main e-mail client. PCLinuxOS comes with the latest stable version. Its a good thing. I love stability of my distribution. However I want to try the newest Mozilla product before it becomes a default for PCLinuxOS. Also I want to help Mozilla Developers by filing a bug reports and make their products even better this way.

Here are few simple steps You can do if You want to test it too.

Thunderbird is a default PCLinuxOS e-mail client so its installed by default. If You removed it – reinstall it via synaptic.

Older version must be installed for few minor yet important reasons.

Close Thunderbird completely. Now open console and run these commands:

cd

Go to Your /home/ folder

This version of Thunderbird is a bleeding edge release so ride might be little bumpy. I never noticed any problems but just to be on the safe side…

cp -R ~/.thunderbird ~/.thunderbird.backup.20

let’s backup Your profile first.

wget -c http://ftp.mozilla.org/pub/mozilla.org/thunderbird/nightly/latest-comm-central/thunderbird-20.0a1.en-US.linux-i686.tar.bz2

Download the compressed Daily XX file.

tar -xvjf ./thunderbird-20.0a1.en-US.linux-i686.tar.bz2

Extract it.

rm -f ./thunderbird-20.0a1.en-US.linux-i686.tar.bz2

Remove it.

su

Gain root privileges…

root password

…by giving correct root password.

rm -f /usr/bin/thunderbird

Remove old executable.

rm -f /usr/bin/mozilla-thunderbird

Remove old executable.

ln -s /home/yourlogin/thunderbird/thunderbird /usr/bin/thunderbird

Create symlink to a new executable in Your home folder. Replace yourlogin with Your actual login.

ln -s /home/yourlogin/thunderbird/mozilla-thunderbird /usr/bin/mozilla-thunderbird

Create symlink to a new executable in Your home folder. Replace yourlogin with Your actual login.

exit

exit

Go back to user mode and close the console.

Now You can use the old shortcuts (from the desktop, panel or KMenu) to open new Thunderbird. All the programs should open the mailto: links in new version of Thunderbird too.

Enjoy the latest and the greatest from Mozilla. I am. If You are using Daily You should know that it can also be safely upgraded to the latest version by using Help > About Daily from the Thunderbird menu bar.

Thunderbird 20 Daily on PCLinuxOS 2011.x

Going back to the repo version of Thunderbird.

Close Thunderbird completely. Reinstall Thunderbird using Synaptic.

Regards.

Andy

Testing Mozilla Firefox Nightly 20 safely on PCLinuxOS 2012.x

Hi all.

I wanted to test the latest browser from Mozilla. I am a huge fan of Firefox and it always was my main browser. PCLinuxOS comes with the latest stable version. Its a good thing. I love stability of my distribution. However I want to try the newest Mozilla product before it becomes a default browser for PCLinuxOS. Also I want to help Mozilla Developers by filing a bug reports and make their products even better this way.

Here are few simple steps You can do if You want to test it too.

Firefox is a default PCLinuxOS browser so its installed by default. If You removed it – reinstall it via synaptic.

Older version must be installed for few minor yet important reasons.

Close Firefox browser completely. Now open console and run these commands:

cd

Go to Your /home/ folder

cp -R ~/.mozilla ~/.mozilla.backup.20

Let’s backup Your profile first.

wget -c http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/firefox-20.0a1.en-US.linux-i686.tar.bz2

Download the compressed Nightly XX file.

tar -xvjf ./firefox-20.0a1.en-US.linux-i686.tar.bz2

Extract it.

rm -f ./firefox-20.0a1.en-US.linux-i686.tar.bz2

Remove it.

cd ~/firefox/searchplugins/ && wget -c http://andrzejl.cyryl.net/WoTW/WoTW_files/FFxSearchPCLOSForum/pclinuxos-forum.xml

Add the search engine for PCLinuxOS Forum.

su

Gain root privileges…

root password

…by giving correct root password.

rm -f /usr/bin/firefox

Remove old symlink.

rm -f /usr/bin/mozilla-firefox

Remove old symlink.

ln -s /home/yourlogin/firefox/firefox /usr/bin/firefox

Create new symlink. Replace yourlogin with Your actual login.

ln -s /home/yourlogin/firefox/firefox /usr/bin/mozilla-firefox

Create new symlink. Replace yourlogin with Your actual login.

exit

exit

Go back to user mode and close the console.

Now You can use the old shortcuts (from the desktop, panel or KMenu) to open new Firefox. All the programs should open links in new version of Firefox too.

Enjoy the latest and the greatest from Mozilla. I am. If You are using Nightly You should know that it can also be safely upgraded to the latest version by using Help > About Nightly from the Firefox menu bar.

Firefox 20 Nightly on PCLinuxOS 2011.x

Going back to the repo version of Firefox.

Close Firefox completely. Reinstall Firefox using synaptic.

Regards.

Andy

Boy do I love sshfs… Mounting ssh / sftp share as a local drives.

Hi folks.

I have a machine that runs ssh server. That’s nothing new. Neither is it worth mentioning under normal circumstances… Recently I have purchased a 2 TB Western Digital MyBook USB 3.0 hard drive and I was going to use it to backup all my data. Why not make it a network shared drive I thought. It will make my life much easier if I could access the data from all my machines? Not a bad idea… I know… but I am not going to setup samba or nfs. I don’t want to make it a “network” drive. I want to have it mounted as a local drive on every machine that I use without a big fuss… How do I go about it?

I assume that You have drive attached to the ssh server running machine and that it’s mounted and that You have read and write permissions granted to Your user. I am using static IPs in my network – this is making things much easier for me as well.

In my case the drive is mounted on the server (IP 192.168.0.1 and port 20202) as /media/1862_GB_X-Ternal/ and my user andrzejl is the only user that is allowed to write to and read from it.

Now it’s time to prep the client machine. It’s really simple…

I want to have my drive mounted on my ssh client machines in /media/1862_GB_X-Ternal/ folder but I want to mount it as user (andrzejl) – not as root.

First I had to open terminal and gain root’s privileges by issuing:

su

and giving a root’s password.

Next I had to create my mount point:

mkdir -p /media/1862_GB_X-Ternal/

and make andrzejl owner of it:

chown -Rf andrzejl:andrzejl /media/1862_GB_X-Ternal/

Now that I had the folder ready I needed a package that would allow me to work with sshfs / sftp file system so in the same terminal I ran:

apt-get install sshfs-fuse

After the package was downloaded and installed I could close this terminal window and open another one. I needed to drop the root’s privileges as I want to do the rest of this as a user.

The syntax of the command looks like this:

sshfs -p sshSERVERport loginTOtheSSHserver@IPorHOSTNAMEofTHEsshServer:/where/is/the/drive/mounted/on/the/server/ /where/to/mount/on/local/machine/

Now… if I will start filling the data in this command I get this:

sshfs -p 20202 andrzejl@192.168.0.1:/media/1862_GB_X-Ternal/ /media/1862_GB_X-Ternal/

After running this command and typing in the password (if You got the syntax right) You should find all Your data on Your ssh client machine mounted in /media/1862_GB_X-Ternal/ ready to be read and modify by Your user.

Now…

IF You want the data to be automounted at start up without typing in the password follow this post. Passwordless SSH authentication. Using authentication keys

You also need to create a mountsshfsshare.sh script in your ~/.config/autostart folder and make it executable.

Here is how I do it under KDE4.

Open terminal. Type in:

touch ~/.config/autostart/mountsshfsshare.sh

chmod +x ~/.config/autostart/mountsshfsshare.sh

echo "sshfs -p 20202 andrzejl@192.168.0.1:/media/1862_GB_X-Ternal/ /media/1862_GB_X-Ternal/" > ~/.config/autostart/mountsshfsshare.sh

Don’t forget to modify the sshfs line to suite Your needs.

Just to check run this:

cat ~/.config/autostart/mountsshfsshare.sh

It should spit out:

sshfs -p 20202 andrzejl@192.168.0.1:/media/1862_GB_X-Ternal/ /media/1862_GB_X-Ternal/

or whatever command You use to mount the sshfs share. Now You can reboot the ssh client machine for testing purposes. If You did everything properly – You will have a mounted drive waiting for You next time You boot up Your machine.

Edit 01: Sometimes .sh script will not work. Try creating .desktop file then instead.

Remove the .sh file first.

rm -f ~/.config/autostart/mountsshfsshare.sh

Now create the .desktop file.

touch ~/.config/autostart/mountsshfsshare.desktop

Now edit the file using Your favorite editor. I will use mcedit here. Paste this into it:

[Desktop Entry]
Comment[en_US]=Mount SSHFS automagically.
Comment=Mount SSHFS automagically.
Encoding=UTF-8
Exec=sshfs -p 20202 andrzejl@192.168.0.1:/media/1862_GB_X-Ternal/ /media/1862_GB_X-Ternal/ &
GenericName[en_US]=
GenericName=
Icon=xterm-terminal
MimeType=
Name[en_US]=sshfs_mount
Name=sshfs_mount
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=
X-KDE-SubstituteUID=false
X-KDE-Username=

Do not forget to change the sshfs line. Now save the file and reboot for testing.

Edit 02: IF a startup script nor a desktop file works for You add (as root using Your favorite text editor) lines like this at the end of Your /etc/rc.local file:

echo "Mounting SSHFS share as andrzejl"
su andrzejl -c "sshfs -p 20202 andrzejl@192.168.0.1:/media/1862_GB_X-Ternal/ /media/1862_GB_X-Ternal/ &"

Don’t forget to leave one empty line at the end of the file. Also You will need to modify the lines to Your needs of course.

I like this setup very much for a good few reasons. Here are just a few:

a) hard drive is being shared over the network but it feels and acts like a local drive
b) it’s not accessible by the windows machines without specific setup
c) it’s easy to setup permissions to the drive so only one user or group can have full access to the drive. You can have some folks to see the drive as read only while You keep the privileges to write to it.
d) like everything that runs via ssh the traffic between you and the hdd is encrypted

Regards.

Andy

How to find all the empty folders inside a current folder using terminal? How to filter the output of the command to only show folders that name DOES NOT matches a certain pattern?

Hi.

How to find all the empty folders inside a current folder using terminal? How to filter the output of the command to only show folders that name DOES NOT matches a certain pattern?

It’s simple:

find . -depth -type d -empty | grep -i -v -e "pattern"

You can filter out more then one pattern:

find . -depth -type d -empty | grep -i -v -e "pattern1" -e "pattern2" -e "pattern3" -e "pattern4"

This command will find all the empty folders in the current (.) folder and will grep (ignoring the UPPER or lower case) for names that DO NOT match the pattern word and will display only those names.

Regards.

Andy

My screen is way to dark when booting to PCLinuxOS… What can I do?

Hi.

So Your screen is normally bright but for whatever reason when You boot up to PCLinuxOS the brightness level is very low?

Try this:

1) Install xbacklight via synaptic
2) Open terminal and su to root
3) List the content of the folder /sys/class/backlight with this command:

ls --full /sys/class/backlight

4) You should get few hits:

[root@wishmacer backlight]# ls –full /sys/class/backlight
total 0
lrwxrwxrwx 1 root root 0 2012-11-04 02:10:05.023004946 +0000 acer-wmi -> ../../devices/platform/acer-wmi/backlight/acer-wmi/
lrwxrwxrwx 1 root root 0 2012-11-04 02:09:09.784000471 +0000 intel_backlight -> ../../devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/
[root@wishmacer backlight]#

5) Now You need to get Your command right. We are gonna push the variable into the correct folder. The variable and the folder will be different on all machines but I think it’s safe to assume the variable values go from 1 to 15.

6) So knowing that let’s try the intel_backlight folder first:

echo -n 15 > /sys/class/backlight/intel_backlight/brightness

This however didn’t go so well.

[root@wishmacer backlight]# echo -n 15 > /sys/class/backlight/intel_backlight/brightness
bash: echo: write error: Invalid argument
[root@wishmacer backlight]#

7) So let’s try the acer-wmi folder:

echo -n 15 > /sys/class/backlight/acer-wmi/brightness

BINGO! Screen got bright.

8) Now that You know what folder/file to modify – try changing the variable from 15 and see if You get better results with other numbers. See if You can go 16 or 14 for example.

8) When Your command is ready open Your favorite text editor as root and modify the /etc/rc.local file by adding the command as a last line.

9) Save the file and reboot.

Hope this helps!

Regards.

Andy

Irssi – Ignoring private messages from certain (annoying) people without ignoring their public messages on the channel.

Hi folks.

Some people don’t give a crappoli about the netiquette. They just do whatever they want to whenever they feel like it. The most common annoyance is PMing You out of the blue. I met a whole bunch of those pests in my days so I am gonna show You how I deal with them.

When connected to the server / channel type in:

/ignore NICKNAME MSGS

Don’t forget to replace NICKNAME with the actual nickname of the person that keeps sending You private messages without asking.

Let’s say I want to ignore a guy with a nickname Troll. The command will look like this:

/ignore Troll MSGS

After running it my Status window will tell me:

14:51 Ignoring MSGS from Troll

This way You can still read what Troll wrote in the channel but all private messages from this person will be ignore…

Now let’s say Troll has matured and stopped acting like a fool and You had a change of heart:

/unignore NICKNAME MSGS

will do the trick. Just remember to replace NICKNAME with the actual nickname.

After running:

/unignore Troll MSGS

Your status window will say:

14:52 -!- Irssi: Unignored Troll

I am pretty sure You will meet pests on IRC just like I did and I am pretty sure this command will come handy then.

Regards.

Andy