Archive for January, 2011

Serial Number and Product Key Finder for Mac

Friday, January 21st, 2011

How many times have you installed a software at your office and then after many years you find out thatthe installation disc or (worst!) the serial number (or product key) shipped with the disc are lost?

When changing your old Mac to a new Mac you may had prefered to start from a brand new installation instead of restoring from a Time Machine backup, especially if you come from a PowerPC environment and you want to migrate to an Intell processor machine.
If this is the case you want to know what are the serial numbers of all yuor purchased software.

Product Key Finder for Mac is the small and free utility that you really need, and if you like it there’s a Windows version as well.

You can download the Product Key Finder from the official home page of the project:
http://mac-product-key-finder.com/

Enjoy!

How-To flush the DHCP server lease cache

Monday, January 17th, 2011

On a GNU/Linux server locate the files  dhcpd.leases and dhcpd.leases~
Mine is a Debian so the location is /var/lib/dhcpd3/ .

  1. delete the temporary file dhcpd.leases~:
    $ sudo rm dhcpd.leases~
  2. flush the lease cache dhcpd.leases:

    $ sudo echo "" > dhcpd.leases

the next time the clients will request a lease they will probably obtain a different IP respect the one they had before.

How-To install and configure ntop 4 on Mac OS X

Sunday, January 16th, 2011

“ntop is a network probe that shows the network usage”, this is the brief description of ntop extracted from the official ‘overview’ page of www.ntop.org.

the reason why I like ntop is that it gives us a immediate projection of what is happening in our network NOW! with graphical and table representations of the current, recent and past network statistics.

When the network is stuck, you can know why, and you can know it immediately. You can then take the proper action to ditch the cause ūüėČ

This is not all, there are amazing information you can have from this ‘small’ Italian tool…

In this post I will describe an as-easy-as-possible installation procedure to install ntop in you Mac OS X Server Snow Leopard (I didn’t test this on previous version, but as far as MacPorts is available for older version it shouldn’t be an issue to follow the same steps)

Preface

The easiest way ever would be to fire the command

$ sudo port install ntop

but as always happens the easiest way is not the best way, in facts the MacPort version of ntop is 3.3, quite old respect the current stable version 4.0.3.

Also, the installation of ntop through the port tool doesn’t install and configure it as a service but only as a tool to be run occasionally.

One of the reasons I prefer to install ntop 4.0.3 instead of 3.3 is that it gives us the option to visualise the “Hosts World Map” directly in Google Maps and¬†the “Local Network Traffic Map” giving us an idea where our network users and services and clients are connecting to and from.¬†Of course many other improvements are available in the latest version, but these are the coolest according to me ūüėÄ

Another reason to manually install ntop and follow the procedure below is to install and configure it as a daemon (LaunchDaemon) launched by ‘launchd’.

What will will do then, is to download, compile and install the ntop 4.0.3 directly from its official website and rely on MacPorts to install it’s compiling and installing dependencies.

Prerequisites

  1. The -latest- sources of ntop.
  2. Xcode (required by MacPorts), you can install it from Mac OS X Server Snow Leopard installation disk, ‘Optional Installs’ folder.
  3. Workgroup Manager, it’s part of the Server Admin Tools and needs to be downloaded from Apple support and installed, unless you are running Mac OS X Server.
  4. MacPorts, you can download and install it from www.macports.org.
  5. wget, to be installed via MacPorts

Preparation of system

    1. Make sure you have installed Xcode and MacPorts and Worgroup Manager.
    2. Create a ‘src’ folder where to store and compile the ntop sources:
$ mkdir ~/src
$ cd ~/src
    1. Install wget:
$ sudo port install wget
  1. Fetch the latests source archive from www.ntop.org:
    $ wget wget http://ignum.dl.sourceforge.net/project/ntop/ntop/Stable/ntop-4.0.3.tgz
    $ tar xvzf ntop-4.0.3.tgz
    $ cd ~/src/ntop-4.0.3
  2. install ntop dependencies from MacPorts needed to compile and run ntop:
    $ sudo port install depof:ntop

    this command do not istall ntop from MacPorts but only its dependencies.

    This step could take several minutes because it will download, compile and install a lot of ports (libraries).

  3. Creation of the a localuser and local groupntop via ‘Workgroup Manager’:
    1. Create the new local group ntop ntop_group
    2. Create the new local user ntop with primary group ntop ntop_user

      Leave the password blank prevent any possibility of login and also do not specify the home folder, of if you really need to specify one choose /usr/local/etc/ntop.

       

       

       

       

       

       

       

       

       

       

       

       

       

      ntop_group_assignation

      This procedure can be executed in command-line as well using the ‘dscl’ command, but you will have to assign the Primary User ID manually retrieving it from the directory service using other scripts.
      The Workgroup Manager calculate the first available User ID automatically.

  4. install mako (needed for “Host World Map” feature of ntop):
    $ sudo easy_install mako
  5. install of¬†graphviz (contains ‘dot’, needed for “Local Network Traffic Map” feature of ntop):
    $ sudo port install graphviz

Compilation

Make sure to be in ‘~/src/ntop-4.0.3’ folder then

  1. fire the script that checks the dependencies:
    $ ./autogen.sh
  2. and proceeds with the compilation:
    $ make

Installation

 

    1. Run the script that installs ntop and its libraries in the proper places:
      $ sudo make install
    2. Create the LaunchDaemon scripts to make the service running as a daemon:
      $ sudo touch /Library/LaunchDaemons/org.ntop.ntop.plist
    3. copy and paste the following lines into org.ntop.ntop.plist
#-----BEGIN OF org.ntop.ntop.plist-----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>KeepAlive</key>
   <dict>
      <key>NetworkState</key>
      <true/>
   </dict>
   <key>Label</key>
   <string>org.ntop.ntop</string>
   <key>ProgramArguments</key>
   <array>
      <string>/usr/local/bin/ntop</string>
      <string>@/usr/local/etc/ntop/ntop.conf</string>
      <string>--user</string><string>ntop</string>
      <string>--db-file-path</string><string>/usr/local/var/ntop</string>
      <string>--daemon</string>
</array>
</dict>
</plist>
#-----END OF org.ntop.ntop.plist-----
  1. Create the configuration file to pass additional custom parameters
    $ sudo touch /usr/local/etc/ntop/ntop.conf
  2. copy and paste the following lines into ntop.conf
    (in this example I put the ‘vital’ paramenteres, you can specify more parameters, but the ones placed in the the LaunchDaemon file will NOT be overloaded by the parameters present on the ntop.conf file)

    #-----BEGIN OF ntop.conf-----
    # interface(s) that ntop will capture on
    #  DEFAULT: The 1st sisernet device, e.g. sis0 
    
    --interface en0
    
    # Configures ntop not to trust MAC addrs.
    # This is used when port mirroring or SPAN
    #--no-mac
    
    # Logging messages to syslog (instead of the console):
    #  NOTE: To log to a specific facility, use --use-syslog=local3
    #  NOTE: The = is REQUIRED and no spaces are permitted.
    
    #--use-syslog
    -L
    
    # Tells ntop to track only local hosts as specified
    # by the --local-subnets option
    
    #--track-local-hosts
    
    # Sets the port that the HTTP webserver listens on
    #  NOTE: --http-server 3000 is the default
    
    #--http-server 3000
    
    # Sets the port that the optional HTTPS webserver listens on
    
    #--https-server 3001
    
    # Sets the networks that ntop should consider as local.
    # NOTE: Uses dotted decimal and CIDR notation.
    # Example: 192.168.0.0/24
    # The addresses of the interfaces are always
    # local and don't need to be specified.
    
    #--local-subnets 192.168.2.0/24
    
    # Sets the domain.
    # ntop should be able to determine this automatically.
    
    #--domain domain.my
    #-----END OF ntop.conf-----
  3. Set the correct file and folder permissions. VERY IMPORTANT!
    $ sudo chmod 644 /Library/LaunchDaemons/org.ntop.ntop.plist
    $ sudo chown -R ntop /usr/local/var/ntop
    $ sudo chown -R ntop /usr/local/etc/ntop

Configuration
Set the password for the admin user of ntop database¬†(from the web interface you’ll be able to create other users with different degree of administration)

$ sudo ntop -t o -u ntop -P /usr/local/var/ntop --set-admin-password

Conclusion

Now start the service using the launchctl command and it will run as a daemon:

$ sudo launchctl load /Library/LaunchDaemons/org.ntop.ntop.plist

You will be able to access ntop through port 3000 (by default) of your server:

http://domain.my:3000

Click on this link to download here the archive containing my prepared copies of org.ntop.ntop.plistand ntop.conf files

If you found this how-to useful, please leave a feedback, it will be really appreciated.

Enjoy!

How-To find the List of my Apple Registered Products

Monday, January 10th, 2011
Listen to me!
Audio MP3

download mp3
If you, like me, are an Apple fan since a long time, you may have owned many i-Products. Some of them may have been lost, stolen, gifted or still in use. Do you remember about all of them? Do you have a list of your Apple devices?

If you have been diligent you may have registered these products, Mac Books, iPod, iPhones, iMacs or iPads in the Apple webpage to check they guarantee status or to submit a request for support.

Did you ever wanted to have a full list of your Apple Registered Products? Did you ever noticed that logging into the Apple Support there is no way to obtain such list?

Now our wish has been fulfilled! Apple has just inaugurated a new support page called¬†My Support Profile that among the usual support services we have been used to see is listing as well the brand new ‘Product Pane’ where it’s possible to register, list, delete and give nicknames to all of your Apple product!

When I’ll be 90 years old who knows how many devices I’ll have listed?
Maybe this is a new advertising strategy that will lead contests between people to demonstrate their fidelity to Apple!

MyAppleProducts

MyAppleProducts

How-To enable VoiceOver feature in your jailbroken iPad

Saturday, January 8th, 2011

Supposed that we are in possession of a jailbroken iPad if we want to enable VoiceOver feature in the iPad there is not a Cydia package unfortunately.

We can anyway accomplish to this task manually following three simple steps:

Step 1 – preparation

You need to install and enable the OpenSSH service first. Once this is done you need to log into the iDevice via command-line or via Cyberduck or any through other SSH client. Unless you changed them for security reasons (as suggestes) the passwords for the root and mobile users are well known:

  • username: root, password: dottie
  • username: mobile, password: alpine

Step 2 – configuration

Once logged into the iPad you need to reach and edit (with ‘vim’ or any other text-editor) the file K48AP.plist at this path:

/System/Library/CoreServices/SpringBoard.app/K48AP.plist

and add the following line :

<key>voice-control</key>
<true/>

as shown below:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>capabilities</key>
<dict>
            <key>voice-control</key>
            <true/>
            <key>720p</key>
             <true/>
      .........

Step 3 – conclusion

As last you need to reboot your iPad, after that you can activate the VoiceOver feature control, holding for a few seconds the ‘Home’ button.. and start speaking!!

What is the difference between Apple’s AirPrint and HP’s ePrint?

Sunday, January 2nd, 2011

“Apple’s AirPrint allows iPhone, iPad and iPod touch customers to print wirelessly to a local printer on their wireless network through an embedded OS print function. HP ePrint allows for printing from anywhere in the world from any mobile device to an HP ePrint enabled printer using the HP cloud – that means the customer can attach a file or document to an email and send it to the printer’s individual email address. Both solutions remove the need for drivers or software downloads.”

from HP’s official “Frequently asked questions about ePrint enabled printers and Apple’s AirPrint

How-To connect to VMware Server Console via Mac OS X

Sunday, January 2nd, 2011
Listen to me!
Audio MP3
download mp3

If you like, as I do,  to administer your network from a workstation runnig Mac OS X and you enjoyed the installation of a VMware Server infrastructure, you will certanly will be disappointed to discover that THERE IS NOT a VMWare Console plug-in for Mac OS X version of Firefox or for Safari.

You still are able to access the VMware Infrastructure Web Access to create, modify, run and stop your virtual machines, but you will not be able to visualize the screen of virtualized servers unless you installed Remote Desktop, Terminal Service or other remotisation solutions suche LogMeIn or TeamViewer or a standart VNC server in the guest operating system.

But what to do if you need to access the BIOS settings of your virtual machines, what if you need to access them in a pre-OS status in case there is some trouble with the OS? What if you are running a virtualized GNU/Linux server and you cannot access it via SSH service?

The right solution came to my hand after a long time searching the web, and fortunately it’s fast and easy to apply and first of all is not tricky and unelegant like forwarding the X11 service via SSH (like many other blogs would suggest).

Here we go, what we need to do is to enable the VNC feature of the VMware server for each Virtual Machine configuration:

  1. Access the VMWare Infrastructure web Access
    (usually at https://<yourserver_domain_name>:8333/ui/)
  2. Select the Virtual Machine instance
  3. Select the ‘Summary’ tab
  4. click on the ‘Configure VM’ option of the ‘Commands’ navigation pane

    VM_Commands

  5. select the ‘Advanced’ tab and start adding the following ‘Configuration Parameters’:
    • RemoteDispaly.vnc.enabled =¬† true
    • RemoteDisplay.vnc.password = <choosen_password>
    • RemoteDisplay.vnc.port = 5900 (a different port for each Virtual Machine is recommended)
    VM_Configuration

    VM_Configuration

    * note that the RemoteDisplay.vnc.key is automatically generated by the VMware server

  6. run any VNC client pointing at <yourserver_domain_name>:5900 and you’ll be able to interact with your virtual machine from your Mac and even from you iPad or iPhone!!!!