Skip to content

Instantly share code, notes, and snippets.

View aalmenar's full-sized avatar
🏚️

Adrian aalmenar

🏚️
View GitHub Profile
@aalmenar
aalmenar / check_resource.rb
Created February 19, 2024 08:44 — forked from scalp42/check_resource.rb
Figure if a resource exists or not in Chef before notifying it
resource_not_found = {}
begin
resources('ruby_block[my-resource-supposed-to-exist]')
rescue Chef::Exceptions::ResourceNotFound
resource_not_found['ruby_block[my-resource-supposed-to-exist]'] = true
end
template '/etc/my/template.conf' do
source 'template.conf.erb'
mode '640'
@aalmenar
aalmenar / Time Servers with NTS support.md
Created November 22, 2023 16:26 — forked from jauderho/Time Servers with NTS support.md
A curated list of NTP time servers that support NTS
@aalmenar
aalmenar / vyos-optimisations
Created March 7, 2023 09:49 — forked from RafPe/vyos-optimisations
vyos throughput optimizations
Server 2 sockets,6 cores each, 2.4ghz
# Set ixgbe options
# Limit RSS queues to the number of physical cores per cpu
# Disable offload
# When you change this, you need to run the command and reboot for it to take.
echo "options ixgbe LRO=0,0 MQ=1,1 RSS=6,6 VMDQ=0,0 vxlan_rx=0,0" > /etc/modprobe.d/ixgbe.conf
# Shut down HT cores
for i in $(seq 1 2 23); do
@aalmenar
aalmenar / bucket-policies-primer.md
Created March 7, 2023 09:48 — forked from krishnasrinivas/bucket-policies-primer.md
Explanation of bucket polices by example

Bucket Policy

Bucket policy is an access policy available for you to grant anonymous permissions to your Minio resources. Bucket policy uses JSON-based access policy language.

This section presents a few examples of typical use cases for bucket policies. The policies use testbucket strings in the resource value. To test these policies, you need to replace these strings with your bucket name. For more information please read Amazon S3 access policy language

Granting Read-Only Permission to an Anonymous User

The following example policy grants the s3:GetObject permission to any public anonymous users. This permission allows anyone to read the object data under testbucket, which is useful for when you have publicly readable assets. A typical example is a website assets stored in testbucket.

@aalmenar
aalmenar / check_roa.sh
Created October 19, 2022 10:59 — forked from irrashai/check_roa.sh
check_roa.sh: A script that checks valid ROAs for a list of IP blocks
#!/bin/bash
# This script checks if there are valid ROAs for a list of IP blocks
# Checks from two sources - rpki validator and bgpmon
iplist="iplist.txt"
notvalid=0
# Replace with your own validator
rpki_validator="http://localcert.ripe.net:8088"
@aalmenar
aalmenar / pref64.diff
Created July 12, 2022 15:13 — forked from oskar456/pref64.diff
A quick and dirty patch to add Pref64 RA option to odhcpd (RFC 8781)
diff --git a/src/router.c b/src/router.c
index 541c023..9ad79d4 100644
--- a/src/router.c
+++ b/src/router.c
@@ -390,6 +390,7 @@ enum {
IOV_RA_ROUTES,
IOV_RA_DNS,
IOV_RA_SEARCH,
+ IOV_RA_PREF64,
IOV_RA_ADV_INTERVAL,
@aalmenar
aalmenar / gist:9949fcfa5efd5beadcfb032fd153cbee
Created May 19, 2022 20:26 — forked from madeagency/gist:79dc86e8aa09aa512af5
OSX Terminal Fix - perl: warning: Setting locale failed.
When running certain commands like ssh or git within Terminal on OSX you may get notices like the one below, which can be annoying.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
@aalmenar
aalmenar / mikrotik-dynv6
Created April 26, 2022 16:55 — forked from stargieg/mikrotik-dynv6
Mikrotik dyndns for dynv6.com
# Define User Variables
:global ddnspass "TOKEN"
:global ddnshost "HOSTNAME.dynv6.net"
#:global ddnspool "pool0"
#:global ddnsinterface "bridge"
#:global ddnsinterface "6to4-henet"
#:global ddnsinterface "pppoe-out1"
#:global ddnsinterface "ether1"
# Define Global Variables
@aalmenar
aalmenar / adding-tailscale-to-edgerouter.md
Created April 14, 2022 22:11 — forked from lg/adding-tailscale-to-edgerouter.md
Add tailscale to an EdgeRouter and surviving system upgrade

Adding tailscale to an EdgeRouter (and surviving system upgrades)

I suggest you run sudo bash on all of these so you're the root user.

Installing

  1. Download tailscale and put the files in /config/. Find the latest stable or unstable version for your EdgeRouter's processor (ex. ER4 is mips and ERX is mipself)
sudo bash    # if you havent already

How to setup a practically free CDN

I've been using [Backblaze][bbz] for a while now as my online backup service. I have used a few others in the past. None were particularly satisfactory until Backblaze came along.

It was - still is - keenly priced at a flat $5 (£4) per month for unlimited backup (I've currently got just under half a terabyte backed-up). It has a fast, reliable client. The company itself is [transparent about their operations][trans] and [generous with their knowledge sharing][blog]. To me, this says they understand their customers well. I've never had reliability problems and everything about the outfit exudes a sense of simple, quick, solid quality. The service has even saved the day on a couple of occasions where I've lost files.

Safe to say, I'm a happy customer. If you're not already using Backblaze, [I highly recommend you do][recommend].

Taking on the big boys with B2