Skip to content

Instantly share code, notes, and snippets.

@MiLk
MiLk / keybase.md
Created March 29, 2019 07:16
keybase.md

Keybase proof

I hereby claim:

  • I am MiLk on github.
  • I am emilienmilk (https://keybase.io/emilienmilk) on keybase.
  • I have a public key whose fingerprint is 1075 DEB6 61F4 4164 6468 7EA2 895F 7245 BEED D2EC

To claim this, I am signing this object:

@MiLk
MiLk / config.yml
Last active March 28, 2017 07:34
Vault HA init
- name: "Waiting for the Vault to be unsealed"
uri:
url: '{{ vault_api_url }}/v1/sys/seal-status'
return_content: yes
register: vault_seal_status
until: vault_seal_status.json.sealed == false
retries: 90
delay: 10
changed_when: false
@MiLk
MiLk / keybase.md
Created October 21, 2016 06:29
keybase.md

Keybase proof

I hereby claim:

  • I am MiLk on github.
  • I am emilienmilk (https://keybase.io/emilienmilk) on keybase.
  • I have a public key whose fingerprint is A7A9 FA44 1041 6309 8C99 42BF F473 715C 7AAC 4B0B

To claim this, I am signing this object:

@MiLk
MiLk / nagios-qh.js
Created January 22, 2014 12:39
Use Nagios query handler with Node.js
var net = require('net');
var test_message = "TestMessage";
var client = net.connect({ path: '/var/nagios/rw/nagios.qh' }, function() {
client.write('@echo ' + test_message + '\0');
});
client.on('data', function(data) {
console.log(data.toString());
client.end();
@MiLk
MiLk / etc_init.d_nagios
Created January 11, 2014 11:06
Nagios init script
start() {
test -x $exec || exit 5
test -f $config || exit 6
if test "$checkconfig" = "true"; then
check_config
fi
options="-d"
if test "$use_precached_objects" = "true"; then
options="$options -u"
fi
@MiLk
MiLk / mainwindow.cpp
Created August 29, 2013 06:32
OpenGL w/ Qt5
#include "mainwindow.h"
#include <QtGui/QMatrix4x4>
#include <QtGui/QOpenGLShaderProgram>
#include <QtGui/QScreen>
#include <QGLContext>
MainWindow::MainWindow() :
m_program(0)
, m_frame(0)
@MiLk
MiLk / kikimeter.sh
Created July 26, 2013 14:07
uptime kikimeter
echo $(uptime | perl -ne "/(\d+) d/;print 8,q(=)x\$1,\"D\n\"")
@MiLk
MiLk / install.sh
Last active December 20, 2015 01:28
cd /usr/local/src
git clone https://github.com/pooler/cpuminer.git
cd cpuminer
apt-get install -y build-essential automake libcurl4-gnutls-dev
./autogen.sh
./configure CFLAGS="-O3"
make
@MiLk
MiLk / addComment.php
Last active December 15, 2015 22:19
# Fujicraft - XSS
<?php
// include/pages/addComment.php - line 19
$comment = htmlspecialchars($_POST['comment'], ENT_QUOTES, 'UTF-8', false);
@MiLk
MiLk / Minecraft.class.php
Created April 6, 2013 11:52
# include/class/Minecraft.class.php # FujiCraft CMS http://www.fujicraft.com/ Remove support of Minecraft protocol 1.4.7 Add support of Minecraft protocol 1.5.1
<?php
class Minecraft {
private $Socket, $Info;
public $Online, $version, $MOTD, $CurPlayers, $MaxPlayers, $IP, $Port, $Error;
public function __construct($IP, $Port = '25565') {
$this->IP = $IP;
$this->Port = $Port;