Start SSH Agent on Login (Works in Cygwin)

Automatically starting ssh-agent on login to bash shell can be done by adding the following script to “.bash_profile” file in a users home directly. This should work on linux and cygwin. This script was adapted from the stack overflow post start-ssh-agent-on-login.

add this code to '.bash_profile'
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
echo "Manage keys as follows..."
echo "ssh-add <identity file> Add identity file."
echo "ssh-add -L List the keys currently."
echo "ssh-add -D Delete the keys."
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
Extract Files from RPM

While looking for the solution to a RPM packaging problem I used this command to get to the files in existing packages where I thought I could get pieces of the solution from.

Extract RPM Files to Current Directory
rpm2cpio package.rpm | cpio -dimv
Unlock AD Account

First you must make sure that you have the Active Directory module available. This is made available by installing the Remote Server Administration Tools for Windows 7 with Service Pack 1 (SP1). Then navigate into Programs and Features and enable Active Directory Module for Windows Powershell as seen below: Its then as easy as opening a PowerShell prompt and doing the following:

Unlock AD Account
Import-Module activedirectory
Unlock-ADAccount username