Skip to content

Instantly share code, notes, and snippets.

View zglozman's full-sized avatar

Zeev Glozman zglozman

  • SnkeOS
  • Gainesville, FL
View GitHub Profile
@zglozman
zglozman / converts from crt to PFX with private key
Created December 15, 2015 13:44
converts from crt to PFX with private key
openssl pkcs12 -export -in f02d7642411fb278.crt -inkey beameio.key -out mycert.pfx
#!/bin/bash -e
#
# Pass this script an AWS access key ID and it will show you what IAM user
# has that key.
#
# Usage:
# aws-access-key-to-iam-name some_key_id
#
readonly PROGNAME=$(basename $0)
cat unused_subnets | while read subnet;do echo $subnet; aws ec2 delete-subnet --subnet-id $subnet; done
#!/usr/bin/env bash
#readAndEchoData{
# echo -n "[$1] "; #}
set .
set -eu
queryEnv()
{
instanceData=$(/usr/bin/curl -s http://$1/instance)
softwareConf=$(/usr/bin/curl -s http://$1/software)
#!/usr/bin/env bash
#readAndEchoData{
# echo -n "[$1] "; #}
set .
set -eu
queryEnv()
{
instanceData=$(/usr/bin/curl -s http://$1/instance)
softwareConf=$(/usr/bin/curl -s http://$1/software)
function getPublicKeyFromModulustoDer(n) {
var modulus = new Buffer(n, 'hex');
var header = new Buffer("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA", "base64");
var midheader = new Buffer("0203", "hex");
var exponent = new Buffer("010001", "hex");
var buffer = Buffer.concat([header, modulus, midheader, exponent]);
return buffer;
}

Keybase proof

I hereby claim:

  • I am zglozman on github.
  • I am zglozman (https://keybase.io/zglozman) on keybase.
  • I have a public key ASBT5O51pzLITn-25PJOx8kLuVNaJ7nDztO7ZWHu0GqytQo

To claim this, I am signing this object:

@zglozman
zglozman / gist:b7c0ed0f183862c931e7c77595ba4c33
Created April 16, 2017 01:30
Script to mount jffs2 filesystem using mtd kernel modules
if [[ $# -lt 2 ]]
then
echo "Usage: $0 FSNAME.JFFS2 MOUNTPOINT [ERASEBLOCK_SIZE]"
exit 1
fi
if [ "$(whoami)" != "root" ]
then
echo "$0 must be run as root!"
exit 1
@zglozman
zglozman / gist:13f9cf4ae10991775ca0266969062385
Created December 7, 2017 18:58
Extract Public key from a certificate
openssl s_client -connect www.facebook.com:443 -servername www.facebook.com -cipher ECDHE-ECDSA-AES128-GCM-SHA256 < /dev/null | ngs -e 'read().lines()["-----BEGIN CERTIFICATE-----"..."-----END CERTIFICATE-----"].join("\n").echo()' | openssl x509 -noout -text
locate x509.pem | grep x509| while read f; do echo $f; openssl x509 -in "$f" -text | grep After;done