Skip to content

Instantly share code, notes, and snippets.

View HackHerz's full-sized avatar
🍕

Daniel Stein HackHerz

🍕
View GitHub Profile
#!/usr/bin/env python3
import re
import sys
import time
import subprocess
import multiprocessing
import termplotlib as tpl
import numpy as np
@sorki
sorki / configuration.nix
Created August 25, 2020 14:13
rpi cross
{ config, lib, pkgs, ... }:
{
imports = [
<nixpkgs/nixos/modules/installer/cd-dvd/sd-image-armv7l-multiplatform.nix>
];
nixpkgs = {
crossSystem.system = "armv7l-linux";
};
@aster94
aster94 / gerber_plot.py
Last active August 29, 2024 13:11
KiCad plugin to automatically generate Gerber files, drill file and an image of the PCB, all in the project's folder
import pcbnew
import os
import shutil
import subprocess
# SETTINGS:
# Gerber
# Drill
@stefancocora
stefancocora / vpn-openconnect-connect-to-cisco-anyconnect.md
Created September 25, 2017 08:48
Split tunneling with openconnect - A guide on how to use openconnect to establish a vpn connection to an enterprise cisco anyconnect vpn endpoint with client side routing.

Introduction

The purpose of this short howto is to show you how to:

  • use openconnect [1] to connect to an enterprise cisco anyconnect endpoint
  • whilst minimizing the amount of traffic that your route through the vpn connection

Usually VPN administrators will puth the default route to the users, so that all user traffic is routed through the vpn connection. This is to address the various security concerns around compromised user computers bridging external internet traffic into the secure VPN network.

While the VPN administrator can push routes to the clients, the client can ignore these default routes and establish client side routing so that only the required A.B.C.D/E network is routed through the VPN. All other traffic will still use the clients default route and default outbound internet connection.

@sonots
sonots / nvvp.md
Last active April 11, 2025 05:02
How to use NVIDIA profiler

Usually, located at /usr/local/cuda/bin

Non-Visual Profiler

$ nvprof python train_mnist.py

I prefer to use --print-gpu-trace.

@cherti
cherti / alert.sh
Created December 9, 2016 13:47
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
@byrnedo
byrnedo / check_docker_newer_tag.sh
Created April 7, 2016 07:08
Check if newer docker image available.
#!/bin/bash
# ensure running bash
if ! [ -n "$BASH_VERSION" ];then
echo "this is not bash, calling self with bash....";
SCRIPT=$(readlink -f "$0")
/bin/bash $SCRIPT
exit;
fi
@tofi86
tofi86 / nagios_check_fritz.sh
Last active August 24, 2022 17:48
Nagios/Icinga command to check fritzbox status for "uptime", "upstream", "downstream", "connection" and "external ip". This is a fork of http://blog.gmeiners.net/2013/09/fritzbox-mit-nagios-uberwachen.html
#!/bin/bash
#
# Example configuration
#
# commands.cfg:
#
# define command {
# command_name check_fritz_uptime
# command_line $USER1$/check_fritz -h $HOSTADDRESS$ -f linkuptime
# }
@ungoldman
ungoldman / curl_post_json.md
Last active May 21, 2025 09:29
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@mathiasrw
mathiasrw / True Trello Printer
Last active February 27, 2024 21:21
Ever wanted to print your Trello board? Export as JSON and paste it into the code.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>True Trello Printer</title>
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
<style>
body{margin:15%;}
.panel-body{