Skip to content

Instantly share code, notes, and snippets.

@MineRobber9000
MineRobber9000 / 2fa
Created April 3, 2020 03:45
2-factor authentication terminal app in Python
#!/usr/bin/env python
import os, os.path, stat, sys, base64
# TOTP lib inlined
import time, hmac, base64, hashlib, struct
def pack_counter(t):
return struct.pack(">Q", t)
@eXtrem0us
eXtrem0us / docker-compose.yml
Created February 22, 2020 21:51
Zulip Server Configuration
version: '2'
services:
database:
image: 'zulip/zulip-postgresql:10'
environment:
POSTGRES_DB: 'zulip'
POSTGRES_USER: 'zulip'
# Note that you need to do a manual `ALTER ROLE` query if you
# change this on a system after booting the postgres container
# the first time on a host. Instructions are available in README.md.
@battmatt
battmatt / ForkJoinAPI.py
Last active March 21, 2024 20:50
Example Parallel Task API based on Celery
# (c) Copyright 2018 Zymergen, Inc.
# All Rights Reserved
"""
The following is example code used for a technology blog post: https://medium.com/@ZymergenTechBlog/building-a-parallel-task-api-with-celery-dbae5ced4e28
The ForkJoin class can be used to generate a ZWork task that contains a single
distributed processing step. Your job should have 3 parts. An initial setup step
responsible for splitting of inputs into workable chunks. A process step that can
process each chunk in a forked execution process and a join step that puts it all
@bradtraversy
bradtraversy / pipenv_cheat_sheet.md
Last active May 10, 2024 21:24
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@slifer2015
slifer2015 / cbc.go
Last active October 30, 2018 12:40
AES 256 CBC 32byte block size IV support golang implementation
package encryption
import (
"crypto/cipher"
"runtime"
"unsafe"
)
func dup(p []byte) []byte {
q := make([]byte, len(p))
#!/bin/bash
##
while true
do
proxychains curl -s https://bonbast.com | lynx --dump --stdin|grep USD|awk '{print $5}'
sleep 60
done
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@ipmb
ipmb / settings.py
Last active November 24, 2023 20:25
Django logging example
import logging.config
import os
from django.utils.log import DEFAULT_LOGGING
# Disable Django's logging setup
LOGGING_CONFIG = None
LOGLEVEL = os.environ.get('LOGLEVEL', 'info').upper()
logging.config.dictConfig({
@ipmb
ipmb / 0_default_tree.md
Last active May 17, 2022 00:37
Django Logging Variations

Default Django Logging Tree

app.py

#!/usr/bin/env python
import os

import django
import logging_tree
@ruanbekker
ruanbekker / cheatsheet-elasticsearch.md
Last active April 24, 2024 00:11
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl