Originally posted .

git: push to multiple repositories

Source: http://stackoverflow.com/a/14290145/899560

git remote set-url --add --push origin git://original/repo.git
git remote set-url --add --push origin git://another/repo.git

OpenLDAP TLS configuration

I had problems when trying to configure OpenLDAP (slapd) on Debian 8 (jessie) using custom TLS certificates. After trying to apply olcTLS* settings with LDIF

dn: cn=config
changetype: modify
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/ldap/sasl2/ca-certificates.crt
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/ldap/sasl2/server.crt
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/ldap/sasl2/server.key

I just got error ldap_modify: Other (e.g., implementation specific) error (80), for which there is lots of possible causes.

Googling only returns answers like “check file permissions for certs/keys”, “check that files are in PEM format”, “generate certs using GNUTLS instead of OpenSSL”. I tried all of these without success. Then, I tried something completely different…

On Debian, there is global LDAP configuration file at /etc/ldap/ldap.conf, containing line TLS_CACERT/etc/ssl/certs/ca-certificates.crt. Changing this to point to my root CA fixed the issue. For some reason, slapd refuses to accept olcTLS* if this separate config points to another CA than the config I’m applying to slapd…

Virtualbox image to libvirt

There was no upstream-provided Ubuntu (trusty64) image for libvirt-based systems. (And my need for the image was temporary = no interest in building my custom image…)

So, I downloaded their image for Virtualbox

vagrant box add ubuntu/trusty64 --provider=virtualbox

and converted it for libvirt

qemu-img convert -f vmdk -O qcow2 ~/.vagrant.d/boxes/ubuntu-VAGRANTSLASH-trusty64/2*/virtualbox/*.vmdk ubuntu-trusty64.img
/usr/share/doc/vagrant-libvirt/examples/create_box.sh ubuntu-trusty64.img
vagrant box add ubuntu-trusty64.box --name ubuntu/trusty64 --provider=libvirt

Now the image was ready for use:

cd myproject
vagrant init ubuntu/trusty64
vagrant up
# profit!

Generate passphrase

shuf -n4 /usr/share/dict/words |tr '[A-Z]' '[a-z]' |tr '\n' ' ' |tr -d "'" && echo ""

Checkout pull request @ GitHub

git fetch origin pull/ID/head:BRANCHNAME
git checkout BRANCHNAME

From https://stackoverflow.com/a/30584951 (answer by “timbo”)

Move tmux window to another session

  • <prefix>s
  • <prefix>s :move-pane -t <session>:<window>

Feedback / comments?

Ping me (@ypcs) on Twitter