Skip to content

Instantly share code, notes, and snippets.

View samloh84's full-sized avatar

Samuel Loh Yin Kang samloh84

View GitHub Profile
@samloh84
samloh84 / pageant.cmd
Created July 18, 2014 02:23
Pageant batch file to load all keys
set expanded_list=
for /f "tokens=*" %%F in ('dir /b /a:-d "%USERPROFILE%\.ssh\*.ppk"') do call set expanded_list=%%expanded_list%% "%%F"
start /B /I "Pageant" "C:\Program Files (x86)\PuTTY\pageant.exe" %expanded_list%
@samloh84
samloh84 / README.md
Last active September 23, 2015 08:50
Bash script to check remote servers via SFTP

Assign a value to the RECIPIENTS variable to enable email.

Assign a value to the LOG_FILE variable to enable logging to a file.

@samloh84
samloh84 / gist:0a56563e456879bb7fc5
Last active December 8, 2015 02:56
docker aliases
alias docker-ip='docker-machine ip default'
alias docker-env='eval "$(docker-machine env default)"'
alias docker-restart='docker-machine restart default; eval "$(docker-machine env default)"'
alias docker-cleanup-images='docker rmi $(docker images -q)'
alias docker-cleanup-containers='docker rm $(docker ps -aq)'
@samloh84
samloh84 / add-swap.sh
Created December 10, 2015 07:20
Add Swap File Bash Script
#!/bin/bash
sudo dd if=/dev/zero of=/swapfile bs=1024 count=8G \
&& mkswap /swapfile \
&& swapon /swapfile \
&& chown root:root /swapfile \
&& chmod 0600 /swapfile \
&& echo "/swapfile swap swap defaults 0 0" >> /etc/fstab \
@samloh84
samloh84 / add-swap.sh
Last active December 10, 2015 07:20
Add Swap File Bash Script
#!/bin/bash
sudo dd if=/dev/zero of=/swapfile bs=1024 count=8G \
&& mkswap /swapfile \
&& swapon /swapfile \
&& chown root:root /swapfile \
&& chmod 0600 /swapfile \
&& echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
@samloh84
samloh84 / index.html
Created January 24, 2016 04:00
Acronym Generator
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Acronym Generator</title>
</head>
<body>
<div id="app">
Blog post: Ryan Huber - Distributed Security Alerting
https://medium.com/several-people-are-coding
Video: Zane Lackey - Building a Modern Security Organization
https://duo.com/blog/duo-tech-talk-building-a-modern-security-engineering-organization
Krebs on Security Blog
https://www.krebsonsecurity.com
Sony Breach
@samloh84
samloh84 / Cask
Last active November 19, 2016 14:03
#!/bin/bash
command_exists () {
type "$1" &> /dev/null ;
}
xcode-select --install 2>&1 | grep -q "installed"
if [ ! $? -eq 0 ]; then
xcode-select --install
fi
@samloh84
samloh84 / ANSI Shadow.flf
Last active February 6, 2017 10:19
Figlet Text Banner Generation
flf2a$ 7 7 13 0 7 0 64 0
Font Author: ?
More Info:
https://web.archive.org/web/20120819044459/http://www.roysac.com/thedrawfonts-tdf.asp
FIGFont created with: http://patorjk.com/figfont-editor
$ $@
$ $@
#!/bin/bash
TARGET_HOST=${TARGET_HOST:-openshift.$(dnsdomainname)}
ssh-keyscan -H ${TARGET_HOST} >> ~/.ssh/known_hosts
if [[ ! -d openshift-ansible ]]; then
sudo yum groupinstall -y "Development Tools"
sudo yum install -y git python2 python2-pip python2-devel python34 python34-pip python34-devel python-passlib libselinux-python openssl-devel java-1.8.0-openjdk-headless
sudo pip install --upgrade pip