Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢

Christian Haschek geek-at

🐢
View GitHub Profile
@geek-at
geek-at / ethpay.php
Created Jun 9, 2017
PHP Ethereum payment class
View ethpay.php
<?php
define('RPC_IP','127.0.0.1');
define('RPC_PORT',8545);
require 'libs/ethereum-php/ethereum.php';
$e = new EthPay();
class EthPay
{
View coindata.php
<?php
/**
* Coin Dashboard by Christian Haschek
* https://blog.haschek.at
*
* Donations always welcome
* BTC: 1ChrisHMgr4DvEVXzAv1vamkviZNLPS7yx
* ETH: 0x1337C2F18e54d72d696005d030B8eF168a4C0d95
*
* Read more at
View grafana_crypto_dashboard.json
{
"annotations": {
"list": []
},
"editable": true,
"gnetId": null,
"graphTooltip": 1,
"hideControls": false,
"id": 18,
"links": [],
View fishtank.ino
const int pin_all = D0;
const int pin_blue = D2;
#include <ESP8266WiFi.h>
const char* ssid = "your_wifi_name_here";
const char* password = "your_wifi_password_here";
int fade_delay = 2; //how many milliseconds between pulses (the lower, the faster the light changes)
//code starts here
@geek-at
geek-at / raspi_preparestream.sh
Created Mar 28, 2018
This script will install everything needed to stream your PiCam over the network with very little CPU usage
View raspi_preparestream.sh
#!/bin/bash
apt-get update
apt-get install -y git cmake autoconf bc libvpx-dev libx264-dev libjpeg-dev build-essential libtool autoconf ffmpeg #raspberrypi-kernel-headers
wget http://www.live555.com/liveMedia/public/live555-latest.tar.gz -O - | tar xvzf -
cd live
./genMakefiles linux
sudo make CPPFLAGS=-DALLOW_RTSP_SERVER_PORT_REUSE=1 install
View raspi-security.py
from ctypes import *
import math
import random
import time
import os
def sample(probs):
s = sum(probs)
probs = [a/s for a in probs]
r = random.uniform(0, 1)
@geek-at
geek-at / easybank.class.php
Created Apr 3, 2018
php wrapper for read only access to easybank.at
View easybank.class.php
<?php
/*
* EasyBank.at client lib
* Reverse engineered by looking at the API calls of the app
*
* Example usage:
*
* <?php
* include_once('easybank.class.php');
@geek-at
geek-at / parse_austria.php
Last active Apr 15, 2021
Parsing ip data from a file
View parse_austria.php
<?php
$infile = 'austria.csv';
$outfile = 'austria.ips';
$fp = fopen($outfile,'w');
$handle = fopen($infile, "r");
if ($handle)
{
while (($line = fgets($handle)) !== false) {
$line = trim($line);
@geek-at
geek-at / smartmeter.ino
Created Oct 19, 2018
Example script to log flashing light to influxdb via UDP. See https://blog.haschek.at/smartmeter for more info
View smartmeter.ino
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
WiFiUDP Udp;
const char* ssid = "yourwifiSSID";
const char* password = "yourwifipassword";
const int threshold = 400; //this is the threshold how high the value has to be to be registered as a flash.
//400 works great for me since flashes are usually ~600
IPAddress remoteIP(192,168,1,117); // the IP address of your Influxdb server
View gist:645c4cb569a39d9958b2e64fa7221c36
### Keybase proof
I hereby claim:
* I am geek-at on github.
* I am geek_at (https://keybase.io/geek_at) on keybase.
* I have a public key ASAvzF9dHs0BRtZBYM5m2LiyWafirsvb6qDoy5Bn7B5p6wo
To claim this, I am signing this object: