Skip to content

Instantly share code, notes, and snippets.

@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;
try {
$soap = new SoapClient("https://www.ovh.com/soapi/soapi-re-1.26.wsdl");
//login
$session = $soap->login("xxxxxx-ovh", "******","fr", false);
echo "login successfull\n";
//zoneEntryAddCustom
$soap->zoneEntryAddCustom($session, "hostyourcreeper.net", "SRV", "CUSTOM", "", "_minecraft._tcp.server010.hyc002", "", "10 10 25510 server010.hyc002.hostyourcreeper.net.", "");
echo "zoneEntryAddCustom successfull\n";
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'root',
password : '',
database : 'watchat',
});
connection.connect();
@MiLk
MiLk / kern.log
Created September 23, 2012 16:25
HDD défectueux
Sep 23 17:27:28 ns399716 kernel: [9838582.220381] ata2.00: exception Emask 0x0 SAct 0xf SErr 0x0 action 0x0
Sep 23 17:27:28 ns399716 kernel: [9838582.220421] ata2.00: irq_stat 0x40000008
Sep 23 17:27:28 ns399716 kernel: [9838582.220451] ata2.00: failed command: READ FPDMA QUEUED
Sep 23 17:27:28 ns399716 kernel: [9838582.220486] ata2.00: cmd 60/00:00:80:9a:4d/01:00:22:00:00/40 tag 0 ncq 131072 in
Sep 23 17:27:28 ns399716 kernel: [9838582.220488] res 41/40:00:98:9a:4d/00:01:22:00:00/00 Emask 0x409 (media error) <F>
Sep 23 17:27:28 ns399716 kernel: [9838582.220590] ata2.00: status: { DRDY ERR }
Sep 23 17:27:28 ns399716 kernel: [9838582.220618] ata2.00: error: { UNC }
Sep 23 17:27:28 ns399716 kernel: [9838582.343844] ata2.00: configured for UDMA/133
Sep 23 17:27:28 ns399716 kernel: [9838582.343872] ata2: EH complete
Sep 23 17:27:31 ns399716 kernel: [9838585.807839] ata2.00: exception Emask 0x0 SAct 0xc SErr 0x0 action 0x0
cd /etc/xen
xm create nginx.cfg
for i in vm*.cfg; do xm create $i; done
/opt/firewall/firewall.sh restart
@MiLk
MiLk / server.js
Created August 2, 2012 07:35
Authentification par cookie avec Express.js 3 & socket.io
var express = require('express')
, app = express.createServer()
, cookie = require('cookie')
, io = require('socket.io')
, _ = require('underscore')._
, redis = require('redis')
, dbmysql = require('db-mysql')
, mysql = new dbmysql.Database({
hostname: '',
port: 3306,