Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Raven24's full-sized avatar

Florian Staudacher Raven24

  • Self-employed
  • Vienna, Austria
  • X @raven24
View GitHub Profile
@Raven24
Raven24 / CMakeList.txt
Last active May 18, 2020 18:56
olympus footswitch debug - libusb hid
cmake_minimum_required(VERSION 3.15)
project(UsbTest)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_BUILD_TYPE Debug)
add_executable(test test.c)
find_package(PkgConfig)
@Raven24
Raven24 / minimal.rs
Created February 10, 2017 21:58
Rust tokio/futures playground
extern crate futures;
extern crate tokio_core;
use futures::{Future, Poll, Async};
use futures::stream::Stream;
use tokio_core::reactor::Core;
struct SendNotice;
impl Stream for SendNotice {
@Raven24
Raven24 / main.rs
Created July 29, 2016 15:36
Rust speedtest logger
/**
* author: Florian Staudacher, 2016
*
* -----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <florian_staudacher@yahoo.de> wrote this file. As long as you retain this
* notice you can do whatever you want with this stuff. If we meet some day, and
* you think this stuff is worth it, you can buy me a beer in return.
* -----------------------------------------------------------------------------
@Raven24
Raven24 / tmp.rb
Created August 28, 2015 14:55
find duplicates + how many
count = Pod.arel_table[:host].count.as("dup_count")
col = Arel::Nodes::SqlLiteral.new("dup_count")
Pod.
group(Pod.arel_table[:host]).
having(col.gt(1)).order(col.desc).
pluck(count.to_sql, :host).
each do |pod|
pp pod
end
@Raven24
Raven24 / conn_test.rb
Created July 23, 2015 12:40
Connection test script
require 'resolv'
require 'net/http'
class ConnectionTester
REQUEST_OPTS = {
open_timeout: 3,
ssl_timeout: 3,
read_timeout: 5
@Raven24
Raven24 / json_api_example.php
Created June 8, 2015 12:34
www.bundesheer.at - Sperrgebiete API examples
<?php
/**
* Sperrzeiten JSON API Example
*
* @author Florian Staudacher, 2015
* <webteam@bmlvs.gv.at>
*/
@Raven24
Raven24 / mysql_ramdisk.sh
Last active August 29, 2015 14:19
Create a ramdisk with a mySQL server for running CI
#!/bin/bash -xEe
# original source: http://blog.ionelmc.ro/2013/05/30/mysql-too-slow-in-tests-ramdisk-it/
# invocation :
# ./mysql_ramdisk.sh 1 512M some_user some_password
#
random_pass=$(ruby -e "print [*'a'..'z', *'A'..'Z', *'0'..'9'].shuffle.first(8).join")
i=$1
mem=${2:-350M}
//# app/assets/javascripts/app/models/post/interactions.js
reshare : function(){
var interactions = this
, reshare = this.post.reshare()
, flash = new Diaspora.Widgets.FlashMessages();
reshare.save()
.done(function(){
flash.render({
@Raven24
Raven24 / tunnel_monitor.sh
Last active August 29, 2015 14:01
monitoring script checking for ssh tunnel, rebuilding it if necessary
#!/usr/bin/env sh
###########################################################################
# CONFIGURATION
##
TAP_DEV="tap0" # TAP device configured to connect to the remote server
ETH_DEV="eth0" # ETH device for DHCP
@Raven24
Raven24 / start.sh
Last active January 26, 2016 04:57
wrapper script for starting Qemu VMs
#!/usr/bin/env bash
# author: Florian Staudacher
###
# Usage:
# ./start.sh
# uses the configured base image, creates an overlay (if set) and starts
# the VM. The overlay will be discarded at the end (you will have the
# possibility to make a copy before it is deleted).
#