Skip to content

Instantly share code, notes, and snippets.

@katherinelim
katherinelim / asms-fa-get-db-name.go
Last active September 27, 2024 22:50
Example code for ASMS device DB name retrieval
package main
import (
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
@katherinelim
katherinelim / move-git-directory.md
Created April 10, 2023 11:36
Move a git directory to a new git repo

Move a git directory to a new git repo

In a monorepo, you may eventually want to refactor one of the project folders into another git repository. For example, splitting a large monorepo into several smaller repositories.

Step 1: Make a copy of repository A. DO NOT PUSH CHANGES to repository A.

mkdir cloneA
cd cloneA
git clone <github repository A URL>
@katherinelim
katherinelim / gist:94296c56f73af23ce0d1a40c3ade5d96
Last active July 26, 2022 12:00
Trufflehog trace - could not scan github
docker run -v "$(pwd)":/mnt/workdir --workdir=/mnt/workdir trufflesecurity/trufflehog:latest github --debug --json --only-verified --no-update --org=redacted --token="***" --trace
{"level":"debug","msg":"running version 3.6.10","time":"2022-07-26T11:45:18Z"}
2022/07/26 11:45:18 [updater parent] run
2022/07/26 11:45:18 [updater parent] starting /usr/bin/trufflehog
{"level":"debug","msg":"running version 3.6.10","time":"2022-07-26T11:45:18Z"}
2022/07/26 11:45:18 [updater child#1] run
trufflehog 3.6.10
2022/07/26 11:45:18 [updater child#1] start program
{"level":"debug","msg":"running with up to 8 workers","time":"2022-07-26T11:45:18Z"}

OpenSSL Tips

Copy a Base 64 encoded certificate into the MacOS clipboard and decode on the command line:

pbpaste | base64 -d | openssl x509 -in /dev/stdin -noout -text
@katherinelim
katherinelim / make-mega-adblock-hostsfile.sh
Last active January 12, 2020 06:33
Create Mega Adblock Hostsfile for use with Dnsmasq (Modified from Pi-hole)
#!/bin/bash
# Modified Pi-hole script to generate a generic hosts file
# for use with dnsmasq's addn-hosts configuration
# original : https://github.com/jacobsalmela/pi-hole/blob/master/gravity-adv.sh
# Address to send ads to. This could possibily be removed, but may be useful for debugging purposes?
destinationIP="0.0.0.0"
outlist='./final_blocklist.txt'
tempoutlist="$outlist.tmp"