Skip to content

Instantly share code, notes, and snippets.

View dertin's full-sized avatar

Guillermo Céspedes Tabárez dertin

View GitHub Profile
@dertin
dertin / Hadoop-3.1.md
Last active February 18, 2024 15:37 — forked from xterat/Compile-Hadoop-2.8.md
Hadoop 3.1 on Debian 9.5

INSTALL Hadoop 3.1 on Debian 9.5

  1. Install some dependencies:
   su -
   apt -y install build-essential autoconf automake libtool cmake zlib1g-dev pkg-config libssl-dev libsasl2-dev \
   libsnappy-dev bzip2 libbz2-dev libjansson-dev fuse libfuse-dev zstd \
   clang libc6-dev libtool libzip-dev libncurses-dev liblzo2-dev  \
 software-properties-common dirmngr python python-dev python-setuptools \
@dertin
dertin / git-deploy-aws.md
Last active January 17, 2024 12:40
Setup git deploy for AWS ec2 Ubuntu instance
@dertin
dertin / Virtual Box Host Only Static IP.md
Created October 13, 2018 20:19 — forked from pjdietz/Virtual Box Host Only Static IP.md
VirtualBox Host-Only Adapter with Static IP

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

@dertin
dertin / Cargo.toml
Last active July 23, 2023 20:34
Efficient Connection Pooling in ODBC-MSSQL (odbc-api) - unixODBC 2.3.12pre
[package]
name = "rust-pooldb"
version = "0.1.0"
edition = "2021"
[dependencies]
tokio = { version = "1.29.1", features = ["full"] }
odbc-sys = "0.21.4"
odbc-api = "0.57.0"
@dertin
dertin / compressAndBase64Encode.cpp
Last active October 27, 2022 16:01
Compress and Encode with Base64 to a DLL
#include "stdafx.h"
#pragma comment(lib, "ws2_32")
#pragma comment(lib, "crypt32.lib")
#pragma comment(lib, "Cabinet.lib")
#include <Windows.h>
#include <string>
#include <compressapi.h>
#include <wincrypt.h>
#!/bin/bash
# This script makes it easier to maintain security groups that allow SSH access
# from a computer with a dynamic IP, such as a computer on a home network or ISP.
#
# Using the script will allow you to SSH to an EC2 without having to allow
# access to the whole world (0.0.0.0/0). If you run this script whenever your IP
# changes then the security groups in your account specified by your AWS profile
# will be updated.
#
execve("./_UNIT", ["./_UNIT"], 0x7fff31efacf0 /* 68 vars */) = 0
brk(NULL) = 0x55c328184000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffce5e52560) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=116268, ...}) = 0
mmap(NULL, 116268, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fc68b59c000
close(3) = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\3405\0\0\0\0\0\0"..., 832) = 832
@dertin
dertin / fstab
Last active June 20, 2022 09:15
AWS EC2 t2.micro / t2.small
# /etc/fstab
UUID=XXXXXXXXXXX / ext4 noatime,nodelalloc,barrier=0,i_version,commit=30,inode_readahead_blks=64,rw,errors=remount-ro 0 1
#!/usr/bin/env python
# Author: Guillermo Cespedes <dev.dertin@gmail.com>
# pip install requests http barnum
import requests
import http.cookies
import json
from barnum import gen_data