Linux

Configure squid to ignore some sites

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.

Read More
Linux

Discover online PCs fast

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 […]

Read More
Linux

Use local DNS name and IP from DHCP

For Red Hat Linux if you receive your IP address from a DHCP server, you may update the local DNS name by adding the following line to the correct ifcfg file in /etc/sysconfig/network-scripts, such as ifcfg-eth0 or ifcfg-eth1: DHCP_HOSTNAME=”myhostname.example.com” If you are running Debian, edit /etc/network/interfaces as follows (adding the hostname line) iface eth0 inet […]

Read More
Linux

Use ssh on multiple servers simultaneous

If you have many servers to manage and want to perform the same tasks on each of the machine every day, then you should look at the package named clusterssh. Install the clusterssh package apt-get install clusterssh Perform the same command on the three servers server1 server2 and server3 cssh server1 server2 server3 This opens […]

Read More
Scripting

Getting iptables to survive a reboot

As far as I know Debian doesn’t have any defined way to save your iptables rules. I’ve done it this way: First I’ve made my iptables rules and made sure they work. Second is to save those rules to a configuration file iptables-save > /root/scripts/iptables.save I always try to save my custom scripts and required […]

Read More