Skip to content

Instantly share code, notes, and snippets.

View Mischi's full-sized avatar

Fabian Raetz Mischi

  • Germany, Dortmund
View GitHub Profile
set -l data_status (curl -s https://iceportal.de/api1/rs/status)
set -l data_trip (curl -s https://iceportal.de/api1/rs/tripInfo/trip)
# next stop
echo  (echo $data_trip | jq -r '([ .trip.stops[] | select(.info.passed==false) ]
| first).station.name')
# train number
echo  (echo $data_trip | jq -r '"\(.trip.trainType)-\(.trip.vzn)"')
# speed
echo speed (echo $data_status | jq -r '"\(.speed) km/h"')
@jpmens
jpmens / profile.sh
Created April 5, 2019 22:36
tmux autostart via ssh
# .profile
...
# try to attach to tmux session or create a new one. When
# tmux exits (e.g. detach) we exit this session.
sname="t-$(hostname)"
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then
@avishayil
avishayil / route53.sh
Created October 14, 2018 17:00
Update Route53 Record With Machine IP Address
#!/bin/bash
# (optional) You might need to set your PATH variable at the top here
# depending on how you run this script
# PATH=PATH
# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="ZONEID"
# The CNAME you want to update e.g. hello.example.com
@ageis
ageis / bitcoin-monitor.md
Last active February 17, 2023 01:25
Prometheus exporter for monitoring statistics of Bitcoin daemon

bitcoind-monitor.py

This is a script written in Python intended to run alongside a Bitcoin node and export statistics for monitoring purposes. It assumes the existence of bitcoin-cli in the PATH and access to the RPC interface over localhost.

It tracks stuff like: block height, difficulty, number of peers, network hash rate, errors, uptime in seconds, mempool size, size of recent blocks, number of transactions within blocks, chaintips, total bytes received and sent, and transaction inputs and outputs. These Bitcoin metrics are refreshed once every 5 minutes.

How it works

Prometheus is a monitoring system and time-series database.

If you're using SystemJS in the browser, you'll want to update your System config to point at the bundles, if you're not already.

System.config({
  //use typescript for simple compilation (no typechecking)
  //transpiler: 'typescript',
  //typescript compiler options
  //typescriptOptions: {
    //emitDecoratorMetadata: true
  //},
@btroncone
btroncone / ngrxintro.md
Last active February 9, 2024 15:37
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@dsyme
dsyme / gist:9b18608b78dccf92ba33
Last active November 1, 2022 18:11
Working self-contained getting-started sample for Suave Web Scripting
//==========================================
// Working fully self-contained getting-started example for Suave Web Server scripting
//
// Note you don't need to have _anything_ installed before starting with this script. Nothing
// but F# Interactive and this script.
//
// This script fetches the Paket.exe component which is referenced later in the script.
// Initially the #r "paket.exe" reference is shown as unresolved. Once it has been
// downloaded by the user (by executing the first part of the script) the reference
// shows as resolved and can be used.
@dave-newson
dave-newson / toggle-checkbox.js
Last active January 10, 2018 05:00
Bootstrap-toggle AngularJS directive
'use strict';
/**
* Bootstrap-toggle Directive
* @link https://github.com/minhur/bootstrap-toggle
*/
angular.module('toggleCheckbox', [])
.directive('toggleCheckbox', function() {
/**
@vext01
vext01 / vimura.md
Last active February 14, 2024 03:36
Vim+Zathura+Synctex

Vim+Zathura+Synctex

  • In a script called 'vimura':
#!/bin/sh
echo $1
zathura -s -x "gvim --servername $1 -c \"let g:syncpdf='$1'\" --remote +%{line} %{input}" $*
anonymous
anonymous / tmux.conf
Created September 9, 2014 18:35
vim friendly tmux configuration
#Prefix is Ctrl-a
set -g prefix C-a
bind C-a send-prefix
unbind C-b
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
#Mouse works as expected