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 <cstring> | |
#include <cstdio> | |
void dump_bytes(const unsigned char * data, int len, char *outBuf) { | |
sprintf(outBuf, "%d bytes:\n", len); | |
char * tmp=outBuf + strlen(outBuf); | |
for (int j=0; j<len; j++) { | |
if (j % 16 == 0) { | |
sprintf(tmp, "%04X:", j); | |
tmp+=5; |
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 SCOPEEXEC_H_ | |
#define SCOPEEXEC_H_ | |
#include <type_traits> | |
template <typename OnCreate, typename OnExit, class Enable = void> | |
class ScopeExec { | |
using OnCreateResultType = typename std::result_of_t<OnCreate(void)>; | |
public: | |
explicit ScopeExec(OnCreate onCreate, OnExit onExit) |
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 | |
BINARY=$1 | |
VER=$2 | |
echo "Find ${BINARY} package with version ${VER}" | |
RPM_VER=`yum -v list ${BINARY} --show-duplicates | grep ${VER} | grep -oP "${VER}-\w{40}"` | |
echo "Founded: ${RPM_VER}" | |
echo "Downloading rpm ${BINARY} with version ${VER}" |
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
from time import sleep | |
import requests | |
import os.path | |
import sys | |
import pprint | |
import svn.local | |
import svn.remote |
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 | |
# ------------------------------------------------------------ | |
# Reconfiguare all *.deb installed packages | |
# Run dpkg-reconfigure for all dpkg -l | |
# | |
# USAGE insert next to terminal or run as sh script | |
# | |
# Be careful reconfiguration can broke your system | |
# ------------------------------------------------------------ |
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 <cmath> | |
#define INITIAL_WINDOW_MS 500 | |
#define NONINITIAL_WINDOWS_MS 150 | |
#define UNCERTAINTY_SCALE 10.0f | |
#define UNCERTAINTY_SYMMETRY_CAP 0.0f | |
#define ESTIMATE_FLOOR_KBPS 0.0f | |
class BitrateEstimator { | |
public: |
OlderNewer