Skip to content

Instantly share code, notes, and snippets.

# If Debian 11 is ran on a LXC container (Proxmox), SSH login and sudo actions can be slow
# Check if in /var/log/auth.log the following messages
Failed to activate service 'org.freedesktop.login1': timed out (service_start_timeout=25000ms)
-> Run systemctl mask systemd-logind
-> Run pam-auth-update (and deselect Register user sessions in the systemd control group hierarchy)
@h3ndrk
h3ndrk / main.cpp
Created July 31, 2017 13:40
Example of the Poco Library
#include "Poco/Net/HTTPServer.h"
#include "Poco/Net/HTTPRequestHandler.h"
#include "Poco/Net/HTTPRequestHandlerFactory.h"
#include "Poco/Net/HTTPServerParams.h"
#include "Poco/Net/HTTPServerRequest.h"
#include "Poco/Net/HTTPServerResponse.h"
#include "Poco/Net/HTTPServerParams.h"
#include "Poco/Net/ServerSocket.h"
#include "Poco/Timestamp.h"
#include "Poco/DateTimeFormatter.h"
@urkle
urkle / joypad.cpp
Created September 25, 2013 15:21
SDL2 Joystick hot-plugging example
#define MAX_CONTROLLERS 4
class JoypadController {
public:
JoypadController() : m_is_connected(false), m_gamepad(0), m_instance_id(-1), m_haptic(0) {}
int JoypadController::processEvent(const SDL_Event& event);
private:
SDL_GameController *m_gamepad;
SDL_Haptic *m_haptic;
@krischer
krischer / cSDL.pyx
Created December 5, 2012 21:49
Cython definition file for SDL 2.x
cdef extern from "i386/types.h" nogil:
ctypedef signed char int8_t
ctypedef short int16_t
ctypedef int int32_t
ctypedef long long int64_t
cdef extern from "iconv.h" nogil:
ctypedef void *iconv_t
cdef extern from "stdlib.h" nogil:
@kizzx2
kizzx2 / fun.cpp
Created January 11, 2012 14:29
Illustrative C++ Lua binding example/tutorial
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>
@marianoguerra
marianoguerra / table2rst.py
Created August 10, 2011 16:14
csv table 2 rst
'''read a csv file representing a table and write a restructured text simple
table'''
import sys
import csv
def get_out(out=None):
'''
return a file like object from different kinds of values
None: returns stdout
string: returns open(path)