Skip to content

Instantly share code, notes, and snippets.

View jaboutboul's full-sized avatar

Jack Aboutboul jaboutboul

  • ex-Red Hat, ex-Twilio
  • NYC
View GitHub Profile
#version=Alma9
# Use graphical or text install
# graphical
text
repo --name="AppStream" --baseurl=http://repo.almalinux.org/almalinux/9.0/AppStream/
%packages
@^minimal-environment
#@^virtualization-host-environment
@jaboutboul
jaboutboul / gist:33576a12b740ec071ed905c3767ef6cf
Created February 1, 2022 14:16
Docker Run command for immudb
docker run -d -p 3322:3322 -it --rm --name immudb codenotary/immudb:latest
Verifying my Blockstack ID is secured with the address 1NmKpvvMPwf8GnvggFkqbn2TRKHF7KyxWo https://explorer.blockstack.org/address/1NmKpvvMPwf8GnvggFkqbn2TRKHF7KyxWo

Keybase proof

I hereby claim:

  • I am jaboutboul on github.
  • I am jaboutboul (https://keybase.io/jaboutboul) on keybase.
  • I have a public key ASAb-fWVutbl6mJOltdHMVQIVIUZPSmM6ChC7tQxaNhE8Ao

To claim this, I am signing this object:

@jaboutboul
jaboutboul / database.py
Created August 30, 2012 21:21
kivikfinder-db
import psycopg2
from sqlalchemy import *
import ikea2
from twilio.rest import TwilioRestClient
import sys
import local_settings
#connect to database
db = create_engine(local_settings.DB_INFO)
metadata=MetaData(db)
@jaboutboul
jaboutboul / bitly.py
Created August 30, 2012 21:19
kivikfinder-bitly
#create Bitly Url
def makeBit(url):
b = bitlyapi.BitLy("mauerbac", local_settings.BITLY_API_KEY) #Add bitly API key
res = b.shorten(longUrl=url)
return res['url']
@jaboutboul
jaboutboul / findproblems.py
Created August 30, 2012 21:19
kivikfinder-findproblems
#after problem is detected, find the problem
def findproblems(html,soup,br,user_id,number):
soup=BeautifulSoup(html, "lxml")
#searches for No location text
noavailable=soup.findAll("div", {"class": "sc_com_noLocationText sc_find_it_location_text"})
noavailablesize=len(noavailable)
noresults=soup.findAll("h2", {"class": "headerLeftNavi"}) #searches for "search results" -meaning invaild entry
nosize=len(noresults)
outofstock=soup.findAll("div", {"class": "sc_com_stockInfo sc_graph_stockInfo_container"}) #searches for out of stock text
outofstocksize=len(outofstock)
@jaboutboul
jaboutboul / pullinfo.py
Created August 30, 2012 21:17
kivikfinder-pullinfo
def pullInfo(html,br,user_id,number):
soup=BeautifulSoup(html)
loc=soup.findAll("div", {"class": "sc_com_locationNo sc_find_it_location_number"}) #find location
locsize=len(loc)
if(locsize==0): #check for problems
findproblems(html,soup,br,user_id,number)
if(locsize>2): #check for multiple locations
response=doubleloc(user_id,locsize,loc,soup)
return sendOut(response,number)
aisle=loc[0].text #pull aisle number
@jaboutboul
jaboutboul / soup.py
Created August 30, 2012 21:15
kivikfinder-soup
soup=BeautifulSoup(html, "lxml") #create soup object from page response
loc=soup.findAll("div", {"class": "sc_com_locationNo sc_find_it_location_number"}) #try to find loc & bin
locsize=len(loc)
#is location available
if(locsize==0):
return findproblems(html,soup,br,userid,number)
response= pullInfo(html,br,userid,number)
return sendOut(response,number)
@jaboutboul
jaboutboul / mechanize.py
Created August 30, 2012 21:11
kivikfinder-mechanize
itemnum=message
br=mechanize.Browser()
br.open("http://www.ikea.com/us/en/catalog/stockcheck/") #open catalog
br.select_form(name="stocksearch") #select form
br.form['query']= itemnum #pass item number
br.form['ikeaStoreNumber1']= [local_settings.STORE_NUMBER]
br.submit() #submit form
html=br.response().read()