Port Tunneling with Putty

Recently I had a situation where a combination of firewalls and load balancers prevented me from testing an application. Fortunately, an experienced server admin had a solution that I am sharing here: Use putty for port tunneling.

Create and save an SSH session for the host

Create Putty Session
Create Putty Session

Load the session, then go to Connection > SSH > Tunnels

Enter Putty Tunnel Details
Enter Putty Tunnel Details

Enter port and server info then click Add

Save Tunnel Connection
Save Tunnel Connection

Click Open
Return to the Sessions and Save to store for future use
Now you can access the remote machine:port by using localhost:port, i.e., http://localhost:8080 will take you to http://anyhostname:8080 in the above examples.

This can also be done with BitVise Tunnelier (shown below for accessing MySQL):

BitVise SSH Tunneling
BitVise SSH Tunneling
If you found this interesting, please share.

© Scott S. Nelson

Remedial Robocopy Recursion Remedy

If you ever made your own back up script with Robocopy that included the user folders without the /XJ switch and then want to clean up your back up drive, you found this ugly nested structure that you could not delete.

To the rescue is Deep Remove Folders Directories in Windows at http://deepremove.codeplex.com/. Works like a charm. Thank you, JuanPablo!

If you found this interesting, please share.

© Scott S. Nelson

Compact Virtualbox VDI Image to Save Space

Takes me forever to find this StackExchange post every time I need it, so I’m copying it here for ease of reference:

  1. Run defrag in the guest (Windows only)
  2. Nullify free space:

    With a Linux Guest run this:

    sudo dd if=/dev/zero of=/bigemptyfile bs=4096k
    sudo rm -rf /bigemptyfile
    

    With a Windows Guest, download SDelete from Sysinternals and run this:

    sdelete –z
    
  3. Shutdown the guest VM
  4. Now run VBoxManage’s modifyhd command with the --compact option:

    With a Linux Host run this:

    vboxmanage modifyhd /path/to/thedisk.vdi --compact
    

    With a Windows Host run this:

    VBoxManage.exe modifyhd c:pathtothedisk.vdi --compact
    

    With a Mac Host run this:

    VBoxManage modifyhd /path/to/thedisk.vdi --compact
    

This reduces the vdi size.

If you found this interesting, please share.

© Scott S. Nelson

Problem and Solution with telnet on Oracle Linux

[root@oraclelinux6 /]# telnet 192.168.56.1 1521
-bash: telnet: command not found
[root@oraclelinux6 /]# yum install telnet
...[TRUNCATED FOR READABILITY]
Installed:
  telnet.x86_64 1:0.17-47.el6_3.1

Complete!
[root@oraclelinux6 /]# telnet 192.168.56.1 1521
Trying 192.168.56.1...
Connected to 192.168.56.1.
If you found this interesting, please share.

© Scott S. Nelson

Oracle Virtual Box Virtualization Failure Fix

I had a problem starting an Oracle VM on an HP EliteBook and after much searching found that the EliteBook often will have virtualization disabled by default.  I found the answer in an HP Support Forum post, which I am re-posting here for ease of reference and to reduce scrolling on their site:


Enable virtualization in the BIOS
To run Virtual PC and XP Mode in Windows 7, the virtualization must be enabled in the BIOS. Follow these steps to make sure virtualization is enabled.
  1. Shut down the computer and turn it back on. Repeatedly press esc key at startup.
  2. Press the F10 key for BIOS Setup.
  3. Press the right arrow key to System Configuration , select Virtualization Technology and then press the enterkey.
  4. Select Enabled and press the enter key.
  5. Press the F10 key and select Yes and press the enter key to save changes.

It is possible you need to make these changes both in the System Configuration Menu and the Security Menu.


If you found this interesting, please share.

© Scott S. Nelson