Skip to content

Instantly share code, notes, and snippets.

Avatar
💬
twitter.com/denzuko

Dwight Spencer denzuko

💬
twitter.com/denzuko
View GitHub Profile
@Gavinok
Gavinok / sqlval.troff
Last active Jan 29, 2021
demo tsql a troff preprocessor for using sqlite in troff
View sqlval.troff
.\" cat THISFILE | tsql | tbl | groff -Tpdf > THISFILE.pdf
Store info
.sqldb :memory:
.sqlbeg
create table Fam (
name text,
id integer
primary key
@ustropo
ustropo / api.py
Created Mar 27, 2020
Exemplo de configuração de API usando Python Eve
View api.py
from eve import Eve
from .sensor_manager import TempSensorManager
# API configuration
SETTINGS = {
'DOMAIN': {
'sensors': {
'schema': {
'_id': {'type': 'string', 'unique': True},
View code.py
from functools import lru_cache
from datetime import datetime
@lru_cache(maxsize=None)
def fib_cache(n):
if n < 2:
return n
return fib_cache(n-1) + fib_cache(n-2)
def fib_no_cache(n):
View gist:d9f095d4617c1cd47317c702091112cd
Apus Agate Adjacent
Aquila Almandine Adjunct
Aries Amber Almuten
Bootes Amethyst Angular
Caelum Apatite Apside
Cancer Aquamarine Arcing
Canis Azurite Ascendant
Cepheus Beryl Aspecting
Cetus Carnelian Beheld
Corona Chalcedony Benefic
@gmolveau
gmolveau / recutils_tutorial_example.md
Last active Jul 20, 2022
A quick tutorial / example / cheatsheet of recutils https://www.gnu.org/software/recutils
View recutils_tutorial_example.md

recutils tutorial example

https://www.gnu.org/software/recutils/

GNU Recutils is a set of tools and libraries to access human-editable, plain text databases called recfiles.

TO install on mac : brew install recutils

add this to a new file named books.rec

View docker_aliases.sh
function dockershell() {
docker run --rm -i -t --entrypoint=/bin/bash "$@"
}
function dockershellsh() {
docker run --rm -i -t --entrypoint=/bin/sh "$@"
}
function dockershellhere() {
dirname=${PWD##*/}
@livingstonetech
livingstonetech / calculate_totp.py
Created Apr 29, 2019
Reference code to calculate TOTP, given a base32 secret.
View calculate_totp.py
#!/usr/bin/env python3
"""
Gist to calculate Time-based One Time Password (TOTP).
This function is designed to be used in two modes:
- Current Mode
No timestamp supplied, and the current timestamp is considered.
This mode gives the totp at the present moment in time.
- Historic Mode
Here an explicit timestamp is supplied. This is to calculate a TOTP
that had occured at a moment in history.
@WindfallLabs
WindfallLabs / my_tweaks.zs
Last active Nov 12, 2019
ZenScript for MC Recipies
View my_tweaks.zs
///// Variables
///// Removals
///// Replacements/Alterations
import minetweaker.item.IIngredient;
///////////////////////////////////////////////////////////////////////////////
// Variables
///////////////////////////////////////////////////////////////////////////////
@carlessanagustin
carlessanagustin / chronograf_dashboard.sh
Created Dec 7, 2018
Chronograf dashboard import/export tool - EXPERIMENTAL
View chronograf_dashboard.sh
#!/usr/bin/env bash
URL=$2 # http://localhost:8888
FILENAME=$3 # dashboard.json
if [ $1 == "export" ]; then
curl -i -X GET $URL/chronograf/v1/dashboards > $FILENAME
elif [ $1 == "import" ]; then
curl -i -X POST -H "Content-Type: application/json" $URL/chronograf/v1/dashboards -d @$FILENAME
else
View fbctf-bases.txt
### DEBIAN STRETCH ###
PART I: python script
Become root.
1. $ sudo -i
Make fbctf directory in /opt
2. # cd /opt
3. # mkdir fbctf
Get my modified score_base.py script
4. # wget https://gist.githubusercontent.com/Bryan1998/772cf58e6aff7cf360387886f5af56ff/raw/0eae6687df97af7c8246ff468f142730c8375c3c/score_base.py