Skip to content

Instantly share code, notes, and snippets.

@csabahenk
csabahenk / 00-README.md
Last active August 27, 2015 14:06
m-shr initialization issue

The following snippets show:

  • some debug logs being added to Manila code
  • the log output of these on my setup
  • some queries from the Manila cli to serve as contrast
@csabahenk
csabahenk / README.md
Last active August 29, 2015 14:25
generate TOC for Github Wiki pages

This script generates TOC for Github Wiki pages, taking their rendered HTML form as input (implied: it's sensitive to prospective page layout changes).

Usage:

$ curl -s https://github.com/<user>/<project>/wiki/<page> | \
  ./githubwikitoc.rb
@csabahenk
csabahenk / maketable.rb
Last active September 21, 2015 16:53
Ruby module to generate HTML tables
require 'cgi'
require 'date'
module MakeTable
extend self
Tabletags = [%w[th td], "tr", "table"]
CSS = <<EOS
table,th,td {
@csabahenk
csabahenk / README.md
Last active August 29, 2015 14:10
git-review-branch -- build a git branch from patchsets of a Gerrit review entry
@csabahenk
csabahenk / debunking9.md
Last active August 29, 2015 14:09
Debunking 9

Definíció.

  • Aritmetikiai függvényen a valós számok egy részhalmazán értelmezett természetes szám értékű függvényt értünk.
  • Sorozaton a természetes számokról a természetes számokba képező függvényt értünk (0-t beleértve a természetes számok közé).
  • A számjegyösszeg-függvény, $sz(n)$ a következő aritmetikai függvény: $sz(n) = \sum_{i\in X} a_i$, ahol $n = \sum_{i\in X} 10^i a_i$, $X$ az egész számok egy nemüres, véges halmaza, és minden $i \in X$-re $1 \le a_i \le 9$.
  • Egy $s(n)$ sorozat stabil, ha van olyan $k$, hogy $m,n \ge k$-ra $s(n) = s(m)$; ez esetben az $s(n), n \ge k$ értéket a sorozat stabil értéknek hívjuk.
  • Az iterált számjegyösszeg-függvény, $sz^*(n)$ a következő aritmetikai függvény:
    • adott $n$-hez képezzük a következő $s_n$ sorozatot:
      • $s_n(0) = n$,
  • $s_n(k) = sz(s_n(k-1))$ ahol $k \ge 1$;
@csabahenk
csabahenk / ganeshamod.rb
Last active August 29, 2015 14:04
Tool to manipulate NFS Ganesha configuration
#!/usr/bin/env ruby
require 'json'
require 'tempfile'
class Hash
def deep_merge! oh
oh.each { |k,v|
if Hash === v and Hash === self[k]
self[k].deep_merge! v
@csabahenk
csabahenk / ganeshatest.rb
Last active August 29, 2015 14:04
Testing NFS-Ganesha export changes
#!/usr/bin/env ruby
require 'json'
require 'shellwords'
require 'tempfile'
MCB = "```"
class String
def indent n
@csabahenk
csabahenk / Readme.md
Last active August 29, 2015 14:02
Pandoc based markdown rendering service

This script spawns you a file server which serves files of various markup formats by rendering them to html. Might come handy if you are writing up something in markdown/rst/etc. and want to check the work you've done.

It needs Ruby and Pandoc (to which we refer for the list of available formatters).

@csabahenk
csabahenk / README.md
Last active August 22, 2018 15:59
vmtree -- an utility to display cloud images and servers' inheritance tree.

Synopsis

$ vmtree -h | head -1
Utility to display cloud images and servers' inheritance tree.

The nova client program (and the web UI) is a source of comprehensive information on an OpenStack deployment. This information, however, is presented in a strictly typed manner: you get information either on servers, or images, or networks, or whatever entity, but on one of these at a time.

Some information is though inherently heterogenous. One such is the inheritance tree, involving images and servers. Images beget servers by instantiation, and servers beget images by snapshotting. It might be convenient to get an overview of these begetting relations. vmtree is an utility to display the tree that they consitute.