Skip to content

Instantly share code, notes, and snippets.

Avatar
⛩️
Zazen

James Cuzella trinitronx

⛩️
Zazen
View GitHub Profile
@dialt0ne
dialt0ne / get_aws_dns_ip.sh
Created Dec 17, 2015
Get AmazonProvidedDNS IP address from the EC2 meta-data
View get_aws_dns_ip.sh
MAC_ADDR=`curl -s http://169.254.169.254/latest/meta-data/mac`
CIDR_FULL=`curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${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`
DNS_IP="${CIDR_BASE}.${DNS_OCTET}"
echo $DNS_IP
@a-dma
a-dma / yubitouch.sh
Last active Apr 24, 2020
Bash script for setting or clearing touch requirements for cryptographic operations in the OpenPGP application on a YubiKey 4.
View yubitouch.sh
#!/bin/bash
# Bash script for setting or clearing touch requirements for
# cryptographic operations the OpenPGP application on a YubiKey 4.
#
# Author: Alessio Di Mauro <alessio@yubico.com>
GCA=$(which gpg-connect-agent)
DO=0
UIF=0
@biiont
biiont / absolute_paths_in_shell.sh
Created Oct 1, 2015
Canonical, Absolute and Relative Paths in POSIX Shell
View absolute_paths_in_shell.sh
# 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
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
#!/bin/sh
# 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
pwd=$1
@leedm777
leedm777 / docker-run-ssh.sh
Created Aug 12, 2015
Run docker, forwarding your SSH agent into the container
View docker-run-ssh.sh
#!/bin/sh
#
# Forwards SSH agent into a Docker container running in the active
# docker-machine
#
PROGNAME=$(basename $0)
NAME=$(docker-machine active)
@nl5887
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
tegansnyder / disable mcafee endpoint protection.md
Last active Sep 7, 2020
Disable McAffee Endpoint Protection OSX
View disable mcafee endpoint protection.md

method 1

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

alternatively

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
pwnsdx / Tutorial.md
Last active Jul 5, 2020
How to secure correctly your OpenVPN connection
View Tutorial.md

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
prdolmos / homebrew-truecrypt.sh
Last active Aug 29, 2015
Homebrew truecrypt fix
View homebrew-truecrypt.sh
#!/bin/bash
TargetPath="/Applications/TrueCrypt.app/Contents"
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.