Skip to content


Using nmap to scan a subnet for a specific open port

Today I booted up a box and it’s DHCP assigend IP Address had moved so I had to find it again using this helpful
Use nmap to scan for ssh servers blog post.

After downloading the command line nmap for Windows from http://nmap.org/download.html.

I ran:

# locate ssh servers
# for a range of hosts on a subnet
nmap -p22 --open -sV 192.168.88.100-200
 
# for the entire subnet
nmap -p22 --open -sV 192.168.88.0/24
 
# locate ssh, web and https servers on the entire subnet
nmap -p22,80,443 --open -sV 192.168.88.0/24

No Problemo.

Bookmark and Share

Posted in IT Tips.


Windows 7 – Setting Proxy Configuration from the command line


Was working from memory today and found that proxycfg.exe doesn’t exist in Windows 7 and it’s been replaced by netsh.

You can do it all from the netsh command line but it’s quite easy to first set it up under your Internet Options and then Import the settings as follows:

Enter your proxy address and port then click the Advanced button to configure the proxy bypass list.

Proxy Address

Set proxy address and port

Under advanced settings add the domains / IP’s to bypass

Image of Internet Explorer Proxy Dialog

Set up bypass-list in Internet Explorer

Then import the settings using netsh

Windows CMD Dialog showing netsh winhttp import proxy command

Using netsh to import proxy settings

netsh winhttp import proxy source=ie
Current WinHTTP proxy settings:
    Proxy Server(s) :  192.168.45.22:3128
    Bypass List     :  192.168.55.*;*.internaldomain.local;<local
netsh winhttp show proxy
Current WinHTTP proxy settings:
    Proxy Server(s) :  192.168.45.22:3128
    Bypass List     :  192.168.55.*;*.internaldomain.local;<local>
Bookmark and Share

Posted in IT Tips.


rsnapshot Backup to External USB Drive Gotcha

I am using rsnapshot to make hourly, daily and weekly snapshots of my home workstation data. This is on Fedora 16.

In /etc/rsnapshot.conf there are two commands that specify the root directory you want to create your backups in and whether or not to create it if it doesn’t exist already

###########################
# SNAPSHOT ROOT DIRECTORY #
###########################
# All snapshots will be stored under this root directory.
#
snapshot_root   /mnt/3TB_USB/rsnapshot/
# If no_create_root is enabled, rsnapshot will not automatically create the
# snapshot_root directory. This is particularly useful if you are backing
# up to removable media, such as a FireWire or USB drive.
#
no_create_root  1

Problem:
The problem I am having is that if the USB drive isn’t mounted rsnapshot exits without doing the backup.

I tried to work around this by adding a script to the cmd_preexec setting thinking that rsnapshot would run cmd_preexec and then check to make sure the snapshot_root existed. But apparently the check for rsnapshot_root happens and rsnapshot exits before cmd_preexec runs. So this approach doesn’t work:

# Specify the path to a script (and any optional arguments) to run right
# before rsnapshot syncs files
#
cmd_preexec   /usr/local/bin/mount_backup_usb.sh

Resolution:
So the answer to my problem is to call the mount_backup_usb.sh from the crontab thusly:

# added by jamesm 5/12/2011
0 */4 * * *         /usr/local/bin/mount_backup_usb.sh && /usr/bin/rsnapshot hourly
50 23 * * *         /usr/local/bin/mount_backup_usb.sh && /usr/bin/rsnapshot daily
40 23 * * 6         /usr/local/bin/mount_backup_usb.sh && /usr/bin/rsnapshot weekly
30 23 1 * *         /usr/local/bin/mount_backup_usb.sh && /usr/bin/rsnapshot monthly

This is the script that I use to mount the external USB Drive. Note that I am using the by-uuid device entry to provide un-ambiguous access to the USB HDD volume just in case the device path (/dev/sdb, /dev/sdc) changes (which it can depending what you have plugged into the PC).

#!/bin/sh
 
VOLUME=/mnt/3TB_USB
BYUUID=/dev/disk/by-uuid/89406e23-02b9-4846-a9db-38c344fe851f
 
if mount | grep -q $VOLUME ;
then
	echo already mounted
else
	echo not mounted
        # just in case it's already mounted by the user to /media/*
	umount -f $BYUUID > /dev/null 2>&1
	mount $BYUUID $VOLUME
 
fi
Bookmark and Share

Posted in IT Tips.


DIY Websites

Keep getting asked “Where can I build a site on the internet” preferably for free or low cost

OK so here are some links to templated DIY site building websites:
Google Sites
Wix Website Builder
Squarespace

So to get started on the Internets for eCommerce what do you need?

  • Commitment to spend money to get the result you want
  • Domain Name – a few dollars to 40$ for 2 years. e.g. this websites Domain Name is jamesmcdonald.id.au
  • A reliable Domain Name Server to Host the Domain Name – This can be a part of the webhosting package or another provider (dyndns.com) – $20 – $40 per year
  • Depending on the complexity of your site. You need to decide on whether you need a Content Management System (CMS) or just plain old HTML and Templates (e.g. Joomla, WordPress) (Free to 150$ per month)
  • If you have the need of highly customized site and you can’t do graphic design or PHP/HTML/Javascript coding then retaining Web Developer will be needed ($500-$10,000)
  • A Web Server. Somewhere to put the files that make up your website. Depending on how much help you need you can spend as little as $3.95 to $10.00 (justhost.com, dreamhost.com) per month or as much as $150 (full dynamic scaling on a clustered cloud environment with support from real people)
  • For eCommerce a payment gateway provider – e.g. Paypal or Bank eCommerce Gateway (percentage of each transaction to several thousand dollars + merchant fees)
  • Email – either a free email address (hotmail.com, gmail.com) or one the same as your domain e.g. james at james mcdonald dot id dot au )
  • Email Mailbox & Server to send and receive your emails
  • A fax / phone number so people can contact you
  • On going technical resource to perform backups, edits and upgrades
  • Reliable backup and restore capability
Bookmark and Share

Posted in IT Tips.


rdesktop Printer Redirection FTW

This is really basic but well hey, spinning shiney things intrigue me.

rdesktop -f -r printer:HP-Officejet-Pro-8500-a909n 192.168.22.5

Basically the above says connect to the remote desktop on 192.168.22.5 and go full screen, make the local “HP-Officejet-Pro-8500-a909n” printer available to the remote desktop session.

I tried this and over a slow Wireless Broadband link, printing from a Windows 2003 Server the print job took about a minute to come out.. and I believe it was only that slow because I forgot to fill the printer tray.

Bookmark and Share

Posted in IT Tips.


Installing NX Server (neatx-server) on Ubuntu 11.10 Oneiric

Here is a well laid out explanation of how to do it:
http://blog.philippklaus.de/2011/11/install-nx-server-neatx-on-ubuntu-11-10/

I am a bit disappointed with the result though.

I don’t seem to be able to connect and disconnect cleanly. The neatx server leaves sessions behind and then tries to re-attach to them causing an error.

Bookmark and Share

Posted in IT Tips.


Using Linux Screen

Recently I have got caught out by leaving a terminal running while remotely connected to a Linux server and the connection has failed leaving the remote process unfinished & terminated.

The Linux screen command allows you to run programs and disconnect. Rather than re-inventing the wheel I’m simply going to link to an article that made sense to me. Located here: http://www.rackaid.com/resources/linux-screen-tutorial-and-how-to/

Bookmark and Share

Posted in IT Tips.


Goodbye Dear Home Line I Paid for you Well

Telstra provides a costly service. There isn’t enough competition to get the prices down especially in a regional area. They do have the best coverage on the mobile network though and it would be unfair not to mention our low population and enormous cabling distances to provide some sort of counter-point to the first sentence.

We have been paying circa 95$ a month for a fixed home line and an ADSL 2+ with a 50GB (I think) plan.

However we don’t use the homeline and the ADSL is $45 a month but you need to rent the copper to get the ADSL hence the nearly 40$ a month charge on top. Ouch!

For area’s where it’s Telstra only there is no such thing (as far as I’m aware) as Naked DSL.

So until the National Broadband Network arrives in my town. I’m going to leave the Phone/DSL dis-connected and when I see them laying the cable for the NBN in my regional city I’ll re-apply for a DSL/Fiber service… That’s if it ever eventuates.

Bookmark and Share

Posted in IT Tips.


A Link to an Article on Creating Searchable PDF on Linux

http://tfischernet.wordpress.com/2008/11/26/searchable-pdfs-with-linux/

PDF Copy of blog post in case they stop blogging and leave the internet

Bookmark and Share

Posted in IT Tips.


Windows 7, Office 2003 with Latest Office 20xx Compatibility Pack won’t open xlsx


I’m trying to open an xlsx document in Windows 7 Pro 32bit with Office 2003 SBE and the latest Office Compatibility Pack and it doesn’t recognize the xlsx file.

I have found the problem/s:

The immediate problem: The version of Office 2003 didn’t have Service Pack 3 installed. Once I installed it the xlsx opened fine.

The underlying problem: I also didn’t have Microsoft Update installed and enabled. Windows Update doesn’t grab Office updates so despite the Windows 7 OS being up to date the version of Office was as installed. So another tip is to make sure you enable Microsoft Update as it will pick up old versions of Microsoft Software not just the O/S as Windows Update does.

Bookmark and Share

Posted in IT Tips.