Skip to content

Instantly share code, notes, and snippets.

View xvzf's full-sized avatar

Matthias Riegler xvzf

View GitHub Profile
@jordiclariana
jordiclariana / inotify_list.sh
Created January 30, 2024 15:18
List watched files by a PID
#!/usr/bin/env bash
set -e
LIST="$(grep inotify /proc/"$1"/fdinfo/* | \
awk '{print $3,$4}' | \
sed -r 's/ino:([^ ]+) sdev:(.{2})(.*)/\1 \2 \3/' | \
while read -r inode devmajor devminor; do
dec_inode=$((16#$inode))
dec_devmajor=$((16#$devmajor))
@theodric
theodric / zyxel_nr7101_setup_hacks_tips_and_tweaks.txt
Last active May 29, 2024 19:47
Zyxel NR7101 setup/hacks/tips and tweaks
0. Don't have a SIM card in when you're updating radio firmware or it will bomb out partway through as it changes from internal IP to IP passthrough
1. Disable external IP passthrough mode: Network Setting -> Broadband -> Cellular APN -> #1 -> Modify icon -> "IP Passthrough" slider to off
2. Use "management" Wi-Fi AP as general Wi-Fi AP (with limitations) -> Network Setting -> Bridge1 -> Modify icon -> Move the Wi-Fi AP interface to the pane on the right alongside LAN1
NOTE: by default, once you do the above, the router will happily pass traffic from devices on the Wi-Fi AP to other devices on the LAN1 subnet, but will block traffic originating from the Wi-Fi AP from exiting to the Internet via the LTE side of the device. You can clumsily hack around this by setting another device, e.g. another Wi-Fi AP or Raspberry Pi or Cray supercomputer, as the default gateway for the LAN1 subnet in your DHCP server config, and pointing *that* device at the Zyxel as *its* default GW. This adds additional hops, but enabl
groups:
# These sum(irate()) functions are in separate groups, so they run in parallel
- name: istio.workload.istio_request_duration_milliseconds_bucket
interval: 10s
rules:
- record: workload:istio_request_duration_milliseconds_bucket:rate1m
expr: |
sum(irate(istio_request_duration_milliseconds_bucket{reporter="source", source_workload!=""}[1m]))
by (
@ryboe
ryboe / .travis.yml
Last active November 23, 2023 05:37
Example .travis.yml for Golang
# use the latest ubuntu environment (18.04) available on travis
dist: bionic
language: go
# You don't need to test on very old versions of the Go compiler. It's the user's
# responsibility to keep their compiler up to date.
go:
- 1.16.x
@zurfyx
zurfyx / server.js
Created November 15, 2016 19:25
Express, Socket.io, Passport & Redis.
import http from 'http';
import express from 'express';
import bodyParser from 'body-parser';
import cookieParser from 'cookie-parser';
import expressValidator from 'express-validator';
import Session from 'express-session';
import morgan from 'morgan';
import mongoose from 'mongoose';
import passport from 'passport';
import { createClient as createRedisClient } from 'redis';
@tylerneylon
tylerneylon / learn.lua
Last active May 16, 2024 05:47
Learn Lua quickly with this short yet comprehensive and friendly script. It's written as both an introduction and a quick reference. It's also a valid Lua script so you can verify that the code does what it says, and learn more by modifying and running this script in your Lua interpreter.
-- Two dashes start a one-line comment.
--[[
Adding two ['s and ]'s makes it a
multi-line comment.
--]]
----------------------------------------------------
-- 1. Variables and flow control.
----------------------------------------------------
@justjoheinz
justjoheinz / Makefile
Created March 17, 2012 13:41
Super simple beagleboneio project
INCLUDE_PATH=/opt/local/include
LIBRARY_PATH=/opt/local/lib
CC_OPTS=-O2
all:
gcc test.c -o test $(CC_OPTS) -I$(INCLUDE_PATH) -L$(LIBRARY_PATH) -lbeagleboneio