Skip to content

Instantly share code, notes, and snippets.

@historypeats
historypeats / echo.py
Created June 27, 2019 20:08
This is what argv is used for.
#!/usr/bin/env python
import sys
if len(sys.argv) < 2:
print("Give me something to say!")
sys.exit(1)
word = sys.arvv[1]
print(word)
@historypeats
historypeats / bash_tips.md
Last active June 22, 2018 15:38
Bash Coding Tips

Remove whitespace before and after line from a file

cat file | awk '{$1=$1};1'

Diff results from fileA and fileB and only show fileB unique lines. FileC should have only the new results

comm -3 fileA fileB > file C

@historypeats
historypeats / food_for_thought.txt
Last active September 29, 2017 14:02
Food For Thought - Cheat Enabled
Bypassing Seamless "Minimum Delivery"
OBLIGATORY NOTE: EDUCATIONAL PURPOSES ONLY. Lol.
Background:
I was just playing around looking for bugs when I noticed there was a vulnerability in the Seamless "Minimum Delivery" checkout workflow.
Problem:
When ordering for delivery from Seamless, restaurants often want a minimum delivery. This does not include the tip added to the order.
Therefore, you must order past the minimum delivery, and then add your tip on top of that. If you do not meet the minimum delivery price,
you are unable to go to the checkout page because the button is greyed out.
{
"severity": "High",
}
@historypeats
historypeats / sad.sh
Last active April 21, 2017 15:23
Life without 'W' and 'A'
#!/usr/bin/env bash
# Some bro tryin to not remove their dubyas...
if [ $# -eq 0 ]
then
exit 0
fi
# A life without dubyas and ayes
echo "$1" | sed -e s/[wWaA]//g
@historypeats
historypeats / gist:7c9b500cfa4bca456f268f033b06fd23
Last active March 24, 2017 15:33
Rbenv Ruby Installation on 16.04 Digital Ocean
1. Install prereqs:
apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev libreadline-dev
2. Clone rbenv (note: switch the user you want to install ruby/rails for. e.g. service account):
cd ~ && git clone https://github.com/rbenv/rbenv.git ~/.rbenv
3. Add rbenv to path:
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
@historypeats
historypeats / 00.howto_install_phantomjs.md
Created March 21, 2017 20:56 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev