Skip to content

Instantly share code, notes, and snippets.

View gtback's full-sized avatar

Greg Back gtback

  • Indiana, US
  • 17:37 (UTC -04:00)
View GitHub Profile
@sakurai-youhei
sakurai-youhei / MultiValueHeaders.py
Created June 16, 2021 12:35
Sample code for "multiple message-header fields with the same field-name" in Python plus requests
from collections import OrderedDict
from http.client import HTTPMessage
class MultiValueHeaders(HTTPMessage):
'''https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2'''
_separator_ = ', '
def items(self):
headers = OrderedDict()
for key, value in super().items():
@tamphh
tamphh / git_fzf.sh
Last active March 30, 2024 20:32 — forked from junegunn/gist:f4fca918e937e6bf5bad
Browsing git commit history with fzf
# git log show with fzf
#
# https://gist.github.com/tamphh/3c9a4aa07ef21232624bacb4b3f3c580/edit
# https://asciinema.org/a/257939
#
# git log show with fzf
gli() {
# param validation
@elasticdog
elasticdog / LICENSE
Last active October 17, 2022 14:00
Git Triangular Workflow
Copyright (c) 2018, Aaron Bull Schaefer <aaron@elasticdog.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@Neo23x0
Neo23x0 / yara_performance_guidelines.md
Last active April 30, 2024 10:39
YARA Performance Guidelines

This Gist has been transfered into a Github Repo. You'll find the most recent version here.

YARA Performance Guidelines

When creating your rules for YARA keep in mind the following guidelines in order to get the best performance from them. This guide is based on ideas and recommendations by Victor M. Alvarez and WXS.

  • Revision 1.4, October 2020, applies to all YARA versions higher than 3.7
@imjasonh
imjasonh / markdown.css
Last active February 12, 2024 17:18
Render Markdown as unrendered Markdown (see http://jsbin.com/huwosomawo)
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;
}
@gtback
gtback / contagio_unzip.py
Last active March 23, 2021 04:25
Contagio Unzip
#!/usr/bin/env python
"""
Extract malware from Contagio Zip files, determining the password
automatically.
Note that the password for each zip file consists of a common base password
along with the last character of the file name (prior to the .zip extension).
If you don't know the base password, please contact Mila directly.
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@sloria
sloria / bobp-python.md
Last active May 9, 2024 01:42
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@hofmannsven
hofmannsven / README.md
Last active May 3, 2024 15:30
Git CLI Cheatsheet
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name