24/05/2014

[Windows] Scan hosts for open ports without Telnet with PortQry

When testing a connection, you'll probably want to check if a particular port is reachable on the destination host. Telnet is fine enough for this task:

telnet host port

but unfortunately, Windows comes with the Telnet client disabled by default. Since enabling it requires you to have Administrator privileges, an alternative is to use Microsoft PortQry which is a command line tool with no installation required.

After downloading and extracting it, you can run it as:

portqry -n host -e port

[VmWare] Reduce guest swapping

VmWare allows you to specify how the guest system handles swapping to the host disk. Much like Linux's swappiness value, you can suggest to use more host memory instead of swapping to disk; this is especially useful if you do not have a swap partition.

To edit the setting, open your VM's .vmx file, while the VM is powered off, using text editor and add these lines:

MemTrimRate = "0"
mainMem.useNamedFile = "FALSE"
sched.mem.pshare.enable = "FALSE"
prefvmx.useRecommendedLockedMemSize = "TRUE"

Note: If you are using a Linux host, use the following entry instead of mainMem.useNamedFile which only applies to Windows hosts:

mainmem.backing = "swap"


[Ubuntu] Add swap partition and change swappiness

If for some reason(s) you decided to install Ubuntu without specifying a swap partition, you can still add one (or a swapfile) later on without too much hassle.

[Debian] Run Wireshark as non-root user

Wireshark by default enables only the root user to capture network traffic; the idea is that as a root user you'll capture and store the traffic and as non-root user you'll perform any analysis you need. This unfortunately does not allow you to perform a "live capture" where you can work on the data while it is freshly captured from your network interface.

To enable non-root users to run a live capture too, simply dpkg-reconfigure it:

sudo apt-get install wireshark
sudo dpkg-reconfigure wireshark-common

When prompted to allow non-root user to perform restricted operations, say Yes.

Then logout and login again and you should be set. If not, add your user to the wireshark group:

sudo usermod -a -G wireshark $USER

[Debian] Test APT changes without altering the system

The APT package manager allows you to test the changes a command would perform without altering the system. To do that, simply add --dry-run to the desired command (usually an install or remove one).

Eg:

apt-get install SOMEPACKAGE --dry-run

Will show you what dependencies will be installed alongside the specified package but no actual installation will take place.

[Linux] Add Wine-installed application launcher to panel or menu

If you need to run Windows applications under Linux, then you're probably using WineHQ. To add a Wine-installed application launcher to the desktop panel or menu, just add a new "Custom launcher" with this command:

bash -c "wine PATH/TO//FILE.EXE"

[FileZilla] Connect to SFTP site with PPK key file

To connect to an SFTP site using a PPK key file with FileZilla, you'll just have to follow some simple steps.

First, add the key file to FileZilla under Preferences->Settings->Connection->SFTP

Then, from the Site Manager fill the fields with the values for your SFTP connection. If you don't need to put in a password, choose "Normal" as "Logon type"