This file contains hidden or 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 django.core.management.base import BaseCommand, CommandError | |
| from django.contrib.auth.models import User | |
| import ldap | |
| class Command(BaseCommand): | |
| help = 'Syncs LDAP users with Django DB' | |
| def handle(self, *args, **options): | |
| l = ldap.initialize(settings.AUTH_LDAP_SERVER_URI) |
This file contains hidden or 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 PIL import Image | |
| import tqdm | |
| import math | |
| import vector | |
| height = 320 | |
| width = 240 | |
| scene = {} |
This file contains hidden or 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
| import glob | |
| from collections import defaultdict | |
| classes = defaultdict(lambda: defaultdict(list)) | |
| class Klass: | |
| def __init__(self, name, project): | |
| self.name = name | |
| self.project = project |
This file contains hidden or 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
| import socket | |
| from pyvmu import vmu931, messages | |
| class VMUTransmit(object): | |
| def __init__(self, ip, port, device="/dev/tty.usbmodem1411", euler=True, accelerometer=True, quaternion=True): | |
| self.__device = device | |
| self.__euler = euler | |
| self.__accelerometer = accelerometer |
This file contains hidden or 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
| # frames is a list of mdarrays | |
| new_image = np.zeros(frames[n].shape, dtype=frames[n].dtype) | |
| for ny, y in tqdm(enumerate(flow)): | |
| for nx, flow in enumerate(y): | |
| x_flow, y_flow = flow | |
| new_x = int(nx+x_flow*flow_scaling) | |
| new_y = int(ny+y_flow*flow_scaling) |
This file contains hidden or 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 slackclient import SlackClient | |
| from datetime import datetime | |
| import time | |
| slack_token = 'xoxb-token-goes-here' | |
| sc = SlackClient(slack_token) | |
| if sc.rtm_connect(): | |
| while True: | |
| try: |
This file contains hidden or 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 flask import Flask, request, Response, abort, send_from_directory | |
| from selenium import webdriver | |
| import sqlite3 | |
| import uuid | |
| app = Flask(__name__) | |
| conn = sqlite3.connect("screenshots.sqlite") | |
| c = conn.cursor() |
This file contains hidden or 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
| import time | |
| import random | |
| from queue import Queue | |
| from multiprocessing import Process | |
| import os | |
| def produce_data(q): | |
| print("[+] Producer thread started (PID: {})".format(os.getpid())) | |
| while True: |
This file contains hidden or 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
| Windows Registry Editor Version 5.00 | |
| [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers] | |
| "ForceCSREMFDespooling"=dword:00000000 |
This file contains hidden or 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
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "github.com/elazarl/goproxy" | |
| "gopkg.in/h2non/filetype.v1" | |
| "log" | |
| "net/http" | |
| ) |