Skip to content

Instantly share code, notes, and snippets.

View ker2x's full-sized avatar

Laurent Laborde ker2x

  • Toulouse, France
  • 23:04 (UTC +02:00)
View GitHub Profile
@JUSTINMKAUFMAN
JUSTINMKAUFMAN / XCFramework.kts
Created November 3, 2021 18:53
Kotlin Multiplatform Build Gradle Task for iOS/macOS Universal Framework
/**
* Kotlin Multiplatform Universal XCFramework Task
*
* Description:
* If your project needs to target *all* possible
* iOS and macOS variants (including Apple Silicon
* hardware, ARM64 iPhone simulators, and so on),
* this task will build the frameworks, lipo those
* that can be combined into a single binary, and
* place them where Xcode expects to find them in
@fabianmu
fabianmu / gist:3467a28e274f03fd9dfe20b2a6f7feca
Last active November 29, 2020 06:59
Virtualbox 5.2 on scaleway
# this is a copay/paste combination of https://gist.github.com/nictuku/13afc808571e742d3b1aaa0310ee8a8d & https://gist.github.com/Rahul91/f051a391fac62ccebb581370b0ac644d
# so that we can install virtualbox via apt-get
for x in xenial xenial-security xenial-updates; do
egrep -qe "deb-src.* $x " /etc/apt/sources.list || echo "deb-src http://archive.ubuntu.com/ubuntu ${x} main universe" | sudo tee -a /etc/apt/sources.list
done
echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" | sudo tee -a /etc/apt/sources.list.d/virtualbox.list
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
# allow us to make a kernel
@octplane
octplane / build.sbt
Created February 7, 2013 12:28
Ruby syntax validity checker (JRuby) Javascript syntax validity checker. (Rhino)
libraryDependencies += "org.jruby" % "jruby" % "1.7.2"
libraryDependencies += "org.mozilla" % "rhino" % "1.7R4"
@deverton
deverton / logstash-template.json
Created June 22, 2012 04:49
Logstash Elasticsearch Template
{
"template": "logstash-*",
"settings" : {
"number_of_shards" : 1,
"number_of_replicas" : 0,
"index" : {
"query" : { "default_field" : "@message" },
"store" : { "compress" : { "stored" : true, "tv": true } }
}
},
@nherment
nherment / backup.sh
Created February 29, 2012 10:42
Backup and restore an Elastic search index (shamelessly copied from http://tech.superhappykittymeow.com/?p=296)
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
@bartlomiejdanek
bartlomiejdanek / god
Created February 1, 2012 14:54
/etc/init.d/god
#!/bin/sh
### BEGIN INIT INFO
# Provides: god
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: God
blank_object = {
:parent => nil,
:slots => {},
:size => 0
}
def send(receiver, message, *params, &block)
method_owner = receiver
while(method_owner[:slots][:lookup].nil?)
puts "ERR: lookup failed for ':lookup' on object:\n#{receiver.inspect}" and break if(method_owner[:parent].nil?)