Skip to content

Instantly share code, notes, and snippets.

@mbreslow
mbreslow / gist:5301933
Last active September 20, 2017 20:36
Get a list of sessions in Oracle RDS + command to kill session
SELECT s.inst_id,
s.sid,
s.serial#,
p.spid,
S.Username,
S.Program,
'exec rdsadmin.rdsadmin_util.kill('||s.sid||','||s.serial#||');'
FROM gv$session s
Join Gv$process P On P.Addr = S.Paddr And P.Inst_Id = S.Inst_Id
Where S.Type != 'BACKGROUND'
# I was running spectaql to generate documentation for my GraphQL API and it complained about
# directives that I had in my schema file. I threw errors including
# - Unknown directive "@model".
# - Unknown directive "@auth".
# - Unknown directive "@index".
# - Unknown directive "@hasOne".
# These are all directives you would use when developing an Amplify app.
#
# Created this file to include as the first schemaFile in specaql.yml so that the graphql
# parser is aware of the directives and can simply ignore them.
@mbreslow
mbreslow / gist:18a4f36b3433bfa8c4069c4f466e8637
Created July 9, 2024 12:38
Python Code to Query Position in United Airlines Upgrade List
import requests
import os
from datetime import datetime
import difflib
# Ensure the 'runs' directory exists
runs_dir = 'runs'
os.makedirs(runs_dir, exist_ok=True)
FLIGHT_NUMBER = '78'