Skip to content

Instantly share code, notes, and snippets.

@meise
meise / flac2mp3
Last active February 23, 2018 13:54
convert flac directories to mp3
#!/bin/bash
# Convert all flac files in a directory structure into mp3 and take folder
# structure.
SOURCE_DIR=$1
DEST_DIR=$2
if [ $# -eq 0 ]; then
echo "Usage: ${0} source_dir destination_dir"
@meise
meise / .zshrc
Last active May 21, 2017 10:50
Configure bash variables based on directories
if [[ -e $HOME/.zsh/chpwd_profiles.zsh ]]; then
source $HOME/.zsh/chpwd_profiles.zsh
zstyle ":chpwd:profiles:/home/${USER}/projects(|/|/*)" profile projects
zstyle ":chpwd:profiles:(|/|/*)" profile default
# configuration for profile 'projects':
chpwd_profile_projects() {
[[ ${profile} == ${CHPWD_PROFILE} ]] && return 1
print "chpwd(): Switching to profile: $profile"
@meise
meise / numpy_version.py
Created January 27, 2016 16:36
extract floats from gr message queue without numpy
msg = tb.msgq_out.delete_head()
msg_string = msg.to_string()
samples = np.fromstring(msg_string, dtype='float32')
@meise
meise / broadcast_ip.rb
Created July 20, 2015 14:24
(raspberry pi) broadcast ip addresses after boot
#!/usr/bin/env ruby
# encoding: utf-8
require 'socket'
hostname = Socket.gethostname
socket = UDPSocket.new
socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_BROADCAST, true)
@meise
meise / ffmpeg_webm_to_icecast2.sh
Created May 18, 2015 18:33
ffmpeg webm vp8 hd to icecast2
ffmpeg -re -y -i 'rtmp://127.0.0.1:1935/stream/s1_native_hd' -aspect 16:9 -threads:0 0 -fflags +genpts -flags +global_header -c:v libvpx -g 75 -keyint_min 75 -deadline realtime -b:v 2800k -ac 1 -maxrate:a 96k -c:v libvpx -c:a libvorbis -f webm - | /usr/local/bin/mse_webm_remuxer -cm 2000 - - | oggfwd -w 127.0.0.1 8000 PASSWORD /s1_native_hd.webm;
# for debugging purpose you may want to use "cat <logfile> | egrep -v -f /etc/logcheck/ignore.d.workstation/regex"
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: Did not receive identification string from ::ffff:[\.0-9]+$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: fatal: Read from socket failed: Connection reset by peer \[preauth\]$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: I(llegal|nvalid) user [^[:space:]]* from ([:.[:xdigit:]]+|UNKNOWN)$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: invalid public DH value: <= 1 \[preauth\]$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: Disconnecting: bad client public DH value \[preauth\]$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: Disconnecting: Change of username or service not allowed: \([[:alpha:]]+,ssh-connection\) -> \([[:alpha:]]+,ssh-connection\) \[preauth\]$
^\w{3} [ :[:digit:]]{11} [._[:alnum:]-]+ sshd\[[[:digit:]]+\]: Received disconnect from [:.[:xdig
"""Plugin for media.ccc.de
Supports:
- http://media.ccc.de (vod)
- http://streaming.media.ccc.de (livestreaming)
"""
import re
import requests
import json
@meise
meise / keybase.md
Created March 16, 2015 07:43
keybase.md

Keybase proof

I hereby claim:

  • I am meise on github.
  • I am meise (https://keybase.io/meise) on keybase.
  • I have a public key whose fingerprint is 74A1 C6DF 095D 8A2B 9057 EAF7 2AD8 5968 05AF 72AB

To claim this, I am signing this object:

@meise
meise / 1_get_data
Created October 28, 2014 10:52
Create subnet to asn csv mapping
wget http://thyme.apnic.net/current/data-used-autnums
wget http://data.ris.ripe.net/rrc03/latest-bview.gz
bgpdump latest-bview.gz | ruby bgpdump_to_asn.rb data-used-autnums
@meise
meise / frab_xml2info-beamer_json.rb
Created July 6, 2014 20:53
Ruby script that converts frab xml output file into info-beamer schedule.json file needed for https://github.com/dividuum/info-beamer-nodes/tree/master/30c3-room
require "rexml/document"
require 'pathname'
require 'json'
require 'date'
SCHEDULE_XML = Pathname('schedule.xml')
# C01 or B05/B06 or B07/B08 or A08
ROOM_PATTERN = 'C01|B05\/B06|B07\/B08|B09|A08'
# Lunch or Coffe Break or Breakfast
SKIP_EVENTS = '[Ll]unch|[Cc]offee\s[Bb]reak|[Bb]reakfast'