Skip to content

Instantly share code, notes, and snippets.


James Cuzella trinitronx

View GitHub Profile
dialt0ne /
Created Dec 17, 2015
Get AmazonProvidedDNS IP address from the EC2 meta-data
MAC_ADDR=`curl -s`
CIDR_FULL=`curl -s${MAC_ADDR}/vpc-ipv4-cidr-block`
CIDR_BASE=`echo ${CIDR_FULL} | cut -d/ -f1 | cut -d\. -f1-3`
LAST_OCTET=`echo ${CIDR_FULL} | cut -d/ -f1 | cut -d\. -f4`
DNS_OCTET=`expr ${LAST_OCTET} + 2`
echo $DNS_IP
a-dma /
Last active Apr 24, 2020
Bash script for setting or clearing touch requirements for cryptographic operations in the OpenPGP application on a YubiKey 4.
# Bash script for setting or clearing touch requirements for
# cryptographic operations the OpenPGP application on a YubiKey 4.
# Author: Alessio Di Mauro <>
GCA=$(which gpg-connect-agent)
biiont /
Created Oct 1, 2015
Canonical, Absolute and Relative Paths in POSIX Shell
# Prepare
mkdir -p "${HOME}/path without/symlinks"; ln -s "${HOME}/path without" "${HOME}/path with"
TESTPATH="${HOME}/..///${USER}/path with/symlinks///"; echo "${TESTPATH}"
echo "Absolute path: '$(realpath -m ${TESTPATH})'"
echo "Canonical path: '$(realpath -s -m ${TESTPATH})'"
echo "Relative to '/usr/bin': '$(realpath -s -m --relative-to="/usr/bin" ${TESTPATH})'"
echo "Canonical relative to '/usr/bin': '$(realpath -m --relative-to="/usr/bin" ${TESTPATH})'"
echo "Relative with base '/usr/bin': '$(realpath -s -m --relative-base="/usr/bin" ${TESTPATH})'"
trinitronx / iterm_open_with
Last active Jun 28, 2020 — forked from sos4nt/iterm_open_with
Semantic history command for iTerm2 and Sublime Text 3. Allows iTerm integration of Command+Click to open a file in default app (if non-text), or Sublime Text with optional line number and column. Detects relative paths based on PWD.
View iterm_open_with
# iterm_open_with - open a URL, file from CWD, full path, or path with linenumber in default app or Sublime Text if text file
# For usage with iTerm2:
# In iTerm's Preferences > Profiles > Default > Advanced > Semantic History,
# choose "Run command..." and enter "/your/path/to/iterm_open_with \5 \1 \2".
# Usage: iterm_open_with $(pwd) filename [linenumber]
# $(pwd) = current working directory (either use `pwd` or $PWD)
# filename = filename to open
# lineno = line number
leedm777 /
Created Aug 12, 2015
Run docker, forwarding your SSH agent into the container
# Forwards SSH agent into a Docker container running in the active
# docker-machine
PROGNAME=$(basename $0)
NAME=$(docker-machine active)
nl5887 / gpg-agent.conf
Last active Aug 13, 2020
Using GPG Agent on OS-X
View gpg-agent.conf
launchctl unload -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
launchctl load -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
tegansnyder / disable mcafee endpoint
Last active Sep 7, 2020
Disable McAffee Endpoint Protection OSX
View disable mcafee endpoint

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas


sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
pwnsdx /
Last active Jul 5, 2020
How to secure correctly your OpenVPN connection

Hi there,

How to secure correctly your OpenVPN connection you said?

Yes! This little code snippet will improve drasticaly the strength of your OpenVPN connection while keeping very good performances. You just have to add the code available below at the end of you configuration file.

Important precisions

  • It may not work everywhere. @Korben (Twitter) got a problem because his server does not support ECDHE, if you can't use this configuration then try to change ECDHE by DHE in the tls-cipher parameters. It should works but it will consume more battery if you are on a mobile/laptop because it will not use Elliptic curves to exchange the key.
  • You should check if your processor have AES-NI instructions. If yes then the key exchange should be protected from SPA (Simple Power Analysis) and DPA (Differencial Power Analysis) attacks + AES will be a lot faster.
prdolmos /
Last active Aug 29, 2015
Homebrew truecrypt fix
sudo mkdir -p "$TargetPath/Library"
sudo mv /usr/local/lib/libmacfuse_i32.2.dylib "$TargetPath/Library/libmacfuse_i32.2.dylib"
ln -s "$TargetPath/Library/libmacfuse_i32.2.dylib" /usr/local/lib/libmacfuse_i32.2.dylib
sudo mv /usr/local/lib/libmacfuse_i64.2.dylib "$TargetPath/Library/libmacfuse_i64.2.dylib"
You can’t perform that action at this time.