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."[email protected]:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "[email protected]:"]
	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 / accidentally_renames_instance_variables.rb
Created March 24, 2018 18:51 — forked from JoshCheek/accidentally_renames_instance_variables.rb
Example of the kinds of issues you can hit when you directly mess with memory
require 'fiddle'
public def class=(new_class)
obj_ptr = Fiddle::Pointer.new 2*self.object_id
klass_ptr = Fiddle::Pointer.new 2*new_class.object_id
obj_ptr[8, 8] = klass_ptr.ref[0, 8]
end
class A
attr_accessor :a, :b, :c
end
@treble37
treble37 / git_submodules.md
Created July 25, 2017 23:51 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.