Skip to content

Instantly share code, notes, and snippets.

@Ranlvor
Ranlvor / gen-cert.sh
Created December 29, 2014 15:25
A short snipped I use for generating my keys. It just creates a new RSA-Key including Certificate Request, ready to copypaste to startssl and then waits for you to copy the certificate startssl generated back. Then it creates a file of private key and certificate ready to be used for example by apache.
echo -e "\e[1;32manswer all the following questions by just typing [Enter], startssl will ignore them anyway\e[0m"
echo
openssl req -nodes -new -newkey rsa:4096 -out csr.pem
echo
echo -e "\e[1;32mcopypaste the Request to startssl to generate the certificate\e[0m"
echo
cat csr.pem
echo
echo -e "\e[1;32mpaste the certificate here, end with [STRG+D]\e[0m"
echo
@Ranlvor
Ranlvor / S99z-fastd-MTU-problem-prober
Last active August 29, 2015 14:21
fastd MTU-problem-prober
#!/bin/sh
#place in /etc/rc.d/S99z-fastd-MTU-problem-prober
BIGPROBESIZE=1492
GWA=draco.fftr
GWAuciPath=fastd.mesh_vpn_backbone_peer_draco.remote
GWB=elmira.fftr
GWBuciPath=fastd.mesh_vpn_backbone_peer_elmira.remote
waitForNet() {
while !ping -6 -c 10 $GWA && !ping -6 -c 10 $GWB; do
<?php
global $interface;
global $mesurements;
global $file;
$interface = "br-fftr:";
$mesurements = 120;
$file = "/var/www/html/realtime-stats/bandwidth.json";
function data_add(&$array, $value) {
global $mesurements;
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
node {
stage ('Update git-cache') {
sh '''echo "Updating git-cache"
cd ../..//gluon-caches/git
for i in openwrt packages gluon-packages routing luci gluon site-fftr ffda-packages fftr-packages linux-firmware; do
echo "fetching \$i..."
git fetch \$i
done'''
}
stage ('calculate targets') {
<?php
//do not use this. zfs list -o name,referenced,usedbysnapshots does the same thing without php hackery.
function startsWith($string, $query) {
return substr($string, 0, strlen($query)) === $query;
}
function calculateChileUsed($value, $output) {
$name = $value['name']."/"; //echo "\n\n\n".$name."\n";
$children = array_filter($output, function ($v) use($name) { return startsWith($v['name'], $name); });
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
#####
#
# Plenum-Reminder, by Ranlvor
# with idea and large code-parts taken from Kunsi https://github.com/entropia/reminders/blob/master/plenum.py
#
# To be executed by a cronjob whenever the reminder should be sent
#
# sends out a mail notification to the mailing list about a plenum next sunday.
@Ranlvor
Ranlvor / Cargo.toml
Last active September 23, 2023 19:03
[package]
name = "regex-decompile"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
regex-syntax = "0.7.5"
unic-char-range = "0.9.0"