Skip to content

Instantly share code, notes, and snippets.

View cmbaughman's full-sized avatar
🎯
Focusing

Chris Baughman cmbaughman

🎯
Focusing
View GitHub Profile
@cmbaughman
cmbaughman / touchpad_fix.sh
Created September 22, 2014 15:41
Fix Ubuntu 14.04 Touchpad Issues
sudo apt-get install libevdev-dev
sudo aptitude purge xserver-xorg-input-synaptics
sudo aptitude build-dep xserver-xorg-input-synaptics
sudo git clone git://anongit.freedesktop.org/xorg/driver/xf86-input-synaptics
cd xf86-input-synaptics
wget -q -O - http://xps13-9333.appspot.com/root/0001-Don-t-use-finger-width-for-the-palm-detection.patch | git am
@cmbaughman
cmbaughman / Find_ebooks.sh
Created October 5, 2014 03:23
eBook Open Dir Finder
#!/usr/bin/env bash declare -i CHECK_DIGIT declare -i B if [ ! -d "$2" ] ; then mkdir "$2" ; fi #If the directory I passed doesn't exist, create it find "$1" -iname '*' -type f -print0 | xargs -L 1 -0 | while read F ; do unset ISBN if [ -s "$F" ] ; then #If the file has non zero size then.. if (file -b "$F" | grep -w ^PDF >/dev/null) ; then #The -b flag makes the file utility not print the filename, this is important since if printed, the filename may contain a match for grep which is not what I want, I want to test the file type. #If the file is a PDF then.. P=`pdfinfo "$F" 2>/dev/null 3>/dev/null 99>/dev/null | awk '/^Pages/{if ( $2 > 100 ) print $2 }'` #If the PDF has more than 100 pages, then set the number of pages to the variable P if [ $P ] ; then A=0 while [ ! $ISBN ] ; do case "$A" in 0) A=5 ;; 5) A=6 ;; 6) A=4 ;; 4) A=3 ;; 3) A=2 ;; 2) A=1 ;; 1) A=7 ;; 7) A=8 ;; 8) A=9 ;; 9) A=10 ;; 10) A=12 ;; 12) A=14 ;; 14) A=11 ;; 11) A=13 ;; 13) A=$((P-5)) ;; `expr $P - 5`) A=$((P-4)) ;; `expr $P - 4`) A=$((P-3
@cmbaughman
cmbaughman / find_ebooks.sh
Created October 5, 2014 03:25
eBook Open Dir Finder 2
#!/usr/bin/env bash
declare -i CHECK_DIGIT
declare -i B
if [ ! -d "$2" ] ; then mkdir "$2" ; fi
#If the directory I passed doesn't exist, create it
find "$1" -iname '*' -type f -print0 | xargs -L 1 -0 | while read F ; do
@cmbaughman
cmbaughman / port_scan.sh
Created October 17, 2014 17:58
The poorman's port scanner!
#!/bin/bash
for port in {1..65536}; do
nc -zv 127.0.0.1 $port 2>&1
done | grep open
@cmbaughman
cmbaughman / deploy_to_aws.sh
Created October 30, 2014 00:40
Deploy dockerfile to aws originally by mvanholsteijn, adjustments by me.
#!/bin/bash
shopt -r -o
declare SCRIPT=${0##*/}
#
# all functions
#
function usage() {
echo USAGE: $0 application-name zip-file [environment] [solution-stack]>&2
@cmbaughman
cmbaughman / CoolCommands.sh
Created November 2, 2014 23:30
Pentest from Bash Commands
netstat -tulpn
Show Linux network ports with process ID's (PIDs)
watch ss -stplu
Watch TCP, UDP open ports in real time with socket summary.
@cmbaughman
cmbaughman / Install_Readytalk.sh
Created November 4, 2014 18:30
Ready Talk on Linux
# Just run this command:
bash -c "wget 'https://core.readytalk.com/interface/bin/installer/linux-x86_64/WebMeetingInstaller.sh' -O /tmp/WebMeetingInstaller.sh && sh /tmp/WebMeetingInstaller.sh"
@cmbaughman
cmbaughman / make_ssh_keys.sh
Created November 11, 2014 18:01
Generate New Github.com key
#!/bin/bash
shopt -s -o nounset
declare -rx SCRIPT=${0##*/}
# NOTE: Edit these variables to be whatever you want them to be for your Github key!
declare -rx EMAIL="PUT_EMAIL_HERE"
declare -rx KEYID='PUT_KEYNAME_HERE'
if test -z "$BASH"; then
@cmbaughman
cmbaughman / GifJS.asm
Last active July 20, 2021 05:21
How to execute JavaScript from a GIF!
; a hand-made GIF containing valid JavaScript code
; abusing header to start a JavaScript comment
; inspired by Saumil Shah's Deadly Pixels presentation
; Ange Albertini, BSD Licence 2013
; yamal gifjs.asm -o img.gif
WIDTH equ 10799 ; equivalent to 2f2a, which is '/*' in ASCII, thus starting an opening comment
@cmbaughman
cmbaughman / kill_upstart.sh
Created November 25, 2014 01:29
How to kill upstart
sudo mkdir /etc/init/kill.the.box
touch $(seq 1 1000)
for ((i=1;i<100;i++));
do
touch * * * * * * * &
done
echo "Crash!"