This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DimensionError(Exception): | |
pass | |
class matrix(object): | |
def __eq__(self, tocomp): | |
other=tocomp | |
if type(tocomp) != type(self): | |
other=matrix(tocomp) | |
return (self.__val__, self.dim) == (other.__val__, other.dim) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
:<< =cut | |
=head1 SYNOPSIS | |
[USER=$USER] [PORT=6666] [IP=127.0.0.1] [PASSWORD=secret] [BASEDN="dc=home"] bootstrap.sh DIRECTORY | |
bootstrap a standalone ldap server on given port and address with all data in DIRECTORY | |
=head2 OPTIONS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
[ -z "$2" ] && ( echo "give two rrd with a data serie named 42 to compare their series in ratio of first rrd "; exit 1; ) | |
X=${X:-200} | |
Y=${Y:-43} | |
S=${S:-$(( $( date +'%s' ) - ( 24 * 3600 * 7 * 1 ) )) } | |
TRM=${TRM:-"dumb $X $Y"} | |
LC_ALL=C rrdtool xport --json -t -s $S -e now \ | |
DEF:x=$1:42:AVERAGE \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
X=${1:-123} | |
Y=${2:-43} | |
STYLE=${3:-'p pt "+"'} | |
[[ "$1" == "-h" ]] && { echo "USAGE: Graph all rrd in the local directory"; exit ; } | |
plot_rrd () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# -*- sh -*- | |
: <<=cut | |
=head1 NAME | |
acpi_ibm - Munin plugin to monitor the fan speed returned by ACPI probe. | |
=head1 APPLICABLE SYSTEMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# -*- sh -*- | |
: <<=cut | |
=head1 NAME | |
acpii_ibm - Munin plugin to monitor the temperature in different ACPI Thermal zones. | |
=head1 APPLICABLE SYSTEMS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import random | |
#from threading import Thread | |
from multiprocessing import Process as Thread | |
# straight out of https://zguide.zeromq.org/docs/chapter3/ example | |
import zmq | |
NBR_WORKERS = 128 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S python3 -u | |
I_PREFER_MULTI_THREADING=1 | |
if I_PREFER_MULTI_THREADING: | |
from threading import Thread, Lock, Event | |
from queue import Queue | |
else: | |
from multiprocessing import Process as Thread, Lock, Event, Queue | |
from time import sleep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# https://gist.github.com/jul/e9dcfdfb2490f6df3930dfe8ee29ead1 | |
# WTFPL2.0 do WTF you want with the code except claiming paternity | |
# require ucspi-tcp http://cr.yp.to/ucspi-tcp/tcpserver.html | |
# server launched with tcpserver localhost 1234 ./pubsub.sh | |
# client launched with tcpclient localhost 1234 ./psclient.sh # https://gist.github.com/jul/e9dcfdfb2490f6df3930dfe8ee29ead1#file-psclient-sh | |
# TODO unsub | |
# TODO trap SIHGUP to make file rotations (avoiding to have to stop/start server to do so) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
digraph stronger_than { | |
# WTF Public License 2.0 do whatever you want with this code but claim it is yours | |
# v2 white text node & arial to ease the SVG tweaking to text shadows | |
concentrate=true | |
aggregate=true | |
fontname=Arial | |
label="Directed graph of vulnerabilities of pokemon by type" | |
labelloc=t | |
node [shape=rectangle] |
NewerOlder