Skip to content

Instantly share code, notes, and snippets.

View eni23's full-sized avatar
👾
"working"

Cyrill v.W. eni23

👾
"working"
View GitHub Profile
@eni23
eni23 / music_housewife.sh
Last active August 29, 2015 13:59
housewife for com_artlu_music
#!/bin/bash
#
#
# project: artlu website
# author: cvw-2014-04-16
# version: {$id}
#
# desc:
# convert uploaded audio-files to misc formats
# and delete orphaned entrys from com_artlu_music
@eni23
eni23 / colissimo.php
Created March 26, 2015 15:13
Quick and Dirty class to Query Colissimo-API with Support for mulitple languages
<?php
/**
* Quick and Dirty class to Query Colissimo-API
* Support for mulitple languages
*
* @author Cyrill von Wattenwyl < 5@e23.ch >
* @deps DOM, Allow http for file_get_contents in php.ini
*
**/
class colissimo {
#!/usr/bin/python
# -*- coding: utf8 -*-
import os
import sys
import math
import fcntl
import struct
import termios
ARDUINO_DIR = /home/eni/progs/arduino-1.6.4
PROJECT_DIR = /home/eni/code/arduino-esp-makefile
SRCDIR = $(PROJECT_DIR)/src
OBJDIR = $(PROJECT_DIR)/build
MAINFILE = main.ino
# generic / nodemcu / modwifi
BOARD = nodemcu
# 80 or 160 (mhz)
#!/bin/bash
RESOURCE_PREFIX="staticfile_"
LOOKUP_FUNCTION_NAME="lookup_file"
DATATABLENAME="datatable"
XXD="/usr/bin/xxd"
INPUT_DIR=$1
OUTPUT_FILE=$2
SetEnvIfNoCase User-Agent ^$ bad_bot
SetEnvIfNoCase User-Agent "^Java.*" bad_bot
SetEnvIfNoCase User-Agent "-" bad_bot
SetEnvIfNoCase User-Agent "^BacklinkCrawler" bad_bot
SetEnvIfNoCase User-Agent "PHP/*" bad_bot
SetEnvIfNoCase User-Agent "PhantomJS*" bad_bot
SetEnvIfNoCase User-Agent "Prlog/1.0" bad_bot
SetEnvIfNoCase User-Agent "^attach" bad_bot
SetEnvIfNoCase User-Agent "^Au2Email" bad_bot
SetEnvIfNoCase User-Agent "^Advanced Email Extractor" bad_bot
#!/bin/bash
# genstatic.sh-0.1.3
# by eni@e23.ch
usage(){
cat << 'EOF'
genstatic.sh
Generate xxd-include & header from a directory
Usage:
<?php
define('DB_USER', 'dbuser');
define('DB_PASSWORD', 'dbpass');
$db = mysql_connect('localhost', DB_USER, DB_PASSWORD);
mysql_select_db("dbname",$db);
$result = mysql_query("SELECT ID, post_content FROM wp_posts");
while ($row = mysql_fetch_array($result)) {
$match=strpos($row[1],"<script");
if ($match){
#!/bin/bash
IFACE=org.freedesktop.Notifications
MEMBER=Notify
dbus-monitor --monitor "interface='$IFACE',member='$MEMBER'" |
while read -r line; do
if [ "$(echo $line | grep 'mail-notification')" ]; then
blinkstick --pulse --set-color='#00ff00' --duration=1000
@eni23
eni23 / mac-to-ip.sh
Created March 21, 2013 10:41
script to resolve an mac-addr to an ip ./mac-to-ip.sh 00:00:00:00:00 192.168.1.0/24
#!/bin/bash
# achtung, admins finden das gar nicht cool
MACADDRESS=$1
NETWORK=$2
sudo ip neigh flush all > /dev/null;
sudo fping -c 1 -g -q $NETWORK 2> /dev/null;
sudo arp -n | grep $MACADDRESS