Skip to content

Instantly share code, notes, and snippets.

View treble37's full-sized avatar
🏠
Working from home

Bruce Park treble37

🏠
Working from home
View GitHub Profile
@treble37
treble37 / extract_har.py
Created September 3, 2022 23:35 — forked from kafran/extract_har.py
Python 3 script to extract images from HTTP Archive (HAR) files
import json
import base64
import os
# make sure the output directory exists before running!
folder = os.path.join(os.getcwd(), "imgs")
with open("scr.har", "r") as f:
har = json.loads(f.read())
@treble37
treble37 / terms_of_service.markdown
Created July 9, 2022 04:06 — forked from devver/terms_of_service.markdown
A general Terms of Service under the Creative Commons License

Terms of Service

Last revised on [DATE]

The Gist

[COMPANY] operates the [SERVICE] service, which we hope you use. If you use it, please use it responsibly. If you don't, we'll have to terminate your account.

For paid accounts, you'll be charged on a monthly basis. You can cancel anytime, but there are no refunds.

@treble37
treble37 / sha256-hmac.md
Created June 9, 2021 21:45 — forked from jasny/sha256-hmac.md
Hashing examples in different languages

Example inputs:

Variable Value
key the shared secret key here
message the message to hash here

Reference outputs for example inputs above:

| Type | Hash |

@treble37
treble37 / gist:b5084d187ef9eb6226e68967afa68033
Created December 10, 2020 05:01 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@treble37
treble37 / messages.ex
Created October 10, 2020 17:41 — forked from evadne/messages.ex
Stream Iterator
defmodule StreamIterator.Messages do
@moduledoc """
The Stream Iterator can be used to consume items from an Elixir Stream incrementally.
## Examples
### Infinite Streams
When used on infinite streams such as the ones returned by `Stream.cycle/1`, the Stream
Iterator will always return the next item.
@treble37
treble37 / NmapHeartbleed.md
Last active August 21, 2020 21:43 — forked from bonsaiviking/NmapHeartbleed.md
Guide to using Nmap to scan for the Heartbleed bug.

Requirements

  1. Nmap. The script requires version 6.25 or newer. The latest version, 6.47, already includes the next 3 dependencies, so you can skip directly to the Scanning section below.
    • An easy way to get the latest Nmap release is to use Kali Linux.
    • Binary installers are available for Windows.
    • RPM installer available for Linux, or install from source.
    • .dmg installer available for Mac OS X.
  2. tls.lua. The script requires this Lua library for TLS handshaking.
  3. ssl-heartbleed.nse. This is the script itself.
@treble37
treble37 / rename_column.sql
Created February 8, 2019 22:26 — forked from miguelmota/rename_column.sql
PostgreSQL rename column if not exists
DO $$
BEGIN
IF NOT EXISTS(SELECT *
FROM information_schema.columns
WHERE table_name='my_table' and column_name='my_column')
THEN
ALTER TABLE "public"."my_table" RENAME COLUMN "my_column" TO "my_new_column";
END IF;
END $$;
@treble37
treble37 / mac-build-pgmodeler.md
Created February 7, 2019 03:35 — forked from jdforsythe/mac-build-pgmodeler.md
Build pgmodeler on Mac with Homebrew-installed pg and openssl

Building pgmodeler for Mac

Check requirements at https://pgmodeler.io/installation.

You will need Qt 5.9.x installed, full XCode installed, and homebrew installation of postgres and openssl.

The example below is v10.5 of PG and v5.9.6 of Qt, modify accordingly. Also, replace {{USERNAME}} with you Mac username.

The installation is the same as the instructions at the link above. There are a few path differences due to homebrew installation locations.

@treble37
treble37 / rebuilding_espec_macro_resource_links.md
Last active March 15, 2020 22:22
Rebuilding a BDD Framework (ESpec) Metaprogramming Resource Links
@treble37
treble37 / install_elixir.md
Last active February 19, 2019 03:06
Elixir installation guide and contributing to Elixir

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.