Skip to content

Instantly share code, notes, and snippets.

View butterl's full-sized avatar

butterl

View GitHub Profile
@baryluk
baryluk / library_dependencies.py
Last active March 3, 2024 00:38
Graph binary / library / dynamic library / shared object / so / ELF files, dependencies as a graph
#!/usr/bin/env python3
# Copyright: Witold Baryluk, 2019-2024. MIT license
# This small program takes one parameter, a binary (or library), and outputs
# a dependency graph. This is done recursively for all subdependencies.
# Some common dependencies are ignored like this ones to glibc basic libraries.
# The ones related to stdc++ / gcc are not ignored (otherwise the graph would be very dense).
#
# To generate and render dependency graph in one go, use something like this:
@Lewiscowles1986
Lewiscowles1986 / rPi3-ap-setup.sh
Last active July 16, 2023 15:33
Raspberry Pi 3 access-point-setup
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
@pescobar
pescobar / build-git.sh
Created October 5, 2015 07:14
compile git with openssl instead of gnutls
#!/usr/bin/env bash
# Clear out all previous attempts
rm -rf "/tmp/source-git/"
# Get the dependencies for git, then get openssl
sudo apt-get install build-essential fakeroot dpkg-dev -y
sudo apt-get build-dep git -y
sudo apt-get install libcurl4-openssl-dev -y
mkdir -p "/tmp/source-git/"
@varemenos
varemenos / 1.README.md
Last active April 21, 2024 23:21
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@jschaub30
jschaub30 / csv2html.sh
Last active July 1, 2023 18:46
Bash script to convert a simple CSV file into an HTML table
#!/bin/bash
# Script to convert a *simple* CSV file into an HTML table
# Will fail if field data contains comma or newlines
#
# USAGE: bash csv2html.sh CSV_FN [BORDER_WIDTH] > OUTPUT_HTML_FN
usage (){
echo "USAGE: $0 CSV_FN [BORDER_WIDTH] > OUTPUT_HTML_FN"
echo "Examples:"
echo "$0 /tmp/input.csv > /tmp/output.html"
@beugley
beugley / httplib_proxy.py
Last active February 22, 2023 12:21
Python: use httplib with proxy authentication
import urlparse
import httplib
import base64
proxy_uri = "http://user:password@proxy_host:proxy_port"
host = 'www.google.com'
port = 443
url = urlparse.urlparse(proxy_uri)
conn = httplib.HTTPSConnection(url.hostname, url.port)
@tzermias
tzermias / ip_forward.md
Last active May 5, 2024 17:03
Forward traffic from wlan0 to eth0 interface

Forward traffic from a laptop's eth0 to wlan0

###To laptop

Specify an IP address to eth0 (here 192.168.56.1)

sudo ifconfig eth0 192.168.56.1 netmask 255.255.255.0