Monthly Archives: September 2012


How to: Easily block access to a website in Windows


There is an old Linux trick, that works superbly in Windows as well.

1. It is necessary to run notepad or your Windows editor of choice as the Administrator. Right click on notepad in the start menu, and choose: Run as Administrator.

Once you do that, navigate to the Windows host file. Don’t know where that is? I will tell you!


2, Once you have that open, click on file, and then save as That makes a copy of the intact original file.

Your file needs to look like:

# Copyright (c) 1993-2009 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# # source server
# # x client host

# localhost name resolution is handled within DNS itself.

# define local host GU 09/26/2012 localhost
::1 localhost

# add sites to be blocked GU 09/26/2012

Notice the the definition for (localhost) was UNCOMMENTED. Very important. Also ::1.

Now you just tell it what sites you want to block, (as seen here, facebook, twitter, youtube, pandora) — whatever you want blocked.

3. Now hit file, and SAVE AS as hosts. Overwrite the file. I rebooted Windows and guess what? No more access to those sites!

4. To check:


PING ( 56(84) bytes of data.
64 bytes from localhost.localdomain ( icmp_req=1 ttl=64 time=0.027 ms

You can do the same thing in Linux, by editing /etc/hosts.



Congratulations, Loni!


Loni and the Kitty

Loni and the Kitty

A welcome contributor to this site, and personal friend Loni, is leaving soon for a new job in the big city.

Thank you for all your assistance, tutoring, and mentoring. Loni always made me work to find the right answer. Sometimes it was RTFM. But she always pointed me in the right direction.

On behalf of all the followers and subscribers to pkill-9, I think you.

Yes, it was Loni after all, who came up for the name of this website!

Thanks old friend,



How to easily remove comments from a file (or why does squid.conf look like War and Peace?)


Oh brother. I am trying to configure the squid proxy server on my Linux box. At over 4,900 lines of code, it reads more like Tolstoy’s epic novel: War and Peace.

While I appreciate that every blessed thing I would ever need to know about squid is contained in this configuration file, it makes it hard to read the code through the comments. I had some fancy way of doing it, but Joe came up with a simpler method:

grep -v '^#' squid.conf

and I improved on that:

grep -v '^#' squid.conf | uniq | sort >squid.nocomment

so let’s break that down.

grep looks for a regular expression.

the -v option tells it to look for lines which DO NOT match to pattern. In this case we are looking for lines that do NOT match a comment: # in the first character of the line. So we just took the “War and Peace” sized squid.conf, to a handful of lines.

uniq – filters out adjacent lines, so if we have multiple blank lines, it eliminates them.

and sort? Well it sorts the output, and writes the file.

Notice the | ? It is piping. What’s that? It means the input to the next programme (following the pipe) is the output of the previous programme.

So what the command does is, looks for lines that do NOT start with a comment, eliminates any adjacent duplicate lines, then sorts the output.

So our 4,900 configuration file, is now, 50 lines! About 2% of the total. Who knew? Thanks Joe for getting me started with the grep trick. Here is the squid.conf file, with the comment lines removed:

access_log /var/log/squid/access.log squid
acl all src all
acl apache rep_header Server ^Apache
acl localhost src
acl localnet src # RFC1918 possible internal network
acl localnet src # RFC1918 possible internal network
acl localnet src # RFC1918 possible internal network
acl manager proto cache_object
acl purge method PURGE
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 210 # wais
acl Safe_ports port 21 # ftp
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 443 # https
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 631 # cups
acl Safe_ports port 70 # gopher
acl Safe_ports port 777 # multiling http
acl Safe_ports port 80 # http
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl shoutcast rep_header X-HTTP09-First-Line ^ICY.[0-9]
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl to_localhost dst
broken_vary_encoding allow apache
coredump_dir /var/spool/squid
hierarchy_stoplist cgi-bin ?
hosts_file /etc/hosts
http_access allow localhost
http_access allow manager localhost
http_access allow purge localhost
http_access deny all
http_access deny CONNECT !SSL_ports
http_access deny manager
http_access deny purge
http_access deny !Safe_ports
http_port 3128
icp_access allow localnet
icp_access deny all
refresh_pattern . 0 20% 4320
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
upgrade_http0.9 deny shoutcast



How to fix audio cd in Linux (unable to open mrl)


When I tried to play an audio cd I recently got from the library in vlc, I got the error:

VLC is unable to open the MRL

And it told me to see the logs. So I tried dmesg, and niente. Nothing. Yeah that helps!

So I went into vlc tools/preferences/Audio and changed the output module to pulse audio output. So it looks like:

VLC Audio Output Options

Who knew?