Skip to content

Instantly share code, notes, and snippets.

#
# Automatically generated file; DO NOT EDIT.
# crosstool-NG Configuration
#
CT_CONFIGURE_has_static_link=y
CT_CONFIGURE_has_cxx11=y
CT_CONFIGURE_has_wget=y
CT_CONFIGURE_has_make_3_81_or_newer=y
CT_CONFIGURE_has_make_4_0_or_newer=y
CT_CONFIGURE_has_libtool_2_4_or_newer=y
@chertov
chertov / Cargo.toml
Last active May 1, 2020 15:08
Simple rust example
[package]
name = "hello_world"
version = "0.1.0"
edition = "2018"
[[bin]]
name = "hello_world"
path = "./main.rs"
[dependencies]
#!/bin/bash
set -e
IMAGE_NAME=ng_build
rm -f ${IMAGE_NAME}.sparseimage
rm -rf ./${IMAGE_NAME}
mkdir -p ${IMAGE_NAME}
# hdiutil makehybrid -o ${IMAGE_NAME}.iso ${IMAGE_NAME} -iso -joliet
@chertov
chertov / Dockerfile
Created April 30, 2020 21:02
LLVM cross-compile
FROM debian:buster
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y install \
build-essential cmake gawk libncurses-dev libc6-dev intltool python \
git subversion time unzip zlib1g-dev libssl-dev wget curl cpio bc \
gettext gettext-base liblocale-gettext-perl upx \
flex texinfo help2man libtool-bin byacc bison pkg-config libyaml-dev \
rsync software-properties-common lsb-release
RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
@chertov
chertov / openwrt.Dockerfile
Created April 29, 2020 21:38
build wrt 19
FROM debian:stretch
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y install \
build-essential cmake gawk libncurses-dev libc6-dev intltool python \
git subversion time unzip zlib1g-dev libssl-dev wget curl cpio bc \
gettext gettext-base liblocale-gettext-perl upx \
flex texinfo help2man libtool-bin byacc bison pkg-config libyaml-dev \
rsync
WORKDIR /src/
@chertov
chertov / apply_patch.sh
Last active April 28, 2020 09:45
hikernels
#/bin/sh
set -e
# https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.14.tar.xz
# https://mirrors.edge.kernel.org/pub/linux/kernel/v3.x/linux-3.0.8.tar.xz
# https://mirrors.edge.kernel.org/pub/linux/kernel/v3.x/linux-3.18.20.tar.xz
# https://mirrors.edge.kernel.org/pub/linux/kernel/v3.x/linux-3.4.35.tar.xz
KERNELS=./init_data/
if [ ! -d "$KERNELS" ]; then mkdir $KERNELS; fi
pub fn get_pins_hi3518EV200() -> Vec<Pin> {
vec![
Pin { gpio: true, port: 0, pin: 6, muxctl: 0x008, e: 0b0, desc: "muxctrl_reg02=008 000: GPIO0_6, 001: FLASH_TRIG, 010: SFC_EMMC_BOOT_MODE, 011: SPI1_CSN1, 100: VI_VS_BT1120"},
Pin { gpio: true, port: 0, pin: 5, muxctl: 0x004, e: 0b1, desc: "muxctrl_reg01=004 0: SENSOR_RSTN, 1: GPIO0_5"},
Pin { gpio: true, port: 0, pin: 7, muxctl: 0x00C, e: 0b0, desc: "muxctrl_reg03=00C 000: GPIO0_7, 001: SHUTTER_TRIG, 010: SFC_DEVICE_MODE, 100: VI_HS_BT1120"},
Pin { gpio: false, port: 2, pin: 0, muxctl: 0x010, e: 0b0, desc: "muxctrl_reg04=010 000: GPIO2_0, 001: RMII_CLK, 011: VO_CLK, 100: SDIO1_CCLK_OUT"},
Pin { gpio: false, port: 2, pin: 1, muxctl: 0x014, e: 0b0, desc: "muxctrl_reg05=014 000: GPIO2_1, 001: RMII_TX_EN, 011: VO_VS, 100: SDIO1_CARD_DETECT"},
Pin { gpio: false, port: 2, pin: 2, muxctl: 0x018, e: 0b0, desc: "muxctrl_reg06=018 000: GPIO2_2, 001: RMII_TXD0, 011: VO_DATA5, 100: SDIO1_CWPR"},
FROM ubuntu:eoan
ENV FORCE_UNSAFE_CONFIGURE 1
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -y install \
build-essential cmake gawk libncurses-dev libc6-dev intltool python \
git subversion time unzip zlib1g-dev libssl-dev wget curl cpio bc \
gettext gettext-base liblocale-gettext-perl upx \
flex texinfo help2man libtool-bin byacc bison pkg-config libyaml-dev \
rsync
@chertov
chertov / main.go
Created January 18, 2020 13:26
MJPEG to http jpeg server
package main
import (
"bufio"
"flag"
"log"
"net/http"
"strconv"
"strings"
"sync"
#!/bin/bash
set -e
path=dump.mkv
start=00:20:00 # hour:minute:second
length=00:10:00 # hour:minute:second
key_time=$(ffprobe \
-read_intervals ${start}%+#1 \
-select_streams v -skip_frame nokey -show_frames -show_entries frame=pkt_pts_time,pict_type -v quiet \