Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Print the serial number of your disks with this script
ls /dev/disk/by-id/ata* | sed -e '/-part[0-9]*$/d;s/.*_//' | while read SERIAL;
do
DEVICE=$(readlink -f /dev/disk/by-id/ata*${SERIAL});
echo ${DEVICE}" "${SERIAL};
done | sort;
@koshatul
koshatul / ssh-copy-id.sh
Created February 24, 2016 04:14
ssh-copy-id, copied from ubuntu
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then
@koshatul
koshatul / ssh-copy-id-if-needed.sh
Created February 24, 2016 04:23
ssh-copy-id replacement to copy only if key auth fails
#!/bin/bash
########################################################################################
## ssh-copy-id-if-needed
##
## Copies specified identity file to specified server
##
usage() {
echo "usage: $0 [-i [identity_file]] [user@]machine" >&2
exit 1

Keybase proof

I hereby claim:

  • I am koshatul on github.
  • I am kosh (https://keybase.io/kosh) on keybase.
  • I have a public key ASASVFvb8Yngslnj7PAa1Od5urSVKJN9MpUVYK_U36lr2wo

To claim this, I am signing this object:

@koshatul
koshatul / docker-install.sh
Last active May 4, 2018 05:43
Updated docker-install for bionic (when docker releases it)
#!/bin/bash
set -ex
## Install Docker on Ubuntu 16.04 (and probably future versions)
## curl -sSL 'https://gist.githubusercontent.com/koshatul/fa7d71fc38037dbd3094be400f77bf74/raw/docker-install.sh' | /bin/bash /dev/stdin --
sudo apt-get install -qy --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
@koshatul
koshatul / powerdns-ubuntu-install.sh
Last active May 1, 2019 01:28
PowerDNS 4.x Repo installer for Ubuntu
#!/bin/bash
curl -fsSL https://repo.powerdns.com/CBC8B383-pub.asc | sudo apt-key add -
curl -fsSL https://repo.powerdns.com/FD380FBB-pub.asc | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] http://repo.powerdns.com/ubuntu $(lsb_release -cs)-auth-40 main"
sudo add-apt-repository "deb [arch=amd64] http://repo.powerdns.com/ubuntu $(lsb_release -cs)-rec-40 main"
echo "Package: pdns-*
Pin: origin repo.powerdns.com
@koshatul
koshatul / ucaresystem-install.sh
Last active September 12, 2021 17:54
Install ucaresystem-core on Ubuntu 16.04 and potentially above
#!/bin/bash
## Install uCareSystem on Ubuntu 16.04 (and probably future versions)
## curl -sSL 'https://gist.githubusercontent.com/Koshatul/d70e5a658a034facd05de7ff1a526b62/raw/ucaresystem-install.sh' | /bin/bash
sudo apt-get install -y apt-transport-https software-properties-common
sudo add-apt-repository -y ppa:utappia/stable
sudo apt-get update
sudo apt-get -y install ucaresystem-core
@koshatul
koshatul / uninstall-portworx.sh
Last active March 30, 2021 05:29
Uninstall script for portworx.
#!/bin/bash
set -ex
## Uninstall portworx on Ubuntu 16.04 (and probably future versions)
## curl -sSL 'https://gist.githubusercontent.com/koshatul/407c09b2aeff92d2bd59533c4ccec983/raw/uninstall-portworx.sh' | /bin/bash /dev/stdin --
set +ex
sudo systemctl stop portworx
sudo systemctl disable portworx
@koshatul
koshatul / pdagent-install.sh
Created May 21, 2018 04:25
Install Pagerduty Agent on Ubuntu
#!/bin/bash
set -ex
## Install Pagerduty Agent on Ubuntu 16.04 (and probably future versions)
## curl -sSL 'https://gist.githubusercontent.com/koshatul/2aac09cc47447cea8722af34d853f17e/raw/pdagent-install.sh' | /bin/bash /dev/stdin --
sudo apt-get install -qy --no-install-recommends \
apt-transport-https \
ca-certificates \
curl
@koshatul
koshatul / tell-application-password.applescript
Created July 9, 2018 22:50
Applescript OSX method of typing password into apps that block copy/paste
tell application "Franz"
activate
end tell
tell application "System Events"
keystroke "my-really-long-password-from-1password"
end tell