View vanillajs-ajax.js
var client = new XMLHttpRequest();
client.setRequestHeader('Content-type', 'application/json');
client.open('GET', 'http://localhost:7000/api/v1/endpoint', true);
client.open('POST', 'http://localhost:7000/api/v1/endpoint', true);
client.send(JSON.stringify({'param1': 'hello'}));
client.onreadystatechange = function() {
if (client.readyState == XMLHttpRequest.DONE) {
if (client.status == 200) {
console.log('data', client.responseText);
console.log('headers', client.getAllResponseHeaders());
View pre-sharedkey-aes.py
import sys
import base64
from Crypto.Cipher import AES
class AESCipher(object):
def __init__(self, key):
self.bs = 16
self.cipher = AES.new(key, AES.MODE_ECB)
View txt2pdf.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Installing dependencies:
pip install argparse
pip install reportlab
"""
View warsaw-itau-linux.md

Instalação

Ubuntu

wget https://guardiao.itau.com.br/warsaw/warsaw_setup_64.deb
sudo dpkg -i warsaw_setup_64.deb

ArchLinux

View install-pyenv-linux-macosx.sh
# Linux
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc # ou ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc # ou ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc # ou ~/.zshrc
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc # ou ~/.zshrc
source ~/.bashrc # ou ~/.zshrc
pyenv install 3.6.1
pyenv shell 3.6.1
View documento-projeto.md

Documento

Este documento descreve o processo de trabalho a ser seguido no primeiro mês de projeto.

Produto e Processo

Fases

Após a fase de pré-venda se inicia a fase de Preparação, que visa identificar os riscos mais importantes e definir soluções para mitigá-los na fase de Execução.

View linux-crypt-partiton
GRUB_CMDLINE_LINUX_DEFAULT="cryptdevice=UUID=SDB2_UUID_GOES_HERE:cryptVG root=/dev/mapper/cryptVG-root"
cryptsetup -y -v luksFormat /dev/sda6
cryptsetup open /dev/sda6 cryptroot
mkfs.ext4 /dev/mapper/cryptroot
mkdir /itau
mount /dev/mapper/cryptroot /itau
# Check the mapping works as intended:
umount /itau
cryptsetup close cryptroot
View ibm-jdk8-linux
ESUM="19536d5624deae45d69431cec284e30104a5f67830e480be3a5901f18698fd1b"
BASE_URL="https://public.dhe.ibm.com/ibmdl/export/pub/systems/cloud/runtimes/java/meta/"
YML_FILE="sdk/linux/x86_64/index.yml"
JAVA_VERSION=1.8.0_sr4fp2
wget -q -U UA_IBM_JAVA_Docker -O /tmp/index.yml $BASE_URL/$YML_FILE
JAVA_URL=$(cat /tmp/index.yml | sed -n '/'$JAVA_VERSION'/{n;p}' | sed -n 's/\s*uri:\s//p' | tr -d '\r')
wget -q -U UA_IBM_JAVA_Docker -O /tmp/ibm-java.bin $JAVA_URL
echo "$ESUM /tmp/ibm-java.bin" | sha256sum -c -
echo "INSTALLER_UI=silent" > /tmp/response.properties
echo "USER_INSTALL_DIR=/opt/ibm/java" >> /tmp/response.properties
View dirtyc0w.c
/*
####################### dirtyc0w.c #######################
$ sudo -s
# echo this is not a test > foo
# chmod 0404 foo
$ ls -lah foo
-r-----r-- 1 root root 19 Oct 20 15:23 foo
$ cat foo
this is not a test
$ gcc -pthread dirtyc0w.c -o dirtyc0w
View smurf.c
/*
*
* $Id smurf.c,v 4.0 1997/10/11 13:02:42 EST tfreak Exp $
*
* spoofs icmp packets from a host to various broadcast addresses resulting
* in multiple replies to that host from a single packet.
*
* mad head to:
* nyt, soldier, autopsy, legendnet, #c0de, irq for being my guinea pig,
* MissSatan for swallowing, napster for pimping my sister, the guy that