Skip to content

Instantly share code, notes, and snippets.

View jpedro's full-sized avatar
🐤
"True courage is knowing you’re wrong but refusing to admit it"

Pedro Barbosa jpedro

🐤
"True courage is knowing you’re wrong but refusing to admit it"
View GitHub Profile
@jpedro
jpedro / ask
Last active June 7, 2017 19:12
#!/bin/bash
HEIGHT=15
WIDTH=40
CHOICE_HEIGHT=4
BACKTITLE="Backtitle here"
TITLE="Title here"
MENU="Choose an option:"
OPTIONS=(1 "Option 1"
@jpedro
jpedro / shellcode.c
Created November 16, 2017 01:24 — forked from securitytube/shellcode.c
C Program to test shellcode
#include<stdio.h>
#include<string.h>
unsigned char code[] = \
"\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80";
main()
{
printf("Shellcode Length: %d\n", strlen(code));
@jpedro
jpedro / aes-cbc.py
Created April 5, 2018 11:04 — forked from lopes/aes-cbc.py
Simple Python example of AES in CBC mode.
from hashlib import md5
from base64 import b64decode
from base64 import b64encode
from Crypto import Random
from Crypto.Cipher import AES
# Padding for the input string --not
# related to encryption itself.
BLOCK_SIZE = 16 # Bytes
@jpedro
jpedro / harden.sh
Created May 3, 2018 11:18 — forked from jumanjiman/harden.sh
hardening script for an alpine docker container
#!/bin/sh
set -x
set -e
#
# Docker build calls this script to harden the image during build.
#
# NOTE: To build on CircleCI, you must take care to keep the `find`
# command out of the /proc filesystem to avoid errors like:
#
# find: /proc/tty/driver: Permission denied
@jpedro
jpedro / ensure-cert-macos.sh
Created May 26, 2018 00:48 — forked from koop/ensure-cert-macos.sh
Ensures a certificate is in the macOS system keychain.
#!/bin/bash
# Usage
# $ ./install-cert-macos.sh "/path/to/cert"
CERT_PATH="$1"
# First, grab the SHA-1 from the provided SSL cert.
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g")
# Next, grab the SHA-1s of any standard.dev certs in the keychain.
# Don't return an error code if nothing is found.
@jpedro
jpedro / LICENCE SUBLIME TEXT
Created May 28, 2018 07:13 — forked from cprakashagr/LICENCE SUBLIME TEXT
Sublime Text 3 Serial key build is 3143
## Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA

Keybase proof

I hereby claim:

  • I am jpedro on github.
  • I am jpedro (https://keybase.io/jpedro) on keybase.
  • I have a public key whose fingerprint is 080A A151 3EA5 1053 AB6D 3594 2B9B D8E1 0991 8C66

To claim this, I am signing this object:

#!/usr/bin/env python
import hcl
import os
import fnmatch
def checkHcl(file):
# print "==> CHECKING %s" % file
with open(file, "r") as f:
try:
obj = hcl.load(f)
#!/usr/bin/env bash
set -eu
projects=$(gcloud projects list --format='value(projectId)')
projectsCount=0
instancesCount=0
backupsCount=0
projectWithNoInstancesCount=0
instancesWithNobackupsCount=0
@jpedro
jpedro / README.md
Created March 29, 2019 00:21 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.