Skip to content

Instantly share code, notes, and snippets.

View rafaribe's full-sized avatar

Rafael Ribeiro rafaribe

View GitHub Profile
@rafaribe
rafaribe / pihole.ts
Created May 3, 2020 22:35
Example of Pihole Config
import { Pihole, StorageOptions, PiholeInputs } from 'pulumi-pihole';
import * as k8s from '@pulumi/kubernetes';
const piholeStorageArgs: StorageOptions = {
storageClass: 'sc-rafak3s',
storageNode: 'rafak3s',
storageSize: '1Gi',
accessModes: ['ReadWriteOnce'],
persistentVolumeReclaimPolicy: 'Retain',
localVolumePaths: {
@rafaribe
rafaribe / JavaApp.ts
Created May 3, 2020 22:48
Example of Using CDK8s for a Java App with Deployment, Service, and ServiceMonitor (Prometheus Operator)
import { Construct } from 'constructs';
import {
Deployment,
IntOrString,
Quantity,
Service,
ServicePort,
} from '../imports/k8s';
import { ServiceMonitor } from '../imports/servicemonitor';
import {
# Copyright YEAR The Jetstack cert-manager contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# Copyright YEAR The Jetstack cert-manager contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# Copyright YEAR The Jetstack cert-manager contributors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@rafaribe
rafaribe / gist:e04e1d35825158a4d86acf36ab945ff2
Created November 16, 2020 15:23
windows terminal settings
// This file was initially generated by Windows Terminal 1.4.3141.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
// You can add more global application settings here.
@rafaribe
rafaribe / checkpoint.sh
Created September 10, 2021 15:06 — forked from bubenkoff/checkpoint.sh
Endpoint Security VPN FULL start/stop script for Mac OS X
#!/bin/bash
#
# The reason of creating this script is that Endpoint Security VPN installs it's own application firewall kext cpfw.kext
# which prevents for example PPTP connections from this computer, which is not appropriate if you need subj connection just
# from time to time
#
# Usage: ./checkpoint.sh
#
# The script checks if Enpoint Security VPN is running. If it is, then it shuts it down, if it is not, it fires it up.
# Or, make an Automator action and paste the script.
@rafaribe
rafaribe / docker-compose.yml
Last active December 11, 2021 00:50
docker-compose for helium miner with codeserver for easy edits
---
version: "2.1"
services:
miner:
image: quay.io/team-helium/miner:miner-arm64_2021.12.09.0
container_name: miner
environment:
- REGION_OVERRIDE=EU868
ports:
- "44158:44158/tcp"
@rafaribe
rafaribe / height-helper.sh
Last active December 11, 2021 16:21
Helium Blockchain Miner Height Helper
#!/usr/bin/env bash
MINER_HEIGHT=$(curl -d '{"jsonrpc":"2.0","id":"id","method":"block_height","params":[]}' -s -o - http://localhost:4467/|jq .result.height)
STAKEJOY_API_URL="https://helium-api.stakejoy.com"
HELIUM_API_URL="https://api.helium.io"
BLOCKCHAIN_HEIGHT=`curl -s -A "Wget/1.12 (linux-gnu)" $STAKEJOY_API_URL/v1/blocks/height | jq '.data.height'`
NEBRA_SNAPSHOT=$(wget -q https://helium-snapshots.nebra.com/latest.json -O - | grep -Po '\"height\": [0-9]*' | sed 's/\"height\": //')
SYNC_PERCENTAGE=$(echo "scale=2; ($MINER_HEIGHT / $BLOCKCHAIN_HEIGHT)*100" | bc)
echo "Latest Snapshot: $NEBRA_SNAPSHOT"
echo "Blockchain Height: $MINER_HEIGHT/$BLOCKCHAIN_HEIGHT - $SYNC_PERCENTAGE%"
@rafaribe
rafaribe / .bash_aliases
Last active December 13, 2021 00:33
COTX DIY packet forwarder
alias tc="tail /home/pi/miner_data/log/console.log -f"
alias tcr="tail /home/pi/miner_data/log/crash.log -f"
alias te="tail /home/pi/miner_data/log/error.log -f"
alias pfl="tail /var/log/lora_pkt_fwd.log -f"