Skip to content

Instantly share code, notes, and snippets.

@hoxnox
hoxnox / hstimer.hpp
Created May 26, 2023 13:36
High speed timer
#pragma once
#include <ctime>
#include <cstdint>
#include <iostream>
#include <rte_cycles.h>
class HighSpeedTimer {
public:
std::uint64_t
#!/bin/bash
source .env
PROXY="${PROXY:-socks5://user:pass@host:port}"
COOKIE="${COOKIE:-uid=UID; pass=ENCPASS}"
BASEURL="http://dl.kinozal.tv/download.php"
TORRENTDIR="/media/data/transmission"
LOG="/var/log/torrent.log"
#include <sstream>
#include <iostream>
#include <variant>
#pragma once
class Error
{
public:
operator bool() const
#!/bin/sh
# CONFIGURATION
# 1. Go to @botfather and create a bot and use it's auth token as bot_token value
# 2. Create test channel, believe me, you need it
# 3. Set some url for your test channel
# 4. Add your bot to both channels, set their names in variables
# USAGE
# 1. Copy your markdown-formatted message into OS clipboard (Cmd+C)
@hoxnox
hoxnox / dpdk-static-link.md
Created November 2, 2021 21:03 — forked from krsna1729/dpdk-static-link.md
compile statically linked dpdk apps
#/bin/bash
optirun ffmpeg -i "$1" -vcodec h264_nvenc -profile:v 'baseline' -preset:v 'slow' -vf scale=out_color_matrix=bt709 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -pix_fmt yuv420p -b:v 14M -acodec aac -b:a 192k "$2"
@hoxnox
hoxnox / str2argv.h
Created November 3, 2018 06:43
string to argv/agrc for testing purposes (doesn't handle one quote correctly)
std::vector<char*>
str2argv(std::string& str)
{
std::vector<char*> rs;
bool was_space = true;
bool in_quotes = false;
for (size_t i = 0; i < str.length(); ++i)
{
if (std::isspace(str[i]) && !in_quotes)
{
import os
import json
import ycm_core
import sys
import re
import glob
import logging
_logger = logging.getLogger(__name__)
@hoxnox
hoxnox / SimpleLogger.hpp
Created October 24, 2015 18:43
Simple logger for C++ (prefix + suffix)
/**@author Merder Kim <hoxnox@gmail.com>
* @date 20151024 22:21:01
Usage:
SIMPLE_LOGGER_INIT
int main()
{
SIMPLE_LOGGER_SET_VERBOSE;
SIMPLE_LOGGER_SET_ALIGN;
ILOG << "Hello, world!" << std::endl
#!/bin/sh
# btsync service
# Replace with linux users you want to run BTSync clients for
BTSYNC_USERS="mendel"
DAEMON=/usr/bin/btsync
start() {
for btsuser in $BTSYNC_USERS; do
HOMEDIR=`getent passwd $btsuser | cut -d: -f6`
config=$HOMEDIR/.sync/config.json