PCLinuxOS and Squid netmask warnings…

Hi all.

I have downloaded and configured Squid using PCLinuxOS Control Center…

PCLinuxOS Control Center aka Configure Your Computer

All was well and everything was working just fine however I was receiving silly netmask warnings and some security notifications…

[root@icsserver andrzejl]# service squid restart
Stopping squid: 2012/01/14 19:31:49| WARNING: Netmasks are deprecated. Please use CIDR masks instead.
2012/01/14 19:31:49| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges.
2012/01/14 19:31:49| WARNING: For now we will assume you meant to write /24
2012/01/14 19:31:49| aclIpParseIpData: WARNING: Netmask masks away part of the specified IP in ‘192.168.0.1/255.255.255.0’
2012/01/14 19:31:49| ERROR: ‘0.0.0.0/0.0.0.0’ needs to be replaced by the term ‘all’.
2012/01/14 19:31:49| SECURITY NOTICE: Overriding config setting. Using ‘all’ instead.
2012/01/14 19:31:49| WARNING: (B) ‘::/0’ is a subnetwork of (A) ‘::/0’
2012/01/14 19:31:49| WARNING: because of this ‘::/0’ is ignored to keep splay tree searching predictable
2012/01/14 19:31:49| WARNING: You should probably remove ‘::/0’ from the ACL named ‘all’
2012/01/14 19:31:49| WARNING: Netmasks are deprecated. Please use CIDR masks instead.
2012/01/14 19:31:49| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges.
2012/01/14 19:31:49| WARNING: For now we will assume you meant to write /32
…. [ OK ]
init_cache_dir … Starting squid: . [ OK ]
[root@icsserver andrzejl]#

Squid worked as expected but the annoying warnings would not let me forget about the whole thing… So I have decided to investigate.

As it turns out those are the errors that occur when You are using squd 3 with a squid 2 config file…

PCLinuxOS has squid 3 in the repos…

[andrzejl@icsserver ~]$ rpm -qa | grep squid
squid-3.1.16-1pclos2011
[andrzejl@icsserver ~]$

BUT the beginning of it’s config file says…

# WELCOME TO SQUID 2

this calls for few changes in the squid config file which in PCLinuxOS can be found here:

/etc/squid/squid.conf

First we have to find out what CIDR is…

With this knowledge we can start editing squid config file as root.

This line:

acl mynetwork src 192.168.0.1/255.255.255.0

was changed to

acl mynetwork src 192.168.0.0/24

and the amount of warnings was reduced significantly:

[root@icsserver andrzejl]# service squid restart
Stopping squid: 2012/01/14 19:36:11| ERROR: ‘0.0.0.0/0.0.0.0’ needs to be replaced by the term ‘all’.
2012/01/14 19:36:11| SECURITY NOTICE: Overriding config setting. Using ‘all’ instead.
2012/01/14 19:36:11| WARNING: (B) ‘::/0’ is a subnetwork of (A) ‘::/0’
2012/01/14 19:36:11| WARNING: because of this ‘::/0’ is ignored to keep splay tree searching predictable
2012/01/14 19:36:11| WARNING: You should probably remove ‘::/0’ from the ACL named ‘all’
2012/01/14 19:36:11| WARNING: Netmasks are deprecated. Please use CIDR masks instead.
2012/01/14 19:36:11| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges.
2012/01/14 19:36:11| WARNING: For now we will assume you meant to write /32
…. [ OK ]
init_cache_dir … Starting squid: . [ OK ]
[root@icsserver andrzejl]#

Next I removed this line

acl all src 0.0.0.0/0.0.0.0

which is built in the Squid anyway…

This reduces the warning messages even more:

[root@icsserver andrzejl]# service squid restart
Stopping squid: 2012/01/14 19:39:14| WARNING: Netmasks are deprecated. Please use CIDR masks instead.
2012/01/14 19:39:14| WARNING: IPv4 netmasks are particularly nasty when used to compare IPv6 to IPv4 ranges.
2012/01/14 19:39:14| WARNING: For now we will assume you meant to write /32
…. [ OK ]
init_cache_dir … Starting squid: . [ OK ]
[root@icsserver andrzejl]#

Final step is to edit this line:

acl localhost src 127.0.0.1/255.255.255.255

to read

acl localhost src 127.0.0.1/32

After editing the config file squid is restarting without any warning and everything is “peachy”…

[root@icsserver andrzejl]# service squid restart
Stopping squid: …. [ OK ]
init_cache_dir … Starting squid: . [ OK ]
[root@icsserver andrzejl]#

My config file contains few extra modifications. Please use it if You feel like it after editing it to reflect Your network settings.

Hope this helps somebody someday.

Regards.

Andy

Back to the roots – Starcraft – Final battle in the Terran campaign… [VIDEO]

Hi all.

Some time ago I have decided to buy Starcraft (Brood War version) – game by Blizzard Entertainment. It was cheap as the game is not new (as in recently released) plus it was a 2nd hand purchase. To make it playable I used the Crossover software that I got for free long time ago.

Couple of days ago I decided to start playing Starcraft again. It’s a really good game. It’s like Warcraft 2 but in the space. While Warcraft is all about might and magic Starcraft is all about power and technology… The game is not better then Warcraft 2. It’s just as good but there are few features that are really cool ie. you can move some of the buildings to a new locations once they were constructed.

Main objectives of the game are to build Your own empire starting from the least advanced structures and troops and work Your way up while going thru a different missions. The last mission in the first episode (Terran campaign) objectives are “Destroy Ion Cannon” and “Raynor must survive”. Second part is easy. Just hide Raynor somewhere in Your camp and tell him to hold positions. First part is much more difficult but still doable. You are situated in the bottom of the map. You have enough resources to defend Yourself for a while but You have to work fast… On the west part of the map there is a red enemy (not very powerful but still can do a lot of harm…) and on the east part of the map there is a white enemy and trust me when I say – be afraid… be very afraid. Those dudes will not let You live in peace. While You MAY try to conquer the red base – don’t really even think about attacking the white base. Yes it’s doable BUT it’s extremely difficult and even tho I succeeded in defeating them in the past – trust me – it’s a suicide mission… plus the objectives say nothing about defeating them… To draft the image of how nasty they are… White dudes will send their troops (a lot) on a regular basis to destroy Your base and if that isn’t enough they will send You a nuclear gift once in a while and those missiles can really do some damage to your camp…

Once I had my base “well defended” and in OKish shape I have decided to build a Cruisers and some Transporters and attack the big ION Cannon which is located far up north… and I have succeeded ;).

It may look easy on the video but trust me it’s NOT… One mistake may lead to restarting the mission from the scratch… and I have been there many times before I have gathered enough experience to succeed…

Enjoy the video. I am recommending the game to anyone.

Regards.

Andy

Upgrading WordPress software manualy to the latest version.

Hi all.

One of the PCLinuxOS policies is “DO NOT install anything from outside the repo” and I agree with that. Installing anything from outside the repo is the best way of borking Your system. Application from outside PCLinuxOS repository can cause stability issues. It’s also a security risk… BUT in this case we are talking about a blogging software. If You run WordPress on Your own machine and it’s accessible to anyone from outside (the internet) then not keeping it current is like asking someone to use a old vulnerability (exploit): to gain control over Your machine and change it into a spambot, DDOS bee or hack another machine from it…

PCLinuxOS has WordPress in it’s repository…

[andrzejl@icsserver ~]$ apt-cache search wordpress
wordpress – WordPress Open Source Forum (CMS)
[andrzejl@icsserver ~]$

unfortunately it’s not being upgraded very often…

[andrzejl@icsserver ~]$ rpm -qa | grep wordpress
wordpress-3.1.3-1pclos2011
[andrzejl@icsserver ~]$

considering that 3.3 is the latest stable version of WordPress…

How to keep WordPress current?

First of all I am using the rss feed reader Akregator (any other rss feed reader will do just fine) to receive updates about WordPress development. Rss feed address is:

http://wordpress.org/news/feed/

Then whenever I get information about the new release of the WordPress I run this command (just copy / paste it if You are using default PCLinuxOS WordPress setup) from the terminal followed by root password:

su -c "cd /var/www/html/ && wget -c http://wordpress.org/latest.tar.gz && tar xvzf ./latest.tar.gz && rm -f ./latest.tar.gz"

Wordpress Upgrade 001

Command syntax explained:

su -c ""

Run the command inside the “” as a root user.

&&

Wait till previous command finished successfully before going any further.

cd

Enter the folder.

/var/www/html/

Default folder in which WordPress is being installed on PCLinuxOS. If You have changed the location of the WordPress on Your installation You need to amend this part of the command.

wget -c

Download the file with the option to continue later if download got interrupted for whatever reason.

http://wordpress.org/latest.tar.gz

Static address for downloading latest stable release of wordpress in tar.gz file.

Wordpress Upgrade 002

tar xvzf

Extract tar.gz archive.

./latest.tar.gz

Path to the tar.gz archive that we have just downloaded ./ in front of the file name means that it’s in the same directory that we are currently in.

Wordpress Upgrade 003

rm -Rf

Remove without asking for permission.

PLEASE be extremely careful. Guess what happens when

rm -Rf /

is ran? Yeah… Nothing good… You can say buh bye to Your current installation and ALL the files… In other words.. DON’T! 🙂

Wordpress Upgrade 004

After the command finished open Your browser (I am using Firefox 9.0.1 here) and navigate to Your WordPress blog. Right click and choose View Page Source from the drop-down menu.

Wordpress Upgrade 005

You should be able to see similar entry as the one highlighted on the screenshot above. Your WordPress is upgraded to the latest version.

You can also check Your WordPress version in the Dashboard section of Your WordPress Administration Panel.

Sometimes after the upgrade of the WordPress You need to upgrade Your database. You will be asked for it when logging into the Admin’s panel. Nothing to worry about. One click in a browser does it for You. Never had any problems with this.

Wordpress Upgrade 006

This is how I upgrade WordPress software on my server. Brain is needed when following my method. I do not take any responsibility if You bork something.

Hope this helps somebody someday.

Regards.

Andy

Edit: Another reason to keep WordPress updated.

Irssi and screen on the shell – notifications on local machine.

Hi all.

If You are running Irssi inside GNU Screen session on Your shell account (ssh) You may want to turn on the notifications so the local machine that You are connecting from makes a beep or notifies You with popup each time Your name is being used or someone PMs You.

This is a addition to Installing and configuring GNU Screen post so make sure that You read / follow that post first.

Ready? Here we go.

Close Irssi and the Screen session on the shell account and use this command:

sed -i 's/vbell on/vbell off/' $HOME/.screenrc

It will change the mode that screen is being started with from visual to audible bell. You can also switch between the bell modes manually by using CTRL + A / CTRL + G combo.

Now on the local machine (the one that connects to the shell server) You need to setup notifications in Your terminal. In my case its KDE4. It will look like this:

Settings > Configure Notifications

Screen Irssi Notifications 01

Find and click on “Bell in Visible Session” and then mark the box next to “Show a message in a popup”.

Screen Irssi Notifications 02

From now on You will see this popup each time someone calls Your name or PMs You on IRC.

Screen Irssi Notifications 03

Also You will be able to see all the notifications in the system tray notification section.

Screen Irssi Notifications 04

As You have probably noticed there were other events that could be used as a notification methods in KDE4. If You don’t like the popups – mess around with the settings.

Sometimes notifications can be little overwhelming… Remember that You can always turn them off if You feel like it.

Hope this helps.

Andy

Solution for horrible bug in nano that renders the text editor completely useless.

EDIT: This solution will be implemented in the nano rpm and should soon be available as upgrade in PCLinuxOS repositories via Your package manager.

Thank You gseaman.

Hi all.

I have noticed this ages ago and it annoyed the BeeGeeses out of me. When You enter a long line of text in nano editor it “wraps” the lines. It “wraps” them like other text editors do – fine. The problem occurs when You try to save the file… all of the sudden long line of text becomes 3 or 4 lines of text… I have recorded this little video to show You an example of what I mean. Now imagine using nano on Your /boot/grub/menu.lst file. Edit the line – even just change the vga=xxx mode and when You reboot Your grub is going into “YOU MESSED UP DUDE!” mode.

Solution to this is to run this command from the terminal:

su -c "sed -i 's/# set nowrap/set nowrap/' /etc/nanorc"

and give it a root password when asked for it.

Fixing nano 1.

This will turn off the word wrap completely.

However if You are like me and You like the word wrap option BUT You want to keep one line as one line You may want to use this command as well:

su -c "sed -i 's/# set softwrap/set softwrap/' /etc/nanorc"

This will cause the nano editor to softly wrap the lines and when You will save the file – the lines won’t break. In other words if You will type a long line it will be shown as many rows of text BUT when You will save the file it will still be a one long line. Both commands have to be used in order for the soft wrap to work.

Fixing nano 2.

Thanks to the Andrzej3393, Enlik and Rsanti – guys from the Polish PCLinuxOS IRC channel – for testing and ideas.

Hope this helps somebody someday.

Regards.

Andy

Installing / configuring GNU Screen…

Hi all.

Today I will try to show You how to install and configure GNU Screen.

First? What is Screen. Manual page explains it very well.

Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells). Each virtual terminal provides the functions of a DEC VT100 terminal and, in addition, several control functions from the ISO 6429 (ECMA 48, ANSI X3.64) and ISO 2022 standards (e.g. insert/delete line and support for multiple character sets). There is a scrollback history buffer for each virtual terminal and a copy-and-paste mechanism that allows moving text regions between windows.

By default screen looks something like this:

Screen 001

Screen 002

It looks like a ordinary console window. In my own words I would call Screen “many console windows in one…” it’s not a perfect description but that’s the best one that I could come up with. By default screen does not looks very interesting does it?

And what if I will tell You that by copying and pasting few commands You can make it look like this? This is a screenshot taken from my pCLI-NoX installation.

Screen 003

or like this if You are using KDE4…

Screen 004

Still not interested? And what if I will tell You that if You ssh to Your shell account and run screen command and then close the connection the screen will stay active and that You can re-open it when You connect next time with screen -dr command? Better huh? Thought so… And if I will tell You that You can share the screen session with a friend to show Him what are You doing at the moment or to teach him something new? Hehe I see I got Your attention. You are still reading aren’t You?

Ok first things first – we need to install screen then we will configure it. I assume that You have fully upgraded Your PCLinuxOS installation. Run those commands:

su

Give it a root password and then run:

apt-get update && apt-get install screen

Wait till it’s finished and run:

exit

You should be back into the user mode. Now copy and paste the following commands:

cp /etc/screenrc $HOME/.screenrc

mkdir -p $HOME/.bin

touch $HOME/.bin/my_battery.sh

chmod +x $HOME/.bin/my_battery.sh

echo 'acpi -b | cut -f 2 -d |' > $HOME/.bin/my_battery.sh

touch $HOME/.bin/my_temperature.sh

chmod +x $HOME/.bin/my_temperature.sh

echo 'acpi -t | cut -f 2 -d |' > $HOME/.bin/my_temperature.sh

echo 'caption always "%{= Wk}%-w%{= Bw}%n %t%{-}%+w %-="' >> $HOME/.screenrc

echo 'defutf8 on' >> $HOME/.screenrc

echo 'backtick 1 1 0 $HOME/.bin/my_battery.sh' >> $HOME/.screenrc

echo 'backtick 2 1 0 $HOME/.bin/my_temperature.sh' >> $HOME/.screenrc

echo 'hardstatus alwayslastline "%{+b kr}[%H]%{kg} %1`%{kw} %2` %{ky}Load: %l%-=%{kb}%c %d.%m.%Y"' >> $HOME/.screenrc

sed -i 's/#startup_message off/startup_message off/' $HOME/.screenrc

After all this You should see something like this:

Screen 005

Now type in:

screen

and You should see something like this:

Screen 006

Voila! All done. Now close the Konsole window and reopen a fresh one.

Screen 007

Type in:

screen -dr

Screen 008

Screen session is now re-attached to Your Konsole window.

Screen 009

That’s one of the coolest things about screen.

Now I said there are multiple windows in one right? Right. See this whiteish bar with blue rectangle on it and with the 0 bash in it? Make sure that the Konsole window has focus and press and hold CTRL + A and then let them both go and press C.

Screen 010

Now look at that white bar. There are two entries 0 bash and 1 bash. Blue color rectangle moved to the second entry. Why? By pressing the above combo You have opened another “window” in screen and it has the focus now.

As You have probably noticed CTRL + A + key is how the screen operates. It’s very simple and the basic keys are:

c – open / create new window.
n – go to next window
p – go to previous window
k – kill the active window (must be confirmed by pressing y)

Those are the basic things You need to know about screen. Want more? Ok. Have fun. The Key bindings section should be of interest to You.

Special thanks to Hootiegibbon who wrote a large part of the .screenrc file config. Also thanks to Enlik for showing me (and helping with config of) the GNU Screen app in the first place and for helping me when I got stuck at some point while writing this howto.

Hope someone will find it useful.

Regards.

Andy

Fix for the older ATI Radeon cards vs 2011.6 iso and xorg server 1.10.3 from the testing section.

Hi all.

Just wanted to let You know that the fix is still working perfectly well under the latest release of PCLinuxOS even if You will install Xorg server from the testing repository. It’s not recommended to install stuff from testing – but if all goes well this will soon be available in our normal repositories as a upgraded package. So just letting You know that the Radeon keeps working fine at least here it does ;).

[andrzejl@wishmacer ~]$ X -version

X.Org X Server 1.10.3
Release Date: 2011-07-08

Regards.

Andy

Pidgin as IRC, Google Talk, Yahoo client + Freenode IRC login registration + CheckGmail… Oldie but goodie…

Hi all.

This was one of my earliest HOWTO’s… I had a good laugh when I saw the screenshots after almost 3 years.

In the IRC HOWTO You will find the freenode.net login registration part and the link to Google Talk setup. In the Google Talk HOWTO. You will find links to the CheckGmail HOWTO and a link to the Pidgin + Yahoo setup part…

Some of the info is still valid ;). One day I will redo them and post here on WoTW ;).

Have fun.

Andy