Shell Script Examples: case, count, for, if, while and User input

If you, like so many other people these days, switch to Linux you will come in contact with something called unux scripts, shell scripts or bash scripts. These scripts are text-files that execute commands just like bat-files in Windows. I prefer shell-scripts because i think they are more powerful then bat-files but that is just my opinion.

Some things you should know:
#!/bin/bash usually is the first line in a bash script. It is called shebang (also called a hashbang, hashpling, or pound bang) and specifies in which shell to execute the code that follows below.

Everything after a # is a comment and does not get executed.

Below you will find examples of a few things that you can do with shell scripts on Linux and other Unixes. If you have questions: have a look at the man page of the command or post a comment and I will try to explain. Continue reading “Shell Script Examples: case, count, for, if, while and User input”

Updated: Ubuntu 9.04 on the Asus Eee Pc 1000H with ACPI and WiFi/Wlan working

This article should also apply on the newly released 1000HE and maybe the 900 series of EEE Computers. If you can verify that this is the case please let me know.

A few days ago I got myself the Eee Pc 1000H from Asus. My first impression about the hardware is that the build quality surpasses my expectations. After a day or two of typing on the 1000H-keyboard I have gotten very used to it and type as fast as on a normal sized keyboard. The screen is great to.

Since memory nowadays is so cheap I purchased a 2 GB SO-DIMM DDR2 module from Corsair. Product number is VS2GSDS667D2. The memory from Corsair works without any problems. I guess that it is not necessary to have 2 gigabytes of memory to run Ubuntu but a large file cache will speed things up.

On to the installation of Ubuntu 9.04: Continue reading “Updated: Ubuntu 9.04 on the Asus Eee Pc 1000H with ACPI and WiFi/Wlan working”

Simple iptables firewall script with NAT and SFQ sceduling

I have been working with firewalls and security for quite many years at this point. Therefore friends and people I know ask me every now and then to write a firewall script for them. So instead of basically writing the same script over and over again I decided to write this article that explains how you can set up a basic iptables box by yourself. Continue reading “Simple iptables firewall script with NAT and SFQ sceduling”

A solution to Potential DNS DDoS: named query (cache) ‘./NS/IN’ denied

During the last couple of weeks i have been seeing a lot of messages about denied cache queries on my DNS servers.

month day time server name named[6518]: client ip number#port number: query (cache) ‘./NS/IN’ denied

At first they looked quite innocent and I thought nothing much of them. But after a while the number of logged events grew faster and faster so it was time to do some investigation on google. After reading a few articles I came to the conclusion that my logs where trying to tell me that my DNS server where used as DNS DDoS deflectors. Continue reading “A solution to Potential DNS DDoS: named query (cache) ‘./NS/IN’ denied”