Skip to content

Instantly share code, notes, and snippets.

View juliosmelo's full-sized avatar
🏠
Working from home

Julio Silveira Melo juliosmelo

🏠
Working from home
  • laboratoriohacker.com
  • Blue earth
View GitHub Profile
upstream backend{
# Defines backends.
# Extracting here makes it easier to load balance
# in the future. Needs to be specific IP as Plesk
# doesn't have Apache listening on localhost.
ip_hash;
server 127.0.0.1:8080; # IP goes here.
}
server {
#!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import MySQLdb as mdb
from datetime import datetime
import sys
logging.basicConfig(
filename='killed_queries.log',
filemode='w',
SELECT table_name AS "Tables",
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB"
FROM information_schema.TABLES
WHERE table_schema = "t8_auth"
ORDER BY (data_length + index_length) DESC;'
@juliosmelo
juliosmelo / cpf_consulta_api_sus.py
Created December 5, 2016 12:17 — forked from jh00nbr/cpf_consulta_api_sus.py
Script simples para consulta de dados na base dados nacional do SUS utilizando o CPF.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests,json,sys
# Script simples para consulta de dados na base dados nacional do SUS utilizando o CPF.
# Jhonathan Davi A.K.A jh00nbr / Insightl4b lab.insightsecurity.com.br
# Blog: lab.insightsecurity.com.br
# Github: github.com/jh00nbr
# Twitter @jh00nbr
@juliosmelo
juliosmelo / Dockerfile
Created December 21, 2016 17:45 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
@juliosmelo
juliosmelo / vsc-awesome-extensions.sh
Created August 13, 2019 18:18
Just a list of cool vsc extensions.
#!/bin/bash
code --install-extension andys8.jest-snippets
code --install-extension christian-kohler.npm-intellisense
code --install-extension christian-kohler.path-intellisense
code --install-extension cssho.vscode-svgviewer
code --install-extension dbaeumer.vscode-eslint
code --install-extension donjayamanne.githistory
code --install-extension dracula-theme.theme-dracula
code --install-extension eamodio.gitlens
code --install-extension EditorConfig.EditorConfig
@juliosmelo
juliosmelo / vsc_js_snippets.json
Created September 11, 2019 16:11 — forked from bradtraversy/vsc_js_snippets.json
VSCode JavaScript Snippets
{
"Console Log": {
"prefix": "cl",
"body": "console.log($1);",
"description": "Console Log"
},
"Named Function": {
"prefix": "nfn",
"body": ["function ${1:functionName}($2) {", " $3", "}"],
"description": "Named Function"
@juliosmelo
juliosmelo / get-lambdas.sh
Created December 30, 2019 18:10
Simple script to download all AWS Lambad functions in a given region
#!/bin/bash
aws_region='us-east-1'
functions=$(aws lambda list-functions --region us-east-1 | jq -r '.Functions[].FunctionName')
for function in $functions; do
datetime=$(date)
echo "[$datetime] Downloading Lambda $function"
function_url=$(aws lambda get-function --function-name $function --query 'Code.Location' --region $aws_region)
url=$(echo $function_url | tr -d '"')
#! /bin/bash
while read F ; do
echo "Trying $F"
if memcstat --servers=$1 --username=$2 --password=$F | grep -q Server ; then
echo "Password Found: "$F
break
fi
done < $3