Skip to content

Instantly share code, notes, and snippets.

@ubergesundheit
ubergesundheit / VIN.java
Created May 22, 2013 10:39
VIN validator/decoder
public class VIN {
//from http://introcs.cs.princeton.edu/java/31datatype/VIN.java.html
public static boolean isVinValid(String vin) {
int[] values = { 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 0, 7, 0, 9,
2, 3, 4, 5, 6, 7, 8, 9 };
int[] weights = { 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 };
@ubergesundheit
ubergesundheit / generate_ssh_keys.rb
Last active January 3, 2016 20:49 — forked from 3dd13/generate_ssh_keys.rb
modify for creating ssh key for root
define :generate_ssh_keys, :user_account => nil do
username = params[:user_account]
raise ":user_account should be provided." if username.nil?
Chef::Log.debug("generate ssh key for #{username}.")
execute "generate ssh key for #{username}." do
user username
creates "#{(username != 'root' ? '/home' : '')}/#{username}/.ssh/id_rsa.pub"
sudo apt-get install libavahi-compat-libdnssd-dev libavahi-compat-libdnssd1 libsqlite3-dev
/var/run/mysqld/mysqld.sock
@ubergesundheit
ubergesundheit / index.html
Last active August 29, 2015 14:11
tileservice on giantswarm alpha
<!DOCTYPE html>
<html>
<head>
<title>Tileservice on Giantswarm</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<style>
@ubergesundheit
ubergesundheit / check-mac.sh
Created February 28, 2015 01:45
Check if mac-adress is online, call with ./check-mac.sh 11:11:11:11:11:11
#!/usr/bin/env bash
(
set -f # turn of globbing, the file contains probably an *
MAC_TO_CHECK=$1
ARP_FILE=/proc/net/arp
STATUS=unreachable
# try to find the host based on existing arp cache entries
# return values are:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ubergesundheit
ubergesundheit / gist:292d045195aa8a370cab
Created July 18, 2015 09:11
Some ARM related Docker resources
"use strict"
const BASEURL = "https://api.opensensemap.org"
const BOXES_URL = `${BASEURL}/boxes`
const SINGLE_DAY = 86400000
const SINGLE_WEEK = SINGLE_DAY * 7
let now = Date.now()
@ubergesundheit
ubergesundheit / keybase.md
Created February 17, 2016 21:41
keybase.md

Keybase proof

I hereby claim:

  • I am ubergesundheit on github.
  • I am geraldpape (https://keybase.io/geraldpape) on keybase.
  • I have a public key whose fingerprint is 2C17 F396 7A26 B956 BE90 7727 71AB 089A D4F7 C544

To claim this, I am signing this object:

{
"description": "Vega Lite openSenseMap",
"data": {
"url": "https://api.opensensemap.org/boxes/data?boxid=578207d56fea661300861f3b&phenomenon=TagesLeistung&separator=comma&from-date=2016-08-17",
"format": {
"type": "csv"
}
},
"mark": "line",
"encoding": {