IT Knowledge Exchange’s Newest Contest! (EXTENDED)
Posted by: MelanieYarbrough
Update: This contest has been extended until October 17, 2011.
Today is the first day of IT Knowledge Exchange’s newest contest! We’re looking for the most useful, inventive and clever IT scripts that help make your life easier. To win, simply post your script in the forums with the tag IT Scripts*. See below for some examples of what we’re looking for from IT Knowledge Exchange blogger and member Eric Hansen of I.T. Security and Linux Administration.
We’ll be giving away a Nintendo 3DS** to three lucky members, one for each category:
- Most Useful Script: Have an IT script that a lot of people could use … if only they’d thought of it? This could be your category. Tip: Solve your own need, and chances are you’ll be solving a multitude of others’ needs.
- Most Creative Script: Think you’ve figured out a really cool (although not necessarily necessary) hack to your daily IT – or personal – needs? We want to see it!
- Best Feedback from the Community: That’s right, we want to hear from you! Check out the IT Scripts page for the latest entries. Try them out, and rate them! Leave your opinions in the discussion section and win a chance at the third Nintendo 3DS just for sharing your two cents.
*Entries not tagged with IT Scripts will not be considered for the contest.
**Due to restrictions on the Nintendo 3DS, you must 18 years old to enter and win this contest. We can only ship prizes within the U.S., Canada, and Europe. For winners outside of these areas, we will substitute an alternate prize such as a gift card.
The fine print: IT Knowledge Exchange’s general contest rules apply. This contest will end on October 7, 2011October 17, 2011.
Script Examples:
1. Script Name: Port Checker
Language:Bash
Purpose: Check to see if a port is available based on either the port # or program name passed
Notes: Requires root privileges due to “p” switch being used in netstat
#!/bin/bash # Script is used to determine if a port is used. # Usage: portcheck <port number> # Executes netstat -ntlup | grep <port> to do checking. # Returned text is stored in a variable. If variable is empty, # port is not in used. Otherwise, port is being used. # Get the username of the person running script USER=`id -un` # Root is required to run netstat -ntlup if [ "$USER" != "root" ]; then echo "Root privileges required." else NET=`netstat -ntlup | grep $1` if [ -z "$NET" ]; then echo "Port is free" else echo $NET fi fi
2. Script Name: iptables Helper
Language: Bash
Purpose: Correctly saves and restores iptables rules, as iptables-save can run into file descriptor issues on certain set ups
Notes: Requires root due to handling of system files
function reload_iptables () {
RULES=”/etc/iptables/iptables.rules”
if [ -e "$RULES" ]; then
echo -n “Restoring iptables rules from $RULES…”
iptables-restore < $RULES
echo “done.”
fi
}
What are you waiting for? Get thee to the forums and enter!





