Skip to content

Instantly share code, notes, and snippets.

@mkrentovskiy
mkrentovskiy / Makefile
Created November 3, 2022 11:50 — forked from nfarring/Makefile
ebert: Ethernet Bit Error Rate Tester
CFLAGS=-std=gnu99 -O3
LDFLAGS=-lrt -lgmp
.PHONY: all
all: ebert
ebert: ebert.c time.o profile.o
time.o: time.c time.h
@mkrentovskiy
mkrentovskiy / b2f.erl
Created November 2, 2021 09:15 — forked from kevsmith/b2f.erl
Erlang/Elixir BEAM decompiler
#! /usr/bin/env escript
%% -*- mode: erlang -*-
%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ts=4 sw=4 ft=erlang et
%%
%% Copyright 2016 Operable, Inc. All Rights Reserved.
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
@mkrentovskiy
mkrentovskiy / pagespeed_optimize_images.sh
Created December 7, 2019 11:22 — forked from julianxhokaxhiu/pagespeed_optimize_images.sh
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -name "*.png" -o -name "*.PNG" -print0 | xargs -0 -I {} optipng -nb -nc "{}"
find . -type f -name "*.png" -o -name "*.PNG" -print0 | xargs -0 -I {} advpng -z4 "{}"
find . -type f -name "*.png" -o -name "*.PNG" -print0 | xargs -0 -I {} pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow "{}"
find . -type f -name "*.jpg" -o -name "*.JPG" -print0 | xargs -0 -I {} jpegoptim -f --strip-all "{}"
find . -type f -name "*.jpeg" -o -name "*.JPEG" -print0 | xargs -0 -I {} jpegoptim -f --strip-all "{}"
@mkrentovskiy
mkrentovskiy / Install LT4 21.1.md
Created January 8, 2016 18:29 — forked from jetsonhacks/Install LT4 21.1.md
Install LT4 21.1 on Jetson TK1

For best results, you should read through the official NVIDIA documentation found on:

https://developer.nvidia.com/linux-tegra-rel-21

In particular, the Quick Start Guide.

For this process you will need:

  • A host desktop or laptop computer running Ubuntu Linux 12.04 is officially recommended. In practice, this may be a virtual machine, I have used VirtualBox in the past. Also, I've successfully flashed from Ubuntu Linux 14.04. Your mileage may vary.
  • Micro USB cable provided with the Jetson TK1 kit
  • Jetson TK1 and power supply
%%%-------------------------------------------------------------------
%%% @author egobrain <egobrain@linux-ympb>
%%% @copyright (C) 2012, egobrain
%%% @doc
%%% Function for uploading files and properties,which were sent as a
%%% multipart. Files are stored in tmp_folder with random name,
%%% generated by tmp_filename function.
%%% @end
%%% Created : 25 Mar 2012 by egobrain <egobrain@linux-ympb>
%%%-------------------------------------------------------------------
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.
sudo apt-get install git-core bison flex g++ gettext texinfo libncurses5-dev pv libssl-dev lzop gawk
git clone git://github.com/virt2real/dm36x-buildroot.git
cd dm36x-buildroot
make virt2real_v1_mass_defconfig
make menuconfig
make
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
res := make([][]uint8, dx)
for x := range res {
res[x] = make([]uint8, dy)
for y := range res[x] {
@mkrentovskiy
mkrentovskiy / gist:1203371
Created September 8, 2011 13:20
6to2channel-resample.patch
Index: libavcodec/resample.c
===================================================================
--- libavcodec/resample.c (revision 11509)
+++ libavcodec/resample.c (working copy)
@@ -37,6 +37,17 @@
int input_channels, output_channels, filter_channels;
};
+/*
+*/
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1$ cd .hg
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg$ ls
00changelog.i dirstate last-message.txt requires store undo.branch undo.desc undo.dirstate
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg$ cd store
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg/store$ ls
00changelog.d 00changelog.i 00manifest.d 00manifest.i data dh fncache undo
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg/store$
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg/store$ cd data
mkrentovskiy@mkrentovskiy-Inspiron-1470:~/tmp/linux-3.0.1/.hg/store/data$ ls
~2egitignore.i block crypto firmware init _kconfig.i _m_a_i_n_t_a_i_n_e_r_s.i net samples sound virt