Skip to content

Instantly share code, notes, and snippets.

@tfnico
tfnico / keybase.md
Created July 24, 2017 17:14
keybase

Keybase proof

I hereby claim:

  • I am tfnico on github.
  • I am tfnico (https://keybase.io/tfnico) on keybase.
  • I have a public key ASDkQGs8RbZYJwhOiWGG4FQnZi7zJlsDf8lgDiDRq3nmKwo

To claim this, I am signing this object:

@tfnico
tfnico / README.md
Last active April 12, 2018 21:59
Cross-compiling Rust for raspberry-pi (with system dependencies)

This is a quick guide on how to set up cross-compilation of Rust programs, where you are using Rust libraries that have system level dependencies, like openssl.

We think it's easiest to cross-compile on a 32 bit linux machine. Could be that 64 bit works as well, but since the arm is 32 bit..

Set up cross-compilation according to https://github.com/Ogeon/rust-on-raspberry-pi

It is a bit of work. but make sure you follow the instructions, and keep to the 32 bit options.

@tfnico
tfnico / Something.java
Last active September 16, 2020 10:12
Send http request using google-http-client
// Related to https://gist.github.com/tfnico/5926374
// and http://stackoverflow.com/questions/14464486/guava-input-output-suppliers-and-urlconnection
static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
public void sendMessage(String url, String params){
final HttpURLConnection connection;
try {
HttpRequestFactory requestFactory = HTTP_TRANSPORT.createRequestFactory();
@tfnico
tfnico / gist:49b420562d886b693ce5
Created January 30, 2015 16:50
gradle-application-plugin launch script
#!/usr/bin/env bash
##############################################################################
##
## start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and APP_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Djava.util.logging.config.file=./etc/log.conf" "-Ddatabase.storage.hostname=some-titan"'
@tfnico
tfnico / README.md
Last active August 29, 2015 14:11
Building and pushing docker images to GiantSwarm from your existing jenkins
  • Create a server to work as a Jenkins slave (implying you have an existing Jenkins) on DigitalOcean or whatever you use for getting servers up and running.
  • Install Ubuntu on it, and Java for running the Jenkins slave (current openjdk 7 should work)
  • Create a jenkins user, add a authorized_key that the Jenkins master can use for SSHing to it (see Jenkins docs for more info)
  • Install the latest docker (see Docker docs for info)
  • Add user jenkins to the docker group
  • Do sudo su jenkins, and (with your username/password)
    docker login https://registry.giantswarm.io
@tfnico
tfnico / keybase.md
Created September 24, 2014 08:10
Keybase proof

Keybase proof

I hereby claim:

  • I am tfnico on github.
  • I am tfnico (https://keybase.io/tfnico) on keybase.
  • I have a public key whose fingerprint is A72F 92D5 4452 28CA 05C5 F7DE 8B57 C065 E149 47C7

To claim this, I am signing this object:

@tfnico
tfnico / gist:5fd2dfea556d9a357a55
Created August 26, 2014 09:03
Set JAVA_HOME to whatever jenv says it is on OS X
#In my .zshrc:
#...
# Normal jenv config
export PATH="$HOME/.jenv/bin:$PATH"
eval "$(jenv init -)"
# Now find the JAVA_HOME for it:
jenv_java=$(jenv global) # yields 'oracle64-1.6.0.54'
echo $jenv_java
jenv_java_without_oracle=${jenv_java#*oracle64-} # yields '1.6.0.54'
@tfnico
tfnico / manifest.pp
Last active September 16, 2018 12:56
Puppet recipe for installing Java8 on Debian
class oracle_java8 {
# This follows the recipe from http://blog.nocturne.net.nz/devops/2013/08/14/provisioning-oracle-java-with-puppet-apply/
# adapted with the instructions from http://www.webupd8.org/2014/03/how-to-install-oracle-java-8-in-debian.html
# define a variable for the webupd8team ppa sources list
$webupd8src = '/etc/apt/sources.list.d/webupd8team.list'
exec {'hello':
unless => "/bin/true",
@tfnico
tfnico / gitminutes-gitblit.md
Last active January 11, 2020 22:57
Working with GitBlit tickets

This is an addendum to GitMinutes #29: James Moger on GitBlit

push HEAD:refs/for/5

This syntax is used for two scenarios.

a. pushing to a ticket that DOES NOT have any commits

b. pushing a rewrite of commits to a ticket that DOES have commits

@tfnico
tfnico / spring-rest-data-problems.md
Last active August 29, 2015 14:00
Having some problems with upgrading spring-rest-data

In the latest release of spring-rest-data (2.0.2), calling the root "descriptor" (/api/) works fine , but calling a GET on any entity (/api/plannedWorkloads) fails with an exception.

It works fine when using spring-rest-data-2.0.0.M1.

When switching to spring-rest-data-2.0.0.RELEASE: https://gist.github.com/tfnico/11243724

When switching tp spring-rest-data-2.0.1.RELEASE: https://gist.github.com/tfnico/11243762

Switching to spring-rest-data-2.0.2.RELEASE gives the same error as in 2.0.1.