Skip to content

Instantly share code, notes, and snippets.

@csabahenk
csabahenk / 1-swift-pdb.md
Last active December 23, 2015 08:29
Swift and Pdb

Using Pdb with Swift does not work because Swift redirects stdin (even in foreground mode). Here we describe how to get it work.

  • apply attached patch on Swift source

  • wherever you'd call pdb.set_strace() do it like this:

from swift.common.utils import stdio_restore import pdb

@csabahenk
csabahenk / multiple-acc-g4s.md
Created September 29, 2013 14:01
Multiple accounts per volume for Gluster for Swift
@csabahenk
csabahenk / 00README.md
Last active December 24, 2015 05:49
Utility script for publishing Markdown Extra documents as Gist

While Gist's markdown flavor is a superset of basic Markdown, it's not exactly the same as Markdown Extra.

To publish documents written in Markdown Extra as Gist so that it looks good:

  1. Convert the document to basic Markdown with Pandoc:

$ pandoc -f markdown -t markdown_strict ```

@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.

@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 / 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 / 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 / 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 / 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 / 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 {