This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Where to store passwords | |
DATAFILE="./pwmgr_data.gpg" | |
# Your GPG key | |
RECIPIENT="xa@xomg.net" | |
# Command used to generate passwords | |
# (pwgen is nice) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Completer: | |
def __init__(self, commands): | |
self.commands = commands | |
self.completed = None | |
for name, c in self.commands.items(): | |
c._comp_positionals = len([a for a in c.parser._actions | |
if not a.option_strings]) | |
def complete_cmd(self, command_name, argv): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function perf_ping(host, callback, start) { | |
if (start == undefined) { | |
var perfEntries = performance.getEntries(); | |
// use the last perf entry to ignore any request preceding | |
// this ping() call | |
start = 0; | |
for (var i = 0; i < perfEntries.length; i++) { | |
if (start < perfEntries[i].startTime) { | |
start = perfEntries[i].startTime; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <X11/Xlib.h> | |
#include <X11/keysym.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
const char* text = "le avoir savoir nuit leur ton je avant qui pays te se homme chez entrer tout leur encore heure regard " | |
"jour elle ne au savoir entrer appeler ton revenir fille pied enfant contre ame chambre " | |
"toujours ce parler coup ne rendre noir pied donc quelque sans peu ciel vie ici mille tres " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# OpenVPN plugin for Nagios | |
from optparse import OptionParser | |
import socket | |
from datetime import datetime | |
def main(): | |
senddata= "\x38\x01\x00\x00\x00\x00\x00\x00\x00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Opcodes { | |
OP_PING = 0x1337 | |
} | |
class Packet { | |
public: | |
Packet(int32_t opcode); | |
virtual bool encode(std::string& buffer) = 0; | |
virtual bool decode(const std::string& buffer) = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef COMMON_SINGLETON_H | |
#define COMMON_SINGLETON_H | |
#include <cstdlib> | |
template<typename T> | |
class Singleton { | |
public: | |
Singleton() { | |
m_Instance = static_cast<T*>(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef COMMON_SINGLETON_H | |
#define COMMON_SINGLETON_H | |
#include <memory> | |
template<typename T> | |
class Singleton { | |
public: | |
static inline std::shared_ptr<T> GetInstancePtr() { | |
static std::shared_ptr<T> instance = new T(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Mere { | |
static const int Opcode; | |
}; | |
const int Mere::Opcode = 42; | |
struct Fille : public Mere { | |
static const int Opcode; | |
// wuut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "net/network.h" | |
using namespace Ponyca; | |
class TestType : public Net::AbstractSerializable { | |
public: | |
virtual std::string serialize() const { | |
std::string buffer; |