Skip to content

Instantly share code, notes, and snippets.

@april
april / find-all-electron-versions.sh
Last active March 15, 2024 00:56
find all apps using Electron and their versions, on macOS systems
#!/usr/bin/env zsh
# patched versions for CVE-2023-4863: 22.3.24, 24.8.3, 25.8.1, 26.2.1
mdfind "kind:app" 2>/dev/null | sort -u | while read app;
do
filename="$app/Contents/Frameworks/Electron Framework.framework/Electron Framework"
if [[ -f $filename ]]; then
echo "App Name: $(basename ${app})"
electronVersion=$(strings "$filename" | grep "Chrome/" | grep -i Electron | grep -v '%s' | sort -u | cut -f 3 -d '/')
@DrWhax
DrWhax / README.md
Last active February 29, 2024 08:59
How to (securely) contact me

I'm writing this on Github as it will give the reader wanting to get in contact some level of plausible deniability as opposed to visiting my website.

While both websites are encrypted, visiting a more generic website gives you more plausible deniability. Any institution that can wiretap or has metadata retention will only see you connecting to https://gist.github.com/ and not which page youre visiting.

Who am I

I'm a technologist at Amnesty's Security Lab.

Formerly, I was a senior security analyst at OCCRP.

@mbwhite
mbwhite / commands
Last active May 5, 2023 04:58
WSL2 - docker buildx
# start docker - this is a helper script created to start docker as wsl2 doesn't use systemd
docker-start
ping github.com
# why a ping here? emperiically I've determined this has to occur
# otherwise for me the docker daemon messes up dns.
# don't know why, ymmv
wget https://gist.githubusercontent.com/ArturKlauser/0f0293c62f5626df0261ac994d8a46af/raw/d5863dfc22e6d65fd912c9ec760dcdc86ea320cc/check-qemu-binfmt.sh
chmod +x check-qemu-binfmt.sh
@magnetikonline
magnetikonline / README.md
Last active May 3, 2024 12:20
Install jq on macOS from source.

Install jq on macOS from source

Note: as of jq v1.7 the project offers pre-built native macOS releases for ARM64 based architechtures.

A quick n' dirty Bash script to install the following:

  • autoconf.
  • automake.
  • libtool
  • jq - from source.
@mbwhite
mbwhite / versions.js
Created January 19, 2021 11:30
Very simple query of IBP using the node sdk
// Apache-2
// Import and IBP Node SDK, and also two cli helpers
const ibp = require('ibp-node-sdk');
const { table } = require('table');
const chalk = require('chalk');
// package JSON contains
// "chalk": "^4.1.0",
// "ibp-node-sdk": "^0.1.11",
@relyt0925
relyt0925 / provision_ubuntu2004_qemu_macosx.sh
Created May 14, 2020 04:50
Provisions a Ubuntu 20.04 VM in QEMU on Mac OSX using Cloud-Init
#!/usr/bin/env bash
#Install brew and qemu + cloud init metadata dependencies
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install qemu
brew install cdrtools
rm -rf /tmp/ubuntuqemuboot
#download Ubuntu 20.04 Cloud Image and resize to 30 Gigs
mkdir -p /tmp/ubuntuqemuboot/images
@mbwhite
mbwhite / gist:668494565bf0b155c6fb60627f9deb09
Created October 15, 2019 09:46
2.0 LIfecycle cheat sheet
## Cheat Sheet for sequence of commands for v2.0 lifecycle and byfn
docker kill $(docker ps -q) && docker rm $(docker ps -aq)
docker rmi $(docker images dev-* -q) --force
docker volume prune -f && docker network prune -f
./byfn.sh generate
./byfn.sh restart
# org1 ->
docker exec -it cli bash
#!/usr/bin/env bash
CLEARING_VERSION=0.2.6
TMP_DIR=$(mktemp -d)
echo "Temp directory: ${TMP_DIR}"
# stop rest servers
for i in $(ps x| grep composer-rest-server | awk '{print $1}'); do
kill $i
@StevenACoffman
StevenACoffman / Docker Best Practices.md
Last active April 29, 2024 08:36
Docker Best Practices

Mistakes to Avoid: Docker Antipatterns

Whichever route you take to implementing containers, you’ll want to steer clear of common pitfalls that can undermine the efficiency of your Docker stack.

Don’t run too many processes inside a single container

The beauty of containers—and an advantage of containers over virtual machines—is that it is easy to make multiple containers interact with one another in order to compose a complete application. There is no need to run a full application inside a single container. Instead, break your application down as much as possible into discrete services, and distribute services across multiple containers. This maximizes flexibility and reliability.

Don’t install operating systems inside Docker containers

It is possible to install a complete Linux operating system inside a container. In most cases, however, this is not necessary. If your goal is to host just a single application or part of an application in the container, you need to install only the essential

@Jakobud
Jakobud / Vagrantfile
Last active July 28, 2017 21:27
Vagrant Windows 260 character path limit workaround
# If you are using Windows as your Vagrant host OS, there is a limitation in Windows where any given folder path
# cannot be more than 260 characters long. This becomes a problem with Vagrant because, for example, if you
# install a Linux guest environment and try to create a deep directory structure in a synced folder, Linux will
# throw errors. This is because the synced folder is under the constraints of the Windows host. A common example
# of this happening is when installing node.js modules. NPM is known for creating some very long, deep
# folder paths because each node depenency has it's own dependencies, which have their own dependencies, etc...
#
# This gist solves the problem and works around the Windows 260 character path limit. Add it to your Vagrantfile.
#
# NOTE: This bug in Vagrant was fixed in 1.7.3, but reverted back in 1.7.4 due to some regression bugs.