Skip to content

Instantly share code, notes, and snippets.

@brahmana
brahmana / crossplatformui.postrm
Created March 5, 2013 03:32
Update post-uninstall script for the crossplatformui Ubuntu package to make sure it is uninstalled properly without errors. Details are here : http://techbrahmana.blogspot.in/2013/03/package-installation-error-on-ubuntu.html
#!/bin/sh
set -e
SETTING_DATA_PATH=".ztemtapp/ZTEEVDO"
#e.g. /var/lib/dpkg/info
# when execs "sudo dpkg -P xxxx", 1st execute this script with "remove" arg, then execute this script with "purge" arg
if [ "$1" = "remove" ] ; then
sudo sed '/ztemt/d' /etc/init.d/rc.local > tmpfile; sudo mv -f tmpfile /etc/init.d/rc.local; sudo chmod 0755 /etc/init.d/rc.local
@brahmana
brahmana / ec2login.sh
Last active September 30, 2015 02:57
ec2login - A simple bash script to securely login to an EC2 instance machine via SSH sitting behind NAT
#!/bin/bash
# NOTE : This is a very rudimentary and dumb script. With little more work this can be made to accept
# command line arguments which override those specified in the setup.sh file
public_ip_file='/tmp/public_ip_address'
first_arg=$1
fetch_public_ip() {
echo "Fetching public ip address from automation.whatismyip.com service"