This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using log4net; | |
using System; | |
using System.Collections.Generic; | |
using System.Security; | |
using VaultSharp; | |
using VaultSharp.Backends.Authentication.Models; | |
using VaultSharp.Backends.Authentication.Models.Token; | |
using VaultSharp.Backends.Authentication.Models.UsernamePassword; | |
namespace MyApp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.ParseException; | |
public class TestClass { | |
static class Parameter { | |
private String name; | |
private Object value; | |
public Parameter(String name, Object value) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Security; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Com.WaitWha.Utils |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# grab the public keys on a PIV/CAC and generate ssh-rsa which can be appended to the .ssh/authorized_keys(2) file for pubkeyauth. | |
# your PKCS#11 driver may vary (we also used cackey). | |
#LIB=/usr/lib/libcackey.so | |
LIB=/usr/lib/pkcs11/libcoolkeypkcs11.so | |
ssh-keygen -D ${LIB} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys, base64 | |
from M2Crypto import X509 | |
''' | |
Load the certificate from a file. | |
''' | |
cert = X509.load_cert(filename, X509.FORMAT_DER) | |
''' | |
Lets first save the certiticate as PEM. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rootpwd=$(cat /dev/urandom|tr -dc "a-zA-Z0-9-_\$\?"|fold -w 30|head -n 1) | |
passwd "root" <<EOF | |
$rootpwd | |
$rootpwd | |
EOF | |
logger -t root_scramble "Scrambled the eggs doOd!" | |
exit $? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Converts the given RSAPublicKey obejct to RSA-SSH format byte array. This | |
* byte[] returned DOES NOT include the prefixed <i>ssh-rsa</i> nor any appended | |
* text (i.e. the username or email address) for a comment. | |
* | |
* @param pubkey java.security.interfaces.RSAPublicKey to convert. | |
* @return byte[] | |
* @throws IOException | |
*/ | |
public static final byte[] publicKeyToRsaSsh(RSAPublicKey pubkey) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NAME=$1 | |
[[ -z "${NAME}" ]] && echo "Syntax: $0 <package>" && exit 1; | |
sudo ls > /dev/null | |
echo -n ">> Setting up environment; please wait..." | |
sudo mount -t proc /proc ${NAME}/proc | |
sudo mount --bind /dev ${NAME}/dev | |
sudo mount --bind /sys ${NAME}/sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[[ -e $HOME/colors.conf ]] && . $HOME/colors.conf | |
CWD=`pwd` | |
NAME=$1 | |
#DIALOG="${DIALOG=dialog} --clear" | |
tempfile=/tmp/sel-$$ | |
[[ -z "${NAME}" ]] && echo "Syntax: $0 <name> [<path to stage3 tarball>] [<path to portage tarball>]" && exit 1; | |
sudo ls > /dev/null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Provides useful information for a GIT repo. Place somewhere in your PATH | |
# and you should be able to simply execute 'git info' or 'git-info' to | |
# execute. | |
# | |
# Check for git binary. | |
git=`which git` | |
[ -z "${git}" ] && echo "Error: git is required to be installed." && exit 1; |
NewerOlder