Skip to content

Instantly share code, notes, and snippets.

View stefanozanella's full-sized avatar

Stefano Zanella stefanozanella

View GitHub Profile
@stefanozanella
stefanozanella / gerrit_with_ldaps_auth.md
Created November 21, 2012 11:01
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

@stefanozanella
stefanozanella / description.md
Created December 1, 2012 02:01
Puppet implementation patterns: Safe Default

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 / description.md
Created December 2, 2012 20:30
Puppet implementation patterns: Test with External Function

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 / enable_serial_console.sh
Created January 16, 2013 18:26
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
stefanozanella / description.sh
Created January 22, 2013 23:05
Debug Git HTTPS issues
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 / cnxsoft.md
Last active June 12, 2023 23:05
Emulate a Raspberry Pi with Qemu+ KVM

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 / procedure.md
Last active October 31, 2019 11:54
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 "http://www.ubuntu.com/start-download?distro=server&bits=64&release=latest"
@stefanozanella
stefanozanella / botchagalupe_research.md
Last active November 10, 2023 01:16 — forked from botchagalupe/gist:7423501
Resources about SDN by John Willis

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 / tip.md
Created November 27, 2013 12:57
How to improve UX during kickstart installations with long `%post` sections

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 / html5mathjax.cfg
Last active March 7, 2023 22:10
Custom tex4ht (htlatex) configuration, so that it generates HTML5 code with MathJax rendering
% 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}{}