Skip to content

Instantly share code, notes, and snippets.

Avatar

Stefano Zanella stefanozanella

View GitHub Profile
@stefanozanella
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
\Preamble{xhtml,mathml}
% We don't want to translate font suggestions with ugly wrappers like
% <span class="cmti-10"> for italic text
\NoFonts
% Don't output xml version tag
\Configure{VERSION}{}
@stefanozanella
stefanozanella / tip.md
Created Nov 27, 2013
How to improve UX during kickstart installations with long `%post` sections
View tip.md

From here

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

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

The Network The Next Frontier for Devops http://www.slideshare.net/botchagalupe/sdn-and-devops

Cumulus Networks: A Sneak Preview of One of My Favorite Startups - James Hamilton Blog http://perspectives.mvdirona.com/2013/06/18/CumulusNetworksASneakPreviewOfOneOfMyFavoriteStartups.aspx

Stanford Seminar - Software-Defined Networking at the Crossroads http://www.youtube.com/watch?v=WabdXYzCAOU

NetworkStatic | Brent Salisbury Blog http://networkstatic.net/

Network World: A conversation with Kelly Wanser, CEO of Stateless Networks http://www.statelessnetworks.com/network-world-a-conversation-with-kelly-wanser-ceo-of-stateless-networks/

@stefanozanella
stefanozanella / procedure.md
Last active Oct 31, 2019
Create Ubuntu server image for OpenStack
View procedure.md

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 "http://www.ubuntu.com/start-download?distro=server&bits=64&release=latest"
@stefanozanella
stefanozanella / cnxsoft.md
Last active Sep 9, 2020
Emulate a Raspberry Pi with Qemu+ KVM
View cnxsoft.md

Booting with CNXSoft image

Reference: http://www.cnx-software.com/2012/07/31/84-mb-minimal-raspbian-armhf-image-for-raspberry-pi/

curl -O https://dl.dropbox.com/u/45842273/2012-07-15-wheezy-raspian-minimal.img.7z

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
stefanozanella / description.sh
Created Jan 22, 2013
Debug Git HTTPS issues
View description.sh
export GIT_CURL_VERBOSE=1
git clone https://review.derecom.it/example.git
* Couldn't find host review.derecom.it in the .netrc file; using defaults
* About to connect() to review.derecom.it port 443 (#0)
* Trying 172.16.32.248... * Connected to review.derecom.it (172.16.32.248) 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
stefanozanella / enable_serial_console.sh
Created Jan 16, 2013
Enable serial console output in CentOS (useful for OpenStack + KVM)
View enable_serial_console.sh
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
stefanozanella / description.md
Created Dec 2, 2012
Puppet implementation patterns: Test with External Function
View description.md

Test with External Function

When

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.

How

@stefanozanella
stefanozanella / description.md
Created Dec 1, 2012
Puppet implementation patterns: Safe Default
View description.md

Safe Default

When

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

How

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
stefanozanella / gerrit_with_ldaps_auth.md
Created Nov 21, 2012
Configuring SSL certificate / private key pair in Gerrit to talk with LDAPS backend
View gerrit_with_ldaps_auth.md

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.