Skip to content

Instantly share code, notes, and snippets.

View Commifreak's full-sized avatar

Robin Kluth Commifreak

View GitHub Profile
@Commifreak
Commifreak / lifepo4weredpi.sh
Last active February 16, 2024 17:33
LiFePO4wered Pi CheckMK local check
#/!bin/bash
SVC_NAME='"LiFePo4weredPI"'
MPREF="$(hostname)"
OUT_STATUS='0'
OUT_TEXT="External power active"
lifepo4wered-cli get > /dev/null 2>&1
if [ ! $? -eq 0 ]
@Commifreak
Commifreak / HTTPAPI.php
Last active October 5, 2022 05:31
Alcatel WBM API Helper
<?php
/**
* Created by PhpStorm.
* User: Robin
* Date: 09.04.2018
* Time: 14:23
*/
class HTTPAPI
{
@Commifreak
Commifreak / vcdsParser.php
Last active July 7, 2022 15:58
VCDS AutoScan parser for PHP
/**
* Takes a AutoScan as input and gives back an array with infos
* @param $path
* @return array The data [ECU#, PartNo, ComponentVersion]
* @note This code is part of vag-flashinfo.de ;)
*/
public static function processVCDSFile($path) {
$vcdsData = [];
@Commifreak
Commifreak / example.php
Last active March 21, 2022 13:58
PHP + Apache + mod_fcgi + EventSource SSE Working example
/**
Apache configured via mod_fcgi default. No special config
**/
$padSize = ini_get('output_buffering');
header("Content-Type: text/event-stream");
header("Cache-Control: no-cache");
ob_implicit_flush(true); // flush auto
@Commifreak
Commifreak / moveOldLib.sh
Created June 11, 2021 06:16
R - move old R user lib and clean any active session to force re-creation of the user lib
#!/bin/bash
RVER=$1
if [ "$RVER" == "" ]; then
echo "No R version specified"
exit 1
fi
echo "Killing sessions..."
@Commifreak
Commifreak / getCommonlyUsedPackages.php
Created June 11, 2021 06:14
R - Show commonly used packages of users
<?php
$pkgs = [];
$libs = 'R/x86_64-pc-linux-gnu-library';
chdir('/home');
$users = glob('*.*');
@Commifreak
Commifreak / addRUser.sh
Created November 25, 2020 09:26
Create a new user for rstudio free
#!/bin/bash
HTTPADDR=http://rstudio-webpage/
HELPADDR=http://helppage/
#Skeleton to use (put Renviron in there for example
SKEL=/opt/ruser-skel
MAILSENDER=rsupport@domain.tld
@Commifreak
Commifreak / 1_VaillantAPI.php
Last active November 16, 2020 17:31
VaillantAPI
<?php
class VaillantAPI
{
private $_ch;
private $_lastCurlError;
private $_lastCurlInfo;
private $_lastCurlErrno;
private $_proxyPort;
@Commifreak
Commifreak / lora_mkr1010.ino
Created October 14, 2020 15:32
Dragino LoRa Test on MKR 1010
#include <SPI.h>
#include <lmic.h>
#include <hal/hal.h>
int waitForSerial = 10000; //10s
unsigned long currentMillis = 0;
/**
################################################ LoRa stuff
*/
@Commifreak
Commifreak / runedal.sh
Last active August 14, 2020 07:52
eDAL! Start-script
#!/bin/bash
## eDAL! Helper
## add to crontab like:
## eDAL
##@reboot edal /opt/runedal.sh
##
## IMPORTANT!