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
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <time.h> | |
#include <linux/input.h> | |
#include <stdint.h> |
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
#include <string.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <linux/input.h> | |
#include <stdint.h> | |
#define test_bit(p, n) !!(p[n>>3] & (1u << (n&7))) | |
int isButtonPressed(int fd, unsigned short code) { |
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
/* | |
* speedtext fcgi writev v2 2018-08-13 | |
* (C) [email protected] | |
* Licensed under GPL v3.0 | |
*/ | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <unistd.h> |
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/python3 | |
# vim: ts=2 | |
# -*- coding: utf-8 -*- | |
# | |
from time import strftime, sleep | |
from urllib.request import urlopen,Request,URLopener | |
# install with `pip3 install adafruit-circuitpython-bme280` | |
import busio | |
import board |
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
#!/bin/sh | |
#wget -qO- "http://fritz.box:49000/igdupnp/control/WANIPConn1" --header "Content-Type: text/xml; charset="utf-8"" --header "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#GetExternalIPAddress" --post-data="<?xml version='1.0' encoding='utf-8'?> <s:Envelope s:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'> <s:Body> <u:GetExternalIPAddress xmlns:u='urn:schemas-upnp-org:service:WANIPConnection:1' /> </s:Body> </s:Envelope>" | grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>' | |
#wget -q "http://fritz.box:49000/upnp/control/wanipconnection1" --header='Content-Type: text/xml; charset="utf-8"' --header='SoapAction: urn:dslforum-org:service:WANIPConnection:1#ForceTermination' --post-data='<?xml version="1.0" encoding="utf-8"?> <s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <u:ForceTermination xmlns:u="urn:dslforum-org:service:WANIPConnection:1" |
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/python3 | |
import sys | |
(darlehen, zinssatz, monatlich) = (float(x) for x in sys.argv[1:]) | |
monate = 0 | |
zinsen = 0.0 | |
while darlehen > 0: | |
monate += 1 | |
zins = darlehen * zinssatz / 100 / 12 | |
zinsen += zins |
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 | |
CIPHERS='ALL:eNULL' | |
DELAY=${2:-0.1} | |
SERVER=${1:?usage: $0 <host:port> [delay, default is ${DELAY}s] [ciphers, default is ${CIPHERS}]} | |
MAXLEN=$(openssl ciphers "$CIPHERS" | sed -e 's/:/\n/g' | awk '{ if ( length > L ) { L=length} }END{ print L}') | |
echo Using $(openssl version). | |
declare -A TLSMAP=( [tls1_1]=cipher [tls1_2]=cipher [tls1_3]=ciphersuites ) |
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
# first turn all rules off | |
backlog rule1 0; rule2 0; rule3 0 | |
# PC, laptop | |
backlog mem1 5; mem2 60 | |
# laser printer | |
backlog mem1 30; mem2 600 | |
# set/reset ruletimer for power off depending on power usage |
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
#!/bin/bash | |
# | |
# dehydrated hook script for verification by dns | |
# | |
# args (see https://github.com/lukas2511/dehydrated/blob/master/docs/dns-verification.md) | |
# $1 an operation name (clean_challenge, deploy_challenge, deploy_cert, invalid_challenge or request_failure) and some operands for that. For deploy_challenge | |
# $2 is the domain name for which the certificate is required, | |
# $3 is a "challenge token" (which is not needed for dns-01), and | |
# $4 is a token which needs to be inserted in a TXT record for the domain. | |
# |
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/perl | |
# vim: ts=4 | |
use strict; | |
use warnings; | |
use DBI; | |
use Text::Table; | |
my $chid = shift; | |
my $dbh = DBI->connect("DBI:mysql:database=vz;host=localhost", "vz", "Geheim", { RaiseError => 1, AutoCommit => 1 }); |