Skip to content

Instantly share code, notes, and snippets.

@kralo
kralo / ex-clasification.scala
Created January 30, 2014 22:31
Example Implementation in Scala of Lloyd and Fuzzy-C-Means Clustering
/**
* Preface:
*
* this is an educational implementation of two algorithms for unsupervised learning.
* They may not follow every standard notation but I hope they are illustrative.
* I am neither the most versatile scala programmer, so there may always be a way to express
* things in a more idiomatic way.
*
* This example is not packaged so that you can run it easily via the scala REPL.
* try with scala <this_filename>.scala
@kralo
kralo / fritzbox-dyndns-update-multiple.php
Created August 25, 2014 20:45
php script to update multiple dyndns endpoints with one url
<?php
/**
* Quick and dirty script to update ipv4 and ipv6 records simultaneously by the fritz box ddns function.
* afraid.org offered only one-record-per-url so this takes the fritzbox input and makes two separate calls to afraid.org
* Fritzbox settings should be:
* url = point to this script. attach parameters auth_key, ipv4 and ipv6. Lookup the fritzbox help to find the parameter placeholder, should look like
* http://path-to-this-script.com/script.php?auth_key=<username>&ipv4=<ipaddr>&ipv6=<ip6addr>
* domain: your domain
* username: yourawesomekey below
@kralo
kralo / DSLXX_generator.mwe2
Created June 24, 2015 20:49
Example mwe2 Workflow for a code generator working on your own dsl
module de.example.crudDsl.generator
import org.eclipse.emf.mwe.utils.*
import de.example.crudDsl.generator.CrudToAppGeneratorSetup
import de.example.crudDsl.generator.CrudToAppGeneratorSupport
var targetDir = "src-gen"
var projectName = "Yourapp"
var baseProjectPath = "../../${projectName}"
var filePath = "../de.example.pizzaInDsl/" // where your model.dsl* files are
@kralo
kralo / howto-xorg-framebuffer-default-size.txt
Created April 14, 2018 06:33
[HOWTO] Configure Xorg/X11 Framebuffer default size when no monitor attached
# there is no monitor attached
$ xrandr -q -d :0
Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 4096 x 4096
VGA-1 disconnected primary (normal left inverted right x axis y axis)
LVDS-1 disconnected (normal left inverted right x axis y axis)
DVI-D-1 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
# Write in xorg.conf
@kralo
kralo / howto-securepointssl-nscerttype-error.md
Created April 1, 2020 11:50
securepoint ssl client openvpn require nsCertType=SERVER

If you experience this error VERIFY nsCertType ERROR: CN=server, require nsCertType=SERVER

try to update your Securepoint SSL VPN Client Version.

V. 2.0.18 did not work, V 2.0.28 did work.

Securepoint SSL Client 2.0.18 == not working
Try to start OpenVPN connection <redacted>
@kralo
kralo / demo-api-javascript-teamup.html
Created January 27, 2016 19:24
Small demo how to display an html widget for calendar events from the teamup API
<!DOCTYPE html>
<html>
<body>
<p>requirejs is used here in order to make the html snippet / widget work in the 1&1 MyWebsite </p>
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.22/require.min.js"></script>
<div id="CalData"><p>Wird geladen...</p>
</div>
<script type="text/javascript">
require.config({
paths: {
# supposed to be CMT-120FPS-OV9281-C411 "Global Shutter, Black/White Image, 120FPS High Frame Rate, USB Camera Module with OV9281 sensor"
# v4l2-ctl
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : USB Camera: USB Camera
Bus info : usb-0000:00:1a.0-1.5
Driver version: 4.15.18
Capabilities : 0x84200001
Video Capture
Streaming
@kralo
kralo / system-3S1000.ucf
Created October 21, 2013 20:38
ucf System File for Xilinx 3S1000 Spartan 3
## System ucf file For Spartan 3S100
## with aliases such as XSA-3S1000 Board / XST3 / 3S1000 ft256 / ...
## and the XST-3.0 XSTend Board V 3.0
## note: Column-edited with geany
##
## for further information see "Connections Between the XST-3.0 Board and the Various XSA Boards"
## on http://www.xess.com/static/media/manuals/xst-manual-v3_0.pdf#page=24
## marks a new section
@kralo
kralo / linux_v4l2-ctl_example_usage.txt
Created January 26, 2021 13:52
Example usage how to get rough timing debug information
$ v4l2-ctl --stream-mmap --stream-count=2 --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_REQBUFS: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
VIDIOC_QBUF: ok
VIDIOC_QUERYBUF: ok
@kralo
kralo / a_electron_auto-resize_window_to_content.md
Last active August 15, 2021 18:16
electron_auto-resize_window_to_content

resize the electron app to match the content. Might be used for web-based Asterisk BLI-Pages or other unobstrusive notifications.

Window is always on top on Ubuntu/Windows