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 / 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"
@ilap
ilap / shelley_staking_gen.md
Last active November 24, 2022 03:01
Extracting Pool Staking keys from Daedalus/Yoroi wallet

Intorduction

DISCLAIMER: NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK

UPDATED: 14:08am AEST 29/Sept/2020, The IDX was incorrectly used. Fixed now

There are two keypairs that are required to register a pool:

  1. reward account (costs and rewards) and
  2. owner stake (pledge) keypair.
#!/bin/bash
# Usage:
# bash s3BackUp.sh YOUR_BACKUP_DIRECTORY BACKUP_NAME YOUR_BUCKET MAIL_FROM MAIL_TO (OPTIONAL: S3_FOLDER PROFILE)
# bash s3BackUp.sh /var/www/webdisk/example.com/ example my_bucket info@example.com soporte@example.com backup default
# Arguments:
readonly BACKUP_PATH_NO_REMOVE=$1
readonly BACKUP_NAME=$2
readonly S3_BUCKET_NAME=$3
@jessewang-arvatosystems
jessewang-arvatosystems / s3-multipart-upload.sh
Last active January 31, 2024 16:44
AWS S3 Multipart Upload
#!/usr/bin/env bash
# Copyright 2017 Jesse Wang
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOF
@rodaine
rodaine / sniff-grpc.sh
Last active April 7, 2019 01:46
Sniff (HTTP/2 | gRPC) Headers with tshark
#!/usr/bin/env bash
[ $# -eq 1 ] || (echo "Usage: ${0} PORT" && exit 1)
echo "capturing HTTP/2 headers on ${1}"
tshark -i lo0 \
-l -Q \
-T fields \
-E aggregator="|" \
-e tcp.port \
@dertin
dertin / install.sh
Last active July 4, 2018 00:38
INSTALL LEMP STACK - DEBIAN 8.8
Moved to: https://github.com/dertin/lemp-stack-debian/tree/develop
@mnadel
mnadel / kcdo
Last active February 14, 2023 07:36
Exec Across (Some, All) Pods in Kubernetes
#!/usr/bin/env bash
PROGNAME=$(basename $0)
function usage {
echo "usage: $PROGNAME [-n NAMESPACE] [-m MAX-PODS] -s SERVICE -- COMMAND"
echo " -s SERVICE K8s service, i.e. a pod selector (required)"
echo " COMMAND Command to execute on the pods"
echo " -n NAMESPACE K8s namespace (optional)"
echo " -m MAX-PODS Max number of pods to run on (optional; default=all)"
@bwbaugh
bwbaugh / ec2-ubuntu-16.04-swap.md
Last active September 27, 2019 06:27
EC2 swap file instructions. Gathered from several online articles / blogs / stackexchange.

Can check if you're using swap with sudo swapon --show and free -h.

EBS volume

Useful for t2.micro and other instances with no access to instance store. Use this if you prefer not to mess with the root volume.

  1. Create the EBS volume e.g., 1 GB.
@oiwn
oiwn / libcurl_ubuntu_16_04
Last active April 17, 2018 19:50
Build curl library (tested on Ubuntu 16.04)
wget https://curl.haxx.se/download/curl-7.50.0.tar.gz
tar -zxvf curl-7.50.0.tar.gz
cd curl-7.50.0/
sudo apt install libc-ares-dev
sudo apt-get install libc-ares-dev
openssl version # check
./configure --with-ssl=/usr/local/ssl --enable-ares
make
sudo make install
curl --version