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
head /dev/urandom | LC_ALL=C tr -dc 'A-Za-z0-9' | head -c 32 && echo |
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 gql import gql, Client | |
from gql.transport.requests import RequestsHTTPTransport | |
from selenium import webdriver | |
from selenium.webdriver.support.ui import WebDriverWait | |
import os | |
import json | |
import sys | |
import subprocess | |
SPECIAL_CHARS = ['\\', '/', ':', '?', '*', '<', '>', '|'] |
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 twisted.internet import defer, reactor | |
from twisted.trial import unittest, runner, itrial, reporter | |
from argparse import ArgumentParser | |
import logging | |
FORMAT = "%(asctime)s:%(levelname)s:%(name)s:%(message)s" | |
datefmt = "%Y-%m-%d-%H:%M:%S" | |
log = logging.getLogger(__name__) | |
class TestLoaderWithKwargs(runner.TestLoader): |
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 pdfrw import PdfReader, PdfWriter, PdfDict, PdfObject | |
ANNOT_KEY = '/Annots' | |
ANNOT_FIELD_KEY = '/T' | |
ANNOT_VAL_KEY = '/V' | |
ANNOT_RECT_KEY = '/Rect' | |
SUBTYPE_KEY = '/Subtype' | |
WIDGET_SUBTYPE_KEY = '/Widget' | |
def main(): | |
pdf = PdfReader('qpdf.pdf') |
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 functools import wraps | |
import json | |
from klein import Klein | |
class JsonApi(object): | |
""" | |
Reusable class for composing a JSON API easily with minimal | |
repeated code. | |
""" |
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
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by | |
" the call to :runtime you can find below. If you wish to change any of those | |
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim | |
" will be overwritten everytime an upgrade of the vim packages is performed. | |
" It is recommended to make changes after sourcing debian.vim since it alters | |
" the value of the 'compatible' option. | |
" This line should not be removed as it ensures that various options are | |
" properly set to work with the Vim-related packages available in Debian. | |
runtime! debian.vim |
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
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by | |
" the call to :runtime you can find below. If you wish to change any of those | |
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim | |
" will be overwritten everytime an upgrade of the vim packages is performed. | |
" It is recommended to make changes after sourcing debian.vim since it alters | |
" the value of the 'compatible' option. | |
" This line should not be removed as it ensures that various options are | |
" properly set to work with the Vim-related packages available in Debian. | |
runtime! debian.vim |
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
#!/bin/bash | |
#Get the PCI-Address of network card (Caution: This works ONLY with ONE NIC) | |
PCI=`/usr/bin/lspci | /bin/egrep -i 'network|ethernet' | /usr/bin/cut -d' ' -f1` | |
PCIPATH=`/usr/bin/find /sys -name *\${PCI} | /bin/egrep -i *pci0000*` | |
#echo "PCI =$PCI" | |
#echo "PCIPATH=$PCIPATH" | |
#ls -la $PCIPATH |
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
'use strict'; | |
const express = require('express'); | |
const SocketServer = require('ws').Server; | |
const path = require('path'); | |
const PORT = process.env.PORT || 3000; | |
const INDEX = path.join(__dirname, 'index.html'); | |
const server = express() |
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
const net = require('net') | |
class ServerProtocol { | |
constructor(client){ | |
this.client = client | |
this.buffer = "" | |
this.factory = null | |
} | |
handleData(){ | |
this.client.on('data', (data) => { |
NewerOlder