If you are using squid like me, it is sometimes useful to avoid cacheing some internet addresses. To accomplish this you could edit your /etc/squid/squid.conf file and add the following line
acl NOCACHEDOMAIN dstdomain www.vg.no no_cache deny NOCACHEDOMAIN
This makes it possible to view www.vg.no without viewing a squid cached page.
Tags: squid
Posted by Hans-Henry Jakobsen
The last time I installed Debian Etch i closed both port 111 and 113 but since I’ve forgot it already and a new installation is in progress, this post should remind me how to do it in the future. The code view below shows the ports nmap found were in a open state
PORT STATE SERVICE 111/tcp open rpcbind 113/tcp open auth
Port 113/auth can be closed by commenting out the ident line in the /etc/inetd.conf
#ident stream tcp wait identd /usr/sbin/identd identd
Port 111 is the portmap daemon and can be configured to only listen on the loopback interface
dpkg-reconfigure portmap
This command modifies the /etc/default/portmap file and adds/uncomments the line
OPTIONS="-i 127.0.0.1"
Tags: auth, Debian, dpkg-reconfigure, portmap, rpcbind
Posted by Hans-Henry Jakobsen
To list the contents of a package just run the command
# rpm -ql packagename
Example
# rpm -ql nmap /usr/bin/nmap /usr/share/doc/nmap-3.70 /usr/share/doc/nmap-3.70/COPYING /usr/share/doc/nmap-3.70/COPYING.OpenSSL /usr/share/doc/nmap-3.70/README /usr/share/doc/nmap-3.70/nmap-fingerprinting-article.txt /usr/share/doc/nmap-3.70/nmap.deprecated.txt /usr/share/doc/nmap-3.70/nmap.usage.txt /usr/share/doc/nmap-3.70/nmap_doc.html /usr/share/doc/nmap-3.70/nmap_manpage.html /usr/share/man/man1/nmap.1.gz /usr/share/nmap /usr/share/nmap/nmap-mac-prefixes /usr/share/nmap/nmap-os-fingerprints /usr/share/nmap/nmap-protocols /usr/share/nmap/nmap-rpc /usr/share/nmap/nmap-service-probes /usr/share/nmap/nmap-services
Tags: CentOS, Fedora, RedHat, rpm
Posted by Hans-Henry Jakobsen
This is a oneliner bash command to determine my 10 most used linux commands according to my history file
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
The result
1 188 37.6% vi
2 38 7.6% ls
3 24 4.8% cat
4 22 4.4% apt-get
5 12 2.4% date
6 11 2.2% tail
7 11 2.2% cd
8 10 2% rm
9 10 2% man
10 9 1.8% basename
It looks like i use vim a lot on my home server. You should try it yourself and see what commands you use the most.
Source: http://linux.byexamples.com
Tags: awk, bash, count, grep, head, nl, sort
Posted by Hans-Henry Jakobsen
This is as far as I know the fastest way to determine what PCs are online in your network
# nmap -sP 192.168.0.1-255 Starting Nmap 4.53 ( http://insecure.org ) at 2008-02-25 00:01 CET Host 192.168.0.120 appears to be up. Host 192.168.0.140 appears to be up. Host 192.168.0.250 appears to be up. Nmap done: 255 IP addresses (3 host up) scanned in 5.711 seconds
It only took 5.7 seconds to scan all 255 IP addresses and determine if they were online.
Posted by Hans-Henry Jakobsen