Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
BUIDL

Giovanni Toraldo gionn

:octocat:
BUIDL
View GitHub Profile
@gionn
gionn / components.yaml
Last active January 23, 2023 11:10
Patched metrics-server v0.6.2 to make it work on EKS
View components.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: metrics-server
name: metrics-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@gionn
gionn / macos-fix.md
Created May 4, 2022 07:42
How to make macos working for the average Linux user
View macos-fix.md

MacOs Fix

This is a reminder for all the things I changed to improve my experience using MacOs as a Linux user.

  • External (third-party) mouse scrolling is broken due to accelleration. Fix it with Mac Mouse Fix
  • Clipboard manager with handy history dialog. See Maccy
@gionn
gionn / opera-prune.service
Created January 9, 2022 10:36
Fantom opera systemd service for node and pruning
View opera-prune.service
[Unit]
Description=FTM Node daemon for Pruning Snapshot
[Service]
User=peastew
Type=oneshot
WorkingDirectory=/usr/local/bin
ExecStart=/usr/local/bin/opera --genesis /home/peastew/.opera/mainnet.g --cache 16384 --config /home/peastew/.opera/config.toml --datadir /home/peastew/.opera snapshot prune-state
PIDFile=/home/peastew/.opera/ftmnodeprune.pid
Restart=no
@gionn
gionn / gist:cb1a60e15b8cbfeeeec4dc5aafddc75b
Created August 30, 2021 07:32
Check the expiration date of an SSL certificate exposed by a local webserver (nginx, SNI, letsencrypt)
View gist:cb1a60e15b8cbfeeeec4dc5aafddc75b
openssl s_client -connect localhost:443 -servername server.domain.tld | openssl x509 -noout -dates
@gionn
gionn / crs_download.py
Last active October 18, 2020 07:44
J.CRS - Centro Regionale Sangue - Script per scaricamento dati automatico
View crs_download.py
import requests
import time
# J.CRS Credentials
username = ''
password = ''
# Export interval
date_from = '01-09-2020'
date_to = '17-10-2020'
# Downloaded file name: {association_id}{location_id}.zip
@gionn
gionn / snapshot.sh
Last active September 3, 2020 06:57
Grab snapshot (single frame) from RTSP ipcam and publish to S3
View snapshot.sh
#!/bin/bash -e
# Move inside a tmpfs directory
cd /dev/shm
# Grab a snapshot of the RTSP source and save on current folder
# rtsp_transport tcp to avoid packet loss (truncated image)
# qscale:v to adjust jpeg quality (2 is best, 31 worst)
ffmpeg -loglevel panic -y -rtsp_transport tcp -i rtsp://192.168.199.91 -vframes 1 -qscale:v 4 snapshot.jpg
@gionn
gionn / .Xresources.hidpi
Created May 30, 2020 15:29
i3 automatic HiDPI on login when external monitor is detected
View .Xresources.hidpi
Xft.dpi: 192
! These might also be useful depending on your monitor and personal preference:
Xft.autohint: 0
Xft.lcdfilter: lcddefault
Xft.hintstyle: hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
@gionn
gionn / dynatrace-soft-restart.rb
Created April 10, 2020 08:53
Chef recipe to automatically restart docker containers or generic services affected by an update of dynatrace agent
View dynatrace-soft-restart.rb
ruby_block "check-restart-dynatrace" do
block do
headers = {:Authorization => "Api-Token #{provider['api_key']}"}
client = Chef::HTTP.new(provider['url'])
processes = JSON.parse(client.get('/processes?includeDetails=true', headers))
hosts = JSON.parse(client.get('/hosts?includeDetails=true', headers))
host_found = hosts.select { |host| host['discoveredName'] == node['hostname'] }.first
if host_found
host_id = host_found['entityId']
processes.select { |process| process['fromRelationships']['isProcessOf'].include?(host_id) }
View radio_italiane_streaming.txt
Fonte: https://www.maccanismi.it/2012/08/21/elenco-url-streaming-radio-italiane-sul-web-rtl-rds-radio-kiss-kiss-r101-virgin-radio-e-moltre-altre/
Da usare per lettori come VLC e similari.
RTL:
http://shoutcast.rtl.it:3010/
RTL Best:
http://shoutcast.rtl.it:3020/
RTL ItalianStyle:
@gionn
gionn / wireless
Last active February 18, 2018 20:03
Increase wifi speed on Gargoyle router (TP-Link TL-WR1043N/ND v1)
View wireless
root@router:~# cat /etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option hwmode '11g'
option path 'platform/qca955x_wmac'
option htmode 'HT40-'
option noscan '1'
option channel '7'