ITKE Community Blog

Sep 21 2011   1:49PM GMT

IT Knowledge Exchange’s Newest Contest! (EXTENDED)

Melanie Yarbrough Profile: 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!

4  Comments on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Please define "script". I'd normally assume it refers to a scripting language for a UNIX or UNIX-like shell, particularly an interpreted language; but I might use REXX as my scripting language. Or I might not use a 'script', but instead execute a compound sequence of shell utilities or commands that I construct dynamically in a different language. If features of a shell aren't required, there's no need to have a 'script'. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    Do "Comment{s} on this Post" simply disappear? Why have a "comment" box? Now I have to enter this comment to confirm what happened to my questions about the contest. Tom
    125,585 pointsBadges:
    report
  • MelanieYarbrough
    Hi Tom, For the most part, comments on the blogs are moderated, so there is sometimes a little bit of turnaround before they show up on the site. You can use any language you prefer, and we'll gladly accept anything that promotes creativity and efficiency in the enterprise, and that could possibly be useful to other members in their own IT environments. Don't forget to tag your entry "IT Scripts" nonetheless! Best, Melanie
    6,345 pointsBadges:
    report
  • TomLiotta
    Ah. It's necessary to wait a few days. No problem; it was just confusing. Of course, I only came back here because I was going to use it as an example in the [B]Open IT Forum: What do you want to see from IT Knowledge Exchange in 2012?[/B] thread; otherwise I still wouldn't have known that there was a reply. Now to see if I can use any of my "script" examples... Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: