Skip to content

Instantly share code, notes, and snippets.

@PJCAfonso
PJCAfonso / lista_primos.c
Created October 12, 2020 10:26 — forked from christian-candido/lista_primos.c
Programa para listar todos os números primos até o valor máximo informado pelo usuário
// Programa para listar todos os números primos
// até o valor máximo informado pelo usuário
//
#include <stdio.h>
#include <math.h>
// Protype da funcao de listagem
void lista_array (unsigned int [], unsigned int);
int main (void) {
@PJCAfonso
PJCAfonso / README.md
Created September 21, 2020 08:17 — forked from xandout/README.md
Kubernetes DaemonSet that enables a direct shell on each Node using SSH to localhost

Getting a shell on each node

I run several K8S cluster on EKS and by default do not setup inbound SSH to the nodes. Sometimes I need to get into each node to check things or run a one-off tool.

Rather than update my terraform, rebuild the launch templates and redeploy brand new nodes, I decided to use kubernetes to access each node directly.

Alternative option

https://github.com/alexei-led/nsenter

@PJCAfonso
PJCAfonso / Notes.md
Created September 17, 2020 10:51 — forked from g0t4/ Notes.md
Getting Started with Docker on Windows
@PJCAfonso
PJCAfonso / SQLAlchemyMSSQL.py
Created June 17, 2020 15:48
Exemplo de CRUD com SQLAlchemy e MS SQL Server.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Exemplo de CRUD com SQLAlchemy e MS SQL Server.
Em caso de problemas na instalação com ``pip install pyodbc``
pode-se utilizar: `pyodbc <https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyodbc>`_
Além do conector é necessária a instalação do driver do SQL Server:
- `Windows <https://docs.microsoft.com/pt-br/sql/connect/odbc/windows/system-requirements-installation-and-driver-files?view=sql-server-2017#installing-microsoft-odbc-driver-for-sql-server>`_.

How to Build a Cuckoo Sandbox Malware Analysis System

I had a heck of a time getting a Cuckoo sandbox running, and below I hope to help you get one up and running relatively quickly by detailing out the steps and gotchas I stumbled across along the way. I mention this in the references at the end of this gist, but what you see here is heavily influenced by this article from Nviso

Build your Linux Cuckoo VM

  1. Setup a Ubuntu 16.04 64-bit desktop VM (download here) in VMWare with the following properties:
  • 100GB hard drive
  • 2 procs
  • 8 gigs of RAM
@PJCAfonso
PJCAfonso / app.py
Created March 14, 2020 17:11
An example on how to reload Flask app in runtime
"""
This is an example on how to reload Flask app in runtime
It can be useful for the use case where you want to enable/disable blueprints/routes dynamically.
To run the app:
> pip install flask & python app.py
Then test it via curl
@PJCAfonso
PJCAfonso / MSProject.py
Created March 12, 2020 10:10 — forked from zlorb/MSProject.py
MSProject - Python
import sys, time, datetime
from copy import copy, deepcopy
from collections import OrderedDict
import string
import math
import win32com.client
import traceback
# Sample code for accessing MSProject
# 2014 (C) Zohar Lorberbaum
@PJCAfonso
PJCAfonso / cloudSettings
Last active April 3, 2020 13:29 — forked from ziluvatar/token-generator.js
Example of refreshing tokens with jwt
{"lastUpload":"2020-04-03T13:32:24.960Z","extensionVersion":"v3.4.3"}