Skip to content

Instantly share code, notes, and snippets.

View darrenpmeyer's full-sized avatar

Darren P Meyer darrenpmeyer

View GitHub Profile
@darrenpmeyer
darrenpmeyer / autobuild-openconnect-8-ubuntu.sh
Created June 10, 2020 16:21
Autobuild script for OpenConnect 8 (Ubuntu 18/19 bionic/eoan)
#!/usr/bin/env bash
oc_ver="8.10"
echo "Autobuild OpenConnect $oc_ver"
echo " "
echo "This script uses apt-get and make install via sudo rights"
echo "To simplify this, we're going to use sudo -v to pre-authenticate you"
sudo -k
sudo -v
@darrenpmeyer
darrenpmeyer / ip4-alias.sh
Created June 10, 2022 18:10
Perl one-liner to get IP address from mDNS/DNS/Bonjour/whatever - works on any *nix that supports getHostByName
# usage: `ip4 HOSTNAME`
alias ip4='perl -MSocket -e '\''$pack=gethostbyname($ARGV[0]); print inet_ntoa($pack)'\'''
@darrenpmeyer
darrenpmeyer / start-gocryptfs.sh
Created June 28, 2022 13:55
Encrypted Dropbox/Box/GoogleDrive folder on macOS using gocryptfs
#!/usr/bin/env bash
set -euo pipefail
## encrypted files; script will create this. Put in a synced folder
ENCRYPTED_FOLDER="~/Dropbox/encrypted"
## mountpoint; script will create this. Should stay empty when not mounted!
## DO NOT PUT THIS IN A SYNCED FOLDER - DOING SO WILL SYNC UNENCRYPTED DATA
MOUNTPOINT="~/.local/cloudmount/Dropbox-Encrypted"
@darrenpmeyer
darrenpmeyer / local_user_x11_applications.md
Created February 15, 2023 16:19
HOWTO allow a specific local user access to your current X11 session

The Problem

You're happly running a desktop X11 session as user anne; but you want to be able to run an X11 application in that session as bob, but wehn you try to do this you get:

X-Server access is denied on host

The solution

@darrenpmeyer
darrenpmeyer / burp-hidpi.md
Created October 19, 2020 21:34
Pixel Doubling / HiDPI display support for BurpSuite

Running BurpSuite on a HiDPI display, and that makes the interface window tiny and unreadable?

Just set the _JAVA_OPTIONS environment variable so that it includes -Dsun.java2d.uiScale=2

On Linux, you can edit the BurpSuiteCommunity executable shell script wherever it's been installed, to include the following line near the top (below the #! line, though!):

export _JAVA_OPTIONS="-Dsun.java2d.uiScale=2"
@darrenpmeyer
darrenpmeyer / decrypt-howto.md
Created December 23, 2020 02:36
Decrypt Unifi .unf backups

NB: these instructions are for Ubuntu; they work under WSL on Windows 10 as well

Get the decrypt.sh file from here: https://github.com/zhangyoufu/unifi-backup-decrypt

Make sure prerequisites are installed:

sudo apt update && sudo apt install zip unzip openssl mongo-tools
@darrenpmeyer
darrenpmeyer / README.md
Created November 20, 2020 19:35
Automatically start a single instance of ssh-agent for all terminal sessions to share (bash)

Installation

  1. mkdir -p ~/.config && touch ~/.config/ssh-agent.pid
  2. Paste the contents of ssh-agent-manage.sh into your .bashrc or .bash_profile or similar
  3. killall -9 ssh-agent
  4. Start a new terminal session (note: old sessions will not see ssh-agent, only new ones)

Details

This snippet, when included in .bashrc, will ensure that your session has a working ssh-agent with all your ssh keys loaded into it. It does this without creating separate ssh-agent processes by:

@darrenpmeyer
darrenpmeyer / open-vm-tools-vmware-ubuntu-sharing.md
Last active April 10, 2024 19:18
open-vm-tools and VMWare Shared Folders for Ubuntu guests

(NB: adapted from this Ask Ubuntu thread -- tested to work on Ubuntu 16.04 LTS through Ubuntu 22.04 LTS (Jammy).

Unlike using VMWare Tools to enable Linux guest capabilities, the open-vm-tools package doesn't auto-mount shared VMWare folders. This can be frustrating in various ways, but there's an easy fix.

TL;DR

Install open-vm-tools and run:

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other