Skip to content

Instantly share code, notes, and snippets.

View bretton's full-sized avatar

bretton bretton

  • Cape Town, South Africa
View GitHub Profile
@dalenunns
dalenunns / SAResources.md
Last active June 17, 2023 13:39
List of SA Resources
@vejuhust
vejuhust / Logger.py
Created February 27, 2017 15:41
Python Wrapper of SoftEtherVPN "vpncmd" Tool
#!/usr/bin/env python3
import logging
# Colorful console
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
@julianxhokaxhiu
julianxhokaxhiu / build.sh
Last active February 19, 2024 22:04
How to build minimal ARM QEMU Static from sources with EXECVE
#!/bin/bash
#
# IMPORTANT!
# At the moment this script is forged only for Debian ( tested on 8.x release ).
# Although my efforts were put on building this also on Arch Linux or Alpine, at the moment only Debian seems to be able to build it.
# Also, not sure why these instructions where nowhere on the internet, therefore I leave them here for whoever need them.
#
###########
# Add Backports repo support
@takinbo
takinbo / lnd-python-client.md
Created January 29, 2017 23:27
Writing a Python gRPC client for the Lightning Network Daemon

How to write a Python gRPC client for the Lightning Network Daemon

  • Create a virtual environment for your project
$ virtualenv lnd
  • Activate the virtual environment
$ source lnd/bin/activate
@shanealynn
shanealynn / python batch geocoding.py
Last active January 6, 2024 13:48
Geocode as many addresses as you'd like with a powerful Python and Google Geocoding API combination
"""
Python script for batch geocoding of addresses using the Google Geocoding API.
This script allows for massive lists of addresses to be geocoded for free by pausing when the
geocoder hits the free rate limit set by Google (2500 per day). If you have an API key for paid
geocoding from Google, set it in the API key section.
Addresses for geocoding can be specified in a list of strings "addresses". In this script, addresses
come from a csv file with a column "Address". Adjust the code to your own requirements as needed.
After every 500 successul geocode operations, a temporary file with results is recorded in case of
script failure / loss of connection later.
Addresses and data are held in memory, so this script may need to be adjusted to process files line
@richardjoo
richardjoo / how-to-manage-exim.md
Last active December 1, 2023 07:25
my most frequently used exim commandlines
  • Print a count of the messages in the queue:

    exim -bpc

  • How to resend frozen messages in exim4 queue

    exim -bp | grep frozen | awk '{print $3}' | xargs exim -v -M

  • Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient):

@joninvski
joninvski / bellman.py
Created November 16, 2010 11:31
Bellman ford python implementation
import pdb
"""
The Bellman-Ford algorithm
Graph API:
iter(graph) gives all nodes
iter(graph[u]) gives neighbours of u
graph[u][v] gives weight of edge (u, v)
"""