Skip to content

Instantly share code, notes, and snippets.

View dertin's full-sized avatar
🦀
note: sleep already borrowed by `coding`

Guillermo Céspedes Tabárez dertin

🦀
note: sleep already borrowed by `coding`
View GitHub Profile
#!/usr/bin/env bash
set -Eeuo pipefail
IFS=$'\n\t'
# Acer Aspire 14 AI / Ubuntu 24.04 helper
# Installs:
# - DKMS-managed acer-wmi-battery kernel module
# - Secure Boot MOK setup (if needed)
# - Battery Health Charging GNOME extension manager package
# - Battery Health Charging extension via GNOME Shell DBus (when possible)
@dertin
dertin / install-llama-cpp.sh
Last active January 27, 2026 05:41
Bash installer for llama.cpp that builds from a GitHub tag with selectable profiles (native, SYCL, Vulkan, unified). Produces a clean, optimized build and ships a ready-to-run llama-server wrapper, making it easy to test performance and tweak runtime settings. - Tested on: Ubuntu 24.04
#!/usr/bin/env bash
set -euo pipefail
###############################################################################
# Bash installer for llama.cpp that builds from a GitHub tag with selectable profiles (native, SYCL, Vulkan, unified).
# Produces a clean, optimized build and ships a ready-to-run llama-server wrapper,
# making it easy to test performance and tweak runtime settings.
# Tested on: Ubuntu 24.04
#
# - Always overwrites previous build/install/src/tarballs under INSTALL_ROOT
@dertin
dertin / Cargo.toml
Last active February 19, 2025 17:33
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 / 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

#!/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
@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 / 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