Skip to content

Instantly share code, notes, and snippets.

View foertel's full-sized avatar

Felix Oertel foertel

  • Common-Link AG
  • Rendsburg, Germany
View GitHub Profile
@foertel
foertel / esp8266_temp_mqtt.ino
Created February 21, 2018 09:51
esp8266 temperature from dht22 to mqtt
#include <ESP8266WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"
#include "DHT.h"
#define WLAN_SSID "Felix"
#define WLAN_PASS "somePass"
#define MQTT_SERVER "192.168.1.2"
#define MQTT_SERVERPORT 1883 // use 8883 for SSL
@foertel
foertel / make.sh
Last active September 26, 2016 10:32
Little firmware build script
#!/bin/bash
cd gluon/
SITES=$(dialog --title "Select site.conf" --checklist "Chose" 15 60 4 \
com1 "Community 1" OFF \
com2 "Comunity 2" OFF 3>&2 2>&1 1>&3) # show dialog and store output
clear
GLUON_BRANCH=$(dialog --title "Branch" --menu "Chose one" 15 60 3 \
stable "Stable" \
beta "Beta" \
experimental "Experimental" 3>&2 2>&1 1>&3) # show dialog and store output
@foertel
foertel / keybase.md
Created March 9, 2015 08:29
Foertel Keybase Prove

Keybase proof

I hereby claim:

  • I am foertel on github.
  • I am foertel (https://keybase.io/foertel) on keybase.
  • I have a public key whose fingerprint is 6474 D886 F741 F164 6CD4 7BAE F859 59EC B723 8802

To claim this, I am signing this object:

@foertel
foertel / setupAlfredJson.sh
Created October 3, 2014 10:14
How to setup alfred-json on Ubuntu
#!/bin/bash
apt-get install pkg-config cmake git libjansson-dev zlib1g-dev
git clone http://git.open-mesh.org/alfred.git
export CONFIG_ALFRED_GPSD=n
cd alfred/
cmake .
make
make install
start-stop-daemon -b --start --exec /usr/local/sbin/batadv-vis -- -si bat0;
start-stop-daemon -b --start --exec /usr/local/sbin/alfred -- -i bat0;
@foertel
foertel / setupGraph.sh
Last active June 28, 2017 17:44
How to setup graphite with grafana in Ubuntu 14.04
#!/bin/bash
echo '
###
# Welcome to graphite creator
###
!!!
! THIS WILL REMOVE /var/www - MAKE SURE YOU WANT TO DO THIS!
!!!
@foertel
foertel / setupGateway.sh
Created July 18, 2014 15:24
setup gateway script from 18 july
#!/bin/bash
###
# gateway creator v0.1
# by wiflix
#
# just run as root, add your VPN credentials and reboot!
# please remove my name, if you wanna extend or alter this script!
###
@foertel
foertel / testinram.sh
Created July 15, 2014 14:45
TYPO3 Functional Tests in Ram
#!/bin/bash
#
# This script will
# * fire up a ramdisk
# * start a mysql server using it as storage
# * copying your typo3 database to ram
# * run the tests
# * clean up
#
# use -k as parameter to clean-up after a failed run
@foertel
foertel / alfred2graphite.php
Created July 8, 2014 20:43
Hacky PHP Script to push alfred data to graphite
#!/usr/bin/php
<?php
function run() {
$macMapping = array(
'ed:de:' => 'Swartz',
'99:81:' => 'Swartz',
);
exec('sudo alfred-json -r 158', $alfredJson);
@foertel
foertel / testinram.sh
Created March 11, 2014 13:37
Run TYPO3 functional tests in ramdisk for speeeeeed ...
#!/bin/bash
#
# This script will
# * fire up a ramdisk
# * start a mysql server using it as storage
# * copying your typo3 database to ram
# * run the tests
# * clean up
#
# use -k as parameter to clean-up after a failed run
@foertel
foertel / BackendConfigurationManager.php
Created January 7, 2014 14:51
BackendConfigurationManager->getCurrentPageId()
<?php
/**
* Returns the page uid of the current page.
* If no page is selected, we'll return the uid of the first root page.
*
* @return integer current page id. If no page is selected current root page id is returned
*/
protected function getCurrentPageId() {
$pageId = (integer) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
if ($pageId > 0) {