This file contains hidden or 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 | |
set -e | |
# Run as root | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi |
This file contains hidden or 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
# | |
# python3 main.py startingStack=4 maxStack=9 strat=one winningAmount=300 maxRuns=10000 | |
# | |
import sys | |
import random | |
import time | |
debug = False |
This file contains hidden or 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
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLvcICeFH79XX9op7kFxW74HK4TLHuAarbazmwEtzFUZAc52qI6N5OntoNRxMoPF4W/LphWQKYS9lOMnHcjUjnrMAq6MCc5xn2BRfHRuLjCFAfin5DSrA9IG9xxV5Fiuf6dQEFtPq3JjiDe20ZRUl/yGmy/yoJE2QfeZhJ2NBiSkeoQU4b3JlX2vtu1PkK7+TZEE2Z+7hMgzyjy/5pcdBCUo3X48Dae2GY5s+dgSSmzrCHlTN4/H2Y9sBlOLWUE2scVcC8dOyI/2m0snX8C/M7vgZGu23KQ+Z6NYxXOIB6KYh5fQShH+v9wZeHBSKIX6jXHwQ86p3JZSA436Ghbt1f root@srv1 |
This file contains hidden or 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
var phaseSetting = new int[] { 0, 1, 2, 3, 4 }; | |
var maxThrusters = UInt64.MinValue; | |
do { | |
var vms = phaseSetting | |
.Select(x => new Intcode((int[])memory.Clone(), x.ToString())) | |
.ToArray(); | |
var signal = "0"; | |
while (!vms.Last().HasFinished) { |
This file contains hidden or 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
std::string run(std::string input) override | |
{ | |
using namespace ranges; | |
auto const not_empty = [](auto&& l) { return !l.empty(); }; | |
auto const to_integer = [](auto&& l) { return std::stoi(l); }; | |
auto const calc_fuel = [](auto&& mass) { | |
auto fuel = mass / 3 - 2; | |
auto fuelMass = fuel; |
This file contains hidden or 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
/// | |
/// directoryTableBase is the CR3 register value for the target process (the process that owns virtualAddress) | |
/// virtualAddress is the address to translate | |
/// | |
std::uint64_t driver::translate_linear_address(std::uint64_t directoryTableBase, LPVOID virtualAddress) | |
{ | |
auto va = (std::uint64_t)virtualAddress; | |
auto PML4 = (USHORT)((va >> 39) & 0x1FF); //<! PML4 Entry Index | |
auto DirectoryPtr = (USHORT)((va >> 30) & 0x1FF); //<! Page-Directory-Pointer Table Index |
This file contains hidden or 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
Warning: include-what-you-use reported diagnostics: | |
/home/markhc/Coding/tenshi/include/tenshi/client.hpp should add these lines: | |
#include <stdint.h> // for uint32_t | |
#include <boost/asio/detail/socket_types.hpp> // for asio | |
#include <boost/asio/impl/io_context.ipp> // for io_context::~io_context | |
#include <boost/asio/io_context.hpp> // for io_context | |
#include <boost/asio/ssl/context.hpp> // for context | |
#include <boost/asio/ssl/context_base.hpp> // for context_base::sslv23_c... | |
#include <boost/asio/ssl/impl/context.ipp> // for context::~context, con... |
This file contains hidden or 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 "tenshi/gateway.hpp" | |
#include <fmt/format.h> | |
#include <spdlog/spdlog.h> | |
#include <boost/beast/core/buffers_to_string.hpp> | |
#include <boost/bind.hpp> | |
#include <nlohmann/json.hpp> | |
namespace tenshi | |
{ | |
using namespace std::literals; |
This file contains hidden or 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
void fail(beast::error_code ec, char const* what) | |
{ | |
// TODO: Better error logging | |
std::cerr << what << ": " << ec.message() << "\n"; | |
} | |
// ------------------------------------------------------------------------------------------------- | |
Gateway::Gateway(net::io_context& ioc, ssl::context& ctx) | |
: ws_(net::make_strand(ioc), ctx), | |
resolver_(net::make_strand(ioc)), | |
host_("gateway.discord.gg"s), |
This file contains hidden or 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
std::string Board::prettyPrint(bool useUnicodeChars) const | |
{ | |
std::string_view charPieces[2][6] = { | |
{ | |
useUnicodeChars ? "\u2659" : "P", | |
useUnicodeChars ? "\u2657" : "B", | |
useUnicodeChars ? "\u2658" : "N", | |
useUnicodeChars ? "\u2656" : "R", | |
useUnicodeChars ? "\u2655" : "Q", | |
useUnicodeChars ? "\u2654" : "K", |
NewerOlder