Skip to content

Instantly share code, notes, and snippets.

View nikolavp's full-sized avatar

Nikola Petrov nikolavp

View GitHub Profile
@aslakknutsen
aslakknutsen / start_testing_java8_today.asciidoc
Last active May 10, 2024 20:15
Example of how to use both JDK 7 and JDK 8 in one build.

JDK 8 Released

Most of us won’t be able to use/deploy JDK 8 in production for a looong time. But that shouldn’t stop us from using it, right?

It should be possible to sneak in JDK 8 in the back way, the same way we snuck in Groovy and other libraries we wanted to use.

The Test Suite to the rescue

The Maven compiler plugin run in two separate lifecycles, compile and testCompile. Those can be configured separately.

root@puppetdb1:/var/lib/puppet# rm -rf ssl
root@puppetdb1:/var/lib/puppet# rm -rf /etc/puppetdb/ssl
root@puppetdb1:/var/lib/puppet# puppet cert generate `facter -p fqdn` # you can use --dns_alt_names=<hostname,hostname2> to add extra cert aliases as well
Notice: Signed certificate request for ca
Notice: Rebuilding inventory file
Notice: puppetdb1.vm has a waiting certificate request
Notice: Signed certificate request for puppetdb1.vm
Notice: Removing file Puppet::SSL::CertificateRequest puppetdb1.vm at '/var/lib/puppet/ssl/ca/requests/puppetdb1.vm.pem'
Notice: Removing file Puppet::SSL::CertificateRequest puppetdb1.vm at '/var/lib/puppet/ssl/certificate_requests/puppetdb1.vm.pem'
root@puppetdb1:/var/lib/puppet# puppetdb-ssl-setup -f
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active May 16, 2024 16:51
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh