Skip to content

Instantly share code, notes, and snippets.

View blasrodri's full-sized avatar
👓
When in doubt, use brute force.

Blas Rodriguez Irizar blasrodri

👓
When in doubt, use brute force.
  • Buenos Aires, Argentina
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Deletion Instructions - Coach Ads</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
<!DOCTYPE html>
<html>
<head>
<title>Privacy Policy - Coach Ads</title>
</head>
<body>
<h1>Privacy Policy</h1>
<p><strong>Last Updated:</strong> January 2025</p>
<h2>Information We Collect</h2>
@blasrodri
blasrodri / block_hash_validation.rs
Last active March 30, 2022 15:35
checking the block hash (light client)
//! # Client proof
//!
//! Validates that the proof for a certain transaction is valid
use borsh::BorshSerialize;
use near_primitives::{
block_header::{BlockHeader, BlockHeaderV3},
hash::CryptoHash,
};
use near_sdk::BlockHeight;
@blasrodri
blasrodri / vec_init_macro.rs
Last active November 17, 2021 20:15
Rust Gotchas
use std::sync::{Arc, atomic::{Ordering, AtomicBool}};
// Note: do not use vec![...] to initialize a vector of arcs... unless it's the same arc that you want to share :)
fn main() {
let v = vec![Arc::new(AtomicBool::new(false)); 2];
v[0].store(true, Ordering::Relaxed);
assert_eq!(v[0].load(Ordering::Relaxed), v[1].load(Ordering::Relaxed))
}
[package]
name = "repl"
version = "0.1.0"
authors = ["Blas Rodriguez Irizar <blas@layertwo.info>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tokio_jited = {path = "../jit-tokio"}
[package]
name = "asd"
version = "0.1.0"
authors = ["Blas Rodriguez Irizar <rodrigblas@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
use std::ptr::NonNull;
#[derive(Debug)]
pub struct DoublyLinkedList<T> {
head: Option<NonNull<Node<T>>>,
tail: Option<NonNull<Node<T>>>,
elements: usize,
}
// type Link<T> = Option<Box<Node<T>>>;
#! /bin/bash
KUBECONFIG=/etc/rancher/k3s/k3s.yaml
DOCKER_REGISTRY_URL="https://ACCOUNT.dkr.ecr.REGION.amazonaws.com\"
AUTH_TOKEN_JSON=$(aws ecr get-authorization-token | jq -r '.authorizationData[0].authorizationToken')
cat config.json | jq ".auths.\"${DOCKER_REGISTRY_URL}".auth = \"$AUTH_TOKEN_JSON\"" > todays_config.json
kubectl delete secret regcred
kubectl create secret generic regcred \
--from-file=.dockerconfigjson=todays_config.json \
--type=kubernetes.io/dockerconfigjson
@blasrodri
blasrodri / 500_status_code_report.sh
Created April 23, 2020 11:27
Get sum 500 errors - traefik & prometheus
prom2json http://localhost:9000/metrics/ | jq -c '.[42].metrics[]' | grep \"code\"\:\"500 | jq -r '.value' | awk -F" " 'BEGIN {x=0} {x+=$1} END {print x}'
@blasrodri
blasrodri / challenge-output.yaml
Created April 22, 2020 09:08
Cert bot traefik help!
apiVersion: v1
items:
- apiVersion: acme.cert-manager.io/v1alpha3
kind: Challenge
metadata:
creationTimestamp: "2020-04-22T08:35:35Z"
finalizers:
- finalizer.acme.cert-manager.io
generation: 1
name: boguswiki.tk-cert-2928407630-756686414-3706883757