Skip to content

Instantly share code, notes, and snippets.


Stefano Zanella stefanozanella

View GitHub Profile
stefanozanella / html5mathjax.cfg
Last active Aug 5, 2019
Custom tex4ht (htlatex) configuration, so that it generates HTML5 code with MathJax rendering
View html5mathjax.cfg
% We are generating HTML + MathML code
% We don't want to translate font suggestions with ugly wrappers like
% <span class="cmti-10"> for italic text
% Don't output xml version tag
stefanozanella /
Created Nov 27, 2013
How to improve UX during kickstart installations with long `%post` sections

From here

# change to new vt and set stout/stdin
exec < /dev/tty6 > /dev/tty6
chvt 6
# run post-install

# write/call scripts here
stefanozanella /
Last active Apr 15, 2016 — forked from botchagalupe/gist:7423501
Resources about SDN by John Willis

The Network The Next Frontier for Devops

Cumulus Networks: A Sneak Preview of One of My Favorite Startups - James Hamilton Blog

Stanford Seminar - Software-Defined Networking at the Crossroads

NetworkStatic | Brent Salisbury Blog

Network World: A conversation with Kelly Wanser, CEO of Stateless Networks

stefanozanella /
Last active Oct 31, 2019
Create Ubuntu server image for OpenStack

The procedure below is done on a CentOS 6.3 x86_64 hypervisor

  1. Create qcow image:
qemu-img create -f qcow2 ubuntu-12.10-server-amd64.img 5G
  1. Download Ubuntu server ISO:
wget ""
stefanozanella /
Last active Sep 9, 2020
Emulate a Raspberry Pi with Qemu+ KVM

Booting with CNXSoft image


curl -O

yum install p7zip
7za e 2012-07-15-wheezy-raspian-minimal.img.7z

qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda 2012-07-15-wheezy-raspian-minimal.img -net nic -net user -vnc :0 -net tap,ifname=vnet0,script=no,downscript=no
stefanozanella /
Created Jan 22, 2013
Debug Git HTTPS issues
git clone
* Couldn't find host in the .netrc file; using defaults
* About to connect() to port 443 (#0)
* Trying * Connected to ( port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* Peer's certificate issuer is not recognized: 'CN=Derecom Authentication CA,OU=PKI,O=Derecom srl,L=Padova,ST=Veneto,C=IT'
* NSS error -8179
stefanozanella /
Created Jan 16, 2013
Enable serial console output in CentOS (useful for OpenStack + KVM)
echo "ttyS0" > /etc/securetty
vi /etc/grub.conf
# Add console=ttyS0 to the end of kernel line(s)
vi /etc/sysconfig/init
# Edit ACTIVE_CONSOLES to look like:
ACTIVE_CONSOLES="/dev/tty[1-6] /dev/ttyS0"
# If on a live system, do the following
stefanozanella /
Created Dec 2, 2012
Puppet implementation patterns: Test with External Function

Test with External Function


You want to test a resource definition (class, defined type) that uses a function provided by a third-party module your module depends upon. It's supposed that you're implementing your tests with rspec-puppet.


stefanozanella /
Created Dec 1, 2012
Puppet implementation patterns: Safe Default

Safe Default


You have a defined type and want to use a default value for a parameter from a params class.


Set the default value of the variable as undef, then put a conditional after including the params class in the class body in which you set another internal variable with the value of the params class variable or the user-defined value.

stefanozanella /
Created Nov 21, 2012
Configuring SSL certificate / private key pair in Gerrit to talk with LDAPS backend

Making Gerrit and LDAP speak in tongues together via SSL

If you're an experienced Java developer or container/AS user, you'll probably want to just skip this, since it involves just some Java tools and standards techniques.
If you, however, like me, have only scratched the surface of the ceremony of the Java world (no troll intended), then you can probably find this useful, since I couldn't find proper documentation about this but had to assembly it together from various sources.

I started to configure a Gerrit instance on our company's server to start putting a bit of order in the mess that is our structure by now. Since the instance is private, I didn't want to enable OpenID authentication, nor I wanted to set it in development mode (aka everyone's invited). Having to choose between offloading authentication to an HTTP proxy and setting up an LDAP backend, I opted for the latter. Also, to complicate things further, I have not only enabled SSL support on the LDAP server, but I required _strict client c

You can’t perform that action at this time.