Skip to content

Instantly share code, notes, and snippets.

View ldaume's full-sized avatar
🐳
Doing the right things right

Leonard 'Lenny' Daume ldaume

🐳
Doing the right things right
View GitHub Profile
@ldaume
ldaume / cozmo_unleashed.py
Created December 30, 2017 18:08 — forked from acidzebra/cozmo_unleashed.py
Attempting to create a perpetuum cozmobile
#!/usr/bin/env python3
# based on Copyright (c) 2016 Anki, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
<!doctype html>
<html>
<head></head>
<body>
<!--Load three.js-->
<script src="http://threejs.org/build/three.min.js"></script>
<script>
@ldaume
ldaume / cscp.groovy
Last active August 15, 2017 08:16
Parallel Cluster SCP: Copy a file or folder into a group of servers configured by clusterssh config.
#!/usr/bin/env groovy
import com.google.common.base.Splitter
import groovyx.gpars.GParsPool
import org.apache.commons.lang3.StringUtils
import static com.aestasit.infrastructure.ssh.DefaultSsh.*
@Grapes([
@Grab(group = 'org.codehaus.gpars', module = 'gpars', version = '1.2.1'),
@Grab('com.aestasit.infrastructure.sshoogr:sshoogr:0.9.25'),
@ldaume
ldaume / install-docker.sh
Last active August 3, 2017 10:05 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
play.shaded.ahc.org.asynchttpclient.threadPoolName=AsyncHttpClient
play.shaded.ahc.org.asynchttpclient.maxConnections=-1
play.shaded.ahc.org.asynchttpclient.maxConnectionsPerHost=-1
play.shaded.ahc.org.asynchttpclient.connectTimeout=5000
play.shaded.ahc.org.asynchttpclient.pooledConnectionIdleTimeout=60000
play.shaded.ahc.org.asynchttpclient.connectionPoolCleanerPeriod=1000
play.shaded.ahc.org.asynchttpclient.readTimeout=60000
play.shaded.ahc.org.asynchttpclient.requestTimeout=60000
play.shaded.ahc.org.asynchttpclient.connectionTtl=-1
play.shaded.ahc.org.asynchttpclient.followRedirect=false
# Get Root
sudo su
# Download NMON archive
cd /tmp
wget http://sourceforge.net/projects/nmon/files/nmon16e_mpginc.tar.gz
# Untar archive
tar -xzvf nmon16e_mpginc.tar.gz
#!/usr/bin/env bash
#
# This will ensure that groovy is available, otherwise it will be downloaded with sdkman.
#
if [[ -v JAVA_HOME ]];
then
echo "Will use groovy from $GROOVY_HOME";
else
echo "Will download groovy ...";
import javax.imageio.ImageIO
import org.imgscalr.Scalr
@Grapes(
@Grab(group = 'org.imgscalr', module = 'imgscalr-lib', version = '4.2')
)
def printArt(String url, Integer maxSize) {
def asciiChars = ["#", "A", "@", "%", "\$", "+", "=", "*", ":", ",", ".", " "]
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@ldaume
ldaume / Jenkins_system_groovy_script-sbt_deploy.groovy
Last active January 18, 2017 20:15
Downloads a sbt universal packaged zip file of the latest github release, uploads it to multiple hosts and adds a symlink in the deploy directory.
import groovyx.net.http.*
import groovyx.net.http.ContentType.*
import groovyx.net.http.Method.*
import static com.aestasit.infrastructure.ssh.DefaultSsh.*
import com.aestasit.infrastructure.ssh.SshOptions
import com.aestasit.infrastructure.ssh.log.SysOutLogger
import hudson.model.*
import com.aestasit.infrastructure.ssh.dsl.SshDslEngine
import org.apache.commons.lang3.StringUtils