Skip to content

Instantly share code, notes, and snippets.

View carlbennett's full-sized avatar
💙
Fedora Linux

Carl Bennett carlbennett

💙
Fedora Linux
View GitHub Profile
@carlbennett
carlbennett / game.cpp
Created November 17, 2011 01:45
Make error
/*
Copyright (c) 2011, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
diff --git a/src/app.cpp b/src/app.cpp
index a6adf14..1c82aa3 100644
--- a/src/app.cpp
+++ b/src/app.cpp
@@ -38,6 +38,7 @@
#include <mineserver/network/protocol/notch/protocol.h>
#include <mineserver/network/server.h>
+#include <mineserver/watcher/keepalive.h>
#include <mineserver/watcher/login.h>
@carlbennett
carlbennett / login.h
Created November 18, 2011 05:36
Pointer problem most likely
namespace Mineserver
{
struct Watcher_Login
{
void operator()(Mineserver::Game::pointer_t game, Mineserver::Network_Client::pointer_t client, Mineserver::Network_Message::pointer_t message) const
{
std::cout << "Login watcher called!" << std::endl;
const Mineserver::Network_Message_Login* msg = (Mineserver::Network_Message_Login*)&message;
Mineserver::Game_Player::pointer_t player(new Mineserver::Game_Player);
@carlbennett
carlbennett / serialize_test.php
Created October 12, 2015 22:15
Tests serializing a class with custom serialize functions
#!/usr/bin/php
<?php
class Test implements Serializable {
public function __tostring() {
return "asdf";
}
public function serialize() {
@carlbennett
carlbennett / sshd_config
Created October 19, 2015 03:03
Customized SSH configuration
Port 22
AddressFamily any
ListenAddress 0.0.0.0
ListenAddress ::
Protocol 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
KeyRegenerationInterval 1h
ServerKeyBits 4096 # Legacy Protocol 1, meaningless on Protocol 2
SyslogFacility AUTHPRIV
#!/usr/bin/php
<?php
function closure_test(&$foobar) {
// Repeat for some arbitrary number of executions
$x = mt_rand(3, 10);
while ($x > 0) {
$foobar[] = $x;
--$x;
@carlbennett
carlbennett / newrelic.mod
Last active May 8, 2016 08:41
New Relic PHP Agent SELinux Policy
It's story time.
The Dallas sniper fire shootings that occurred on July 7, 2016 really had me on
the edge of my seat. I began watching the live broadcast around 8:30pm.
When I began watching, the shooting was still a very active situation. The news
reporter was crouched down behind a car with a couple of police officers. All
I could think at this time was when will the heavy armored vehicles arrive from
the police state.
@carlbennett
carlbennett / resolv.conf
Created July 26, 2016 19:21
A list of nameservers to use in case of emergency
; Google DNS:
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 2001:4860:4860::8888
nameserver 2001:4860:4860::8844
; OpenDNS:
nameserver 208.67.222.222
nameserver 208.67.222.220
nameserver 2620:0:ccc::2
nameserver 2620:0:ccd::2
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_syncookies = 1
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216