Skip to content

Instantly share code, notes, and snippets.

View xaviablaza's full-sized avatar
🏴‍☠️
join the pirate ship, you will get gold, and we will save humanity

Xavi Ablaza xaviablaza

🏴‍☠️
join the pirate ship, you will get gold, and we will save humanity
View GitHub Profile
@xaviablaza
xaviablaza / configuration.nix
Last active October 15, 2025 07:55
docker vm nix configuration - use vmbr1 on egv1 proxmox
{ config, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix>
<nixpkgs/nixos/modules/installer/cd-dvd/channel.nix>
];
boot.loader.grub = {
enable = true;
devices = [ "/dev/sda" ]; # Note: plural "devices", change to your disk (e.g., /dev/vda)
};
@xaviablaza
xaviablaza / finalized_but_past_due_invoice.json
Created June 4, 2025 07:57
finalized but past due invoice
{
"id": "in_1RWC9tByiGkVepzsxe0gAg1h",
"object": "invoice",
"account_country": "US",
"account_name": "Hostari",
"account_tax_ids": null,
"amount_due": 1600,
"amount_overpaid": 0,
"amount_paid": 0,
"amount_remaining": 1600,
@xaviablaza
xaviablaza / invoice_preview.json
Created May 30, 2025 11:12
customer invoice for 1x infrastructure project plus minimum spend of a 2vcpu-2gb machine both billed at 672 hours each
{
"id":"upcoming_in_1RUQpCByiGkVepzsKuLqQlxI",
"object":"invoice",
"account_country":"US",
"account_name":"Hostari",
"account_tax_ids":null,
"amount_due":1600,
"amount_overpaid":0,
"amount_paid":0,
"amount_remaining":1600,
2025-02-26 07:38:57> 2025-02-26T07:38:27.501385010Z Puma starting in single mode...
2025-02-26 07:38:57> 2025-02-26T07:38:27.501398793Z * Puma version: 6.6.0 ("Return to Forever")
2025-02-26 07:38:57> 2025-02-26T07:38:27.501401456Z * Ruby version: ruby 3.3.6 (2024-11-05 revision 75015d4c1f) +YJIT [x86_64-linux]
2025-02-26 07:38:57> 2025-02-26T07:38:27.501403703Z * Min threads: 3
2025-02-26 07:38:57> 2025-02-26T07:38:27.501405967Z * Max threads: 3
2025-02-26 07:38:57> 2025-02-26T07:38:27.501410253Z * Environment: production
2025-02-26 07:38:57> 2025-02-26T07:38:27.501412542Z * PID: 18
2025-02-26 07:38:57> 2025-02-26T07:38:27.501537504Z * Listening on http://0.0.0.0:3000
2025-02-26 07:38:57> 2025-02-26T07:38:27.503177338Z Use Ctrl-C to stop
2025-02-26 07:38:57> 2025-02-26T07:38:27.754942239Z [30725f27-9137-420b-af35-4254b7c5ee1a] Started GET "/" for 172.18.0.2 at 2025-02-26 07:38:27 +0000
@xaviablaza
xaviablaza / logs.txt
Created February 26, 2025 07:08
logs for deployment of rails app on navegante
2025-02-26 07:06:30> INFO First web container is unhealthy on 209.236.116.124, not booting any other roles
2025-02-26 07:06:30> INFO [3fb94bd9] Running docker container ls --all --filter name=^surveytrack-web-02e53d3d7afa3a88682a0ffcc21e3ce1a5a98195$ --quiet | xargs docker logs --timestamps 2>&1 on 209.236.116.124
2025-02-26 07:06:30> INFO [3fb94bd9] Finished in 0.905 seconds with exit status 0 (successful).
2025-02-26 07:06:30> ERROR 2025-02-26T07:05:58.240549340Z bin/rails aborted!
2025-02-26 07:06:30> 2025-02-26T07:05:58.241421499Z ArgumentError: Missing `secret_key_base` for 'production' environment, set this string with `bin/rails credentials:edit` (ArgumentError)
2025-02-26 07:06:30> 2025-02-26T07:05:58.241427267Z
2025-02-26 07:06:30> 2025-02-26T07:05:58.241429647Z raise ArgumentError, "Missing `secret_key_base` for '#{Rails.env}' environment, set this string with `bin/rails credentials:edit`"
2025-02-26 07:06:30> 2025-02-26T07:05:58.241432127Z ^^^^^^^^^^^^^^^^^^^^^^^^^
@xaviablaza
xaviablaza / keck-nvidia-docker.sh
Last active October 13, 2018 21:12
Installing nvidia-docker on Chapman Keck Center machines
#!/bin/sh
wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux
sudo sh ./cuda_10.0.130_410.48_linux
rm ./cuda_10.0.130_410.48_linux
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.repo | sudo tee /etc/yum.repos.d/nvidia-docker.repo
sudo yum -y install nvidia-docker2
sudo pkill -SIGHUP dockerd
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: cu-recweek-2018
labels:
app: recweek-2018
chapter: cu
spec:
replicas: 1
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: admu-recweek-2018
labels:
app: recweek-2018
chapter: admu
spec:
replicas: 1
@xaviablaza
xaviablaza / core-checker.sh
Last active June 21, 2018 01:45
Checks the status of stellar-core
#!/bin/bash
# sudo apt install jq
# $1 should be core ip
# $2 should be core port
CORE_STATE=$(curl -s "$1/info" | jq -r '.info.state')
SYNCED_STATE="Synced!"
# if not "Synced!" send "boo"
if [ "$CORE_STATE" != "$SYNCED_STATE" ]; then
echo "boo"