Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Haschek geek-at

View GitHub Profile
@geek-at
geek-at / trash.sh
Created Aug 13, 2020
The script used to trash a banking phishing site
View trash.sh
#!/bin/bash
while :; do
verf=$(cat /dev/urandom | tr -dc '0-9' | fold -w 8 | head -n 1)
pin=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
ip=$(printf "%d.%d.%d.%d\n" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))")
@geek-at
geek-at / example.py
Created Aug 10, 2020
Python example for nsfw-categorize.it
View example.py
import requests
import json
url = 'https://nsfw-categorize.it/api/upload'
files = {'image':('1.jpg', open('1.jpg', 'rb'))}
r = requests.post(url, files=files)
result = json.loads(r.content)
if(result["status"]=='OK'):
print("This image is classified as "+str(result["data"]["classification"]))
@geek-at
geek-at / example.js
Created Aug 10, 2020
Node JS example for nsfw-categorize.it
View example.js
const request = require('request')
const fs = require('fs');
var req = request.post("https://nsfw-categorize.it/api/upload", function (err, resp, body) {
if (err) {
console.log('Error!');
} else {
var json = JSON.parse(body)
if(json.status=='OK')
console.log("This image has been classified as",json.data.classification)
@geek-at
geek-at / example.sh
Created Aug 10, 2020
Bash example for nsfw-categorize.it
View example.sh
#!/bin/sh
# Test image1.jpg
curl -s -F "image=@image1.jpg" "https://nsfw-categorize.it/api/upload"
# Let the API analyze an externally hosted image
curl -s "https://nsfw-categorize.it/api/upload?url=https://i.imgur.com/wubvFTM.jpeg"
@geek-at
geek-at / example.php
Created Aug 10, 2020
PHP example for nsfw-categorize.it
View example.php
<?php
$nsfw = new NSFW();
// Example 1: upload images to check later
//
$results = $nsfw->uploadFile('image1.jpg',true);
if(is_array($results))
echo "Classification done. Image is {$results['classification']}".PHP_EOL;
View irrigation.ino
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
#define wifi_ssid "YourWIfiName"
#define wifi_password "YourWifiPassword"
const char* mqttServer = "192.168.1.61"; //IP of your MQTT Server
const int mqttPort = 1883; // Port of your MQTT server
//pins change these if you used different pins
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:
@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
@geek-at
geek-at / parse_austria.php
Last active Jun 9, 2020
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 / 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');
You can’t perform that action at this time.