Skip to content

Instantly share code, notes, and snippets.

Avatar

Slava bacher09

  • Ukraine
View GitHub Profile
@bacher09
bacher09 / CMakeLists.txt
Last active May 14, 2020
cmake for CO-RE
View CMakeLists.txt
cmake_minimum_required(VERSION 3.6)
project(CORE)
find_program(BASH bash HINTS /bin)
find_package(ZLIB)
if(NOT DEFINED BPFTOOL_PATH)
set(BPFTOOL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin/bpftool")
endif()
@bacher09
bacher09 / echo_server.erl
Last active Apr 7, 2020
Python live update
View echo_server.erl
-module(echo_server).
-export([start/0, loop/2]).
-define(LISTEN_PORT, 1234).
start() ->
listen().
listen() ->
{ok, LSock} = gen_tcp:listen(?LISTEN_PORT, [binary, {active, false},
{reuseaddr, true}]),
View output.txt
$ ./test
1.0
0.1000
0.112
0.112
2652 49490604
View router_latency.py
#!/usr/bin/env python3
import argparse
import time
import logging
import psutil
FILENAME_FORMAT = "/sys/devices/system/cpu/cpu{0:d}/power/pm_qos_resume_latency_us"
logger = logging.getLogger(__name__)
View text_detection.py
import cv2
import numpy as np
import argparse
from collections import namedtuple
import time
def draw_rotated_rect(image, rect, color=(0, 255, 0), thickness=1):
vertices = np.round(rect.points()).astype(int)
View sd_watchdog.py
#!/usr/bin/env python3
import os
import sys
import time
import fcntl
import socket
import signal
import argparse
import subprocess
import struct
@bacher09
bacher09 / xorg.conf
Created Dec 9, 2016
amazon g2 xorg.conf
View xorg.conf
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11/misc"
View shadow_hash.py
#!/usr/bin/env python3
import getpass
import crypt
import argparse
import sys
METHODS_DICT = dict((meth.name.lower(), meth) for meth in crypt.methods)
View download_maps.sh
#!/bin/sh
wget --base=http://dl.xonotic.co/ -i maps.txt
View Tree.hs
module Main where
import Control.Monad (forM_, mapM_)
import Control.Applicative ((<$>))
import Data.Bifunctor (bimap, first, second)
import Data.Array.MArray (newArray, writeArray)
import Data.Array.ST (runSTArray)
import Data.Array (Array, bounds, (!))
import Text.Read (readMaybe)
You can’t perform that action at this time.