Skip to content

Instantly share code, notes, and snippets.

@chrisjsimpson
chrisjsimpson / mosre_hastle_than_its_worth.php
Created Aug 27, 2012
php cli exploit-db.com search via command line
View mosre_hastle_than_its_worth.php
<?php
/* Terminal sript for fast searching of the exploit-db.com/search page
*
* Requires: php5, curl, php-cli, w3m (use sudo apt-get install programName)
*
* For defaults just leave questions blank & press enter.
*
* Notes for improvement:
* > No pagination support (only shows page one of results)
* > Writes search result to a file- this is messy, must be better way
@chrisjsimpson
chrisjsimpson / gist:789cdb6b244cd62e9fad
Created Sep 5, 2015
Decimal to valid EAN code taken from OpenERP POS demo
View gist:789cdb6b244cd62e9fad
function openerp_pos_devices(instance,module){ //module is instance.point_of_sale
var _t = instance.web._t;
// the JobQueue schedules a sequence of 'jobs'. each job is
// a function returning a deferred. the queue waits for each job to finish
// before launching the next. Each job can also be scheduled with a delay.
// the is used to prevent parallel requests to the proxy.
module.JobQueue = function(){
View gist:9eec03d0069a880faf38
array = ['Tree','Log','Table','Chair']
myVar = 'Cat'
if myVar not in array:
print "It's not in the array!"
myVar = ''
View gist:af930054f92fcde59f221d161521a551
# -*- coding: utf-8 -*-
"""
Subscriber Matching Service
~~~~~
Abstract interface for matching subscribers from arbitary payment
information providers, payment institutions, billing systems.
:copyright: © 2018 Karma Computing.
:license: GPLv3, see LICENSE for more details.
"""
from __future__ import absolute_import
View gist:40b369e76d57a9bfd9379ce50bdf596c
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.select import Select
code = input("What's the code?")
fp = webdriver.FirefoxProfile()
View gist:189f4f2df8df122d26001080e06a9ca4
import urllib2
from bs4 import BeautifulSoup
import json
import re
#fp = open('soup.txt')
#doc = fp.read()
response = urllib2.urlopen('https://www.bnpparibas.dz/trouver-une-agence/')
doc = response.read()
@chrisjsimpson
chrisjsimpson / get-direct-login.py
Created Mar 25, 2019
OBP generate direct login token
View get-direct-login.py
'''
You need to install pythin requests library for this to work
e.g. pip install requests
You also need to use python3
'''
import requests
consumer_key = input("Consumer Key --> ")
username = input("Username --> ")
password = input("Password --> ")
@chrisjsimpson
chrisjsimpson / dms2dec.py
Created Apr 1, 2019 — forked from jeteon/dms2dec.py
Convert coordinates in DMS notation to decimal in Python.
View dms2dec.py
#!/env/python
# coding=utf8
"""
Converting Degrees, Minutes, Seconds formatted coordinate strings to decimal.
Formula:
DEC = (DEG + (MIN * 1/60) + (SEC * 1/60 * 1/60))
Assumes S/W are negative.
View main.py
from pprint import pprint
import random
#Order of importance
suit = ['ace', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'jack', 'queen', 'king']
def build_pack():
''' Builds and returns a pack of sorted cards'''
cards = [] # Empty list of cards to be built
# Build hearts
@chrisjsimpson
chrisjsimpson / connect-subscription-fake-flow.sh
Created Nov 24, 2020
Stripe connect create subscription and trigger trial, finalise invoice and confirm payment
View connect-subscription-fake-flow.sh
# Create a customer
CONNECT_ACCOUNT_ID=acct_abc123
CUSTOMER_ID=`stripe customers create --stripe-account=$CONNECT_ACCOUNT_ID | jq -r .id`
# Create a payment method
PAYMENT_METHOD=`stripe payment_methods create --stripe-account=$CONNECT_ACCOUNT_ID \
--type=card \
-d "card[number]"=4242424242424242 \
-d "card[exp_month]"=11 \
-d "card[exp_year]"=2021 \