This file contains hidden or 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
""" | |
Rockchip RK3308 NVMEM Parser | |
This module parses NVMEM data according to RK3308 Device Tree Specification. | |
Key memory regions: | |
- CPU ID: offset 0x07, length 0x10 (16 bytes) | |
- CPU leakage: offset 0x17 (1 byte) | |
- Logic leakage: offset 0x18 (1 byte) | |
ref: https://github.com/u-boot/u-boot/blob/15d6518c942f0da13f9a7ceeadbd925c3317ec8d/arch/arm/mach-rockchip/board.c#L396C5-L396C23 |
This file contains hidden or 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
#!/usr/bin/env bash | |
# This script is used to deploy the application files to a remote device. | |
# It can be used to deploy the application to a device with a public IP address | |
# or a device in a local network. The script will connect to the device using SSH | |
# and copy the files to the target directory. It will also restart the service | |
# on the remote device to apply the changes. | |
# The script can be used to deploy the application to a Raspberry Pi, BeagleBone, NaPi | |
# or any other device that runs a Linux distribution with SSH support. | |
# Great for deploying applications to IoT devices or single-board computers. |
This file contains hidden or 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
--- | |
services: | |
phpbb: | |
build: . | |
container_name: phpbb | |
restart: unless-stopped | |
ports: | |
- "8080:80" | |
volumes: | |
- phpbb-data:/var/www/html |
This file contains hidden or 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
import psutil | |
def bytes2human(n): | |
# http://code.activestate.com/recipes/578019 | |
# >>> bytes2human(10000) | |
# '9.8K' | |
# >>> bytes2human(100001221) | |
# '95.4M' | |
symbols = ('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y') | |
prefix = {} |
This file contains hidden or 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
# Influxdb init | |
# docker-compose up influxdb_cli | |
# Ctrl + c after init db | |
# and run | |
# docker-compose up -d | |
version: "3" | |
services: |
This file contains hidden or 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 | |
if [ $# -lt 2 ]; then | |
echo "Usage: $0 <serial_number> <duration_in_seconds> <note>" | |
echo "note: optional parameter" | |
echo "Example: $0 SN0001 10 \"Test 1\"" | |
exit 1 | |
fi | |
serialnumber="$1" |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>RCW Hex to Binary Converter</title> | |
<style> | |
table { | |
border-collapse: collapse; | |
width: 100%; | |
} |
This file contains hidden or 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 | |
PREFIX_ETH=${1:-"eth"} | |
ncpus=$(grep -ciw ^processor /proc/cpuinfo) | |
test "$ncpus" -gt 1 || exit 1 | |
n=0 | |
for irq in $(cat /proc/interrupts | grep "$PREFIX_ETH" | awk '{print $1}' | tr -d ":") | |
do | |
f="/proc/irq/$irq/smp_affinity" |
This file contains hidden or 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
#!/usr/bin/env bash | |
help() { | |
echo | |
echo "Usage: $0 -i [network-interface]* -t [seconds] -q (show softirq)" | |
echo "Example: $0 -i eth0* -t 1 -q" | |
echo | |
echo "*required option" | |
echo | |
echo "interfaces on this host: $(ls /sys/class/net/ | awk '{printf "%s,",$1}')" |
This file contains hidden or 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
# CPU | |
time dd if=/dev/zero bs=1MB count=200 | sha512sum | |
# disk write | |
time dd if=/dev/zero of=test.img oflag=direct bs=128k count=1k conv=fdatasync | |
# disk read | |
echo 3 | sudo tee /proc/sys/vm/drop_caches | |
time dd if=test.img of=/dev/null bs=128k conv=fdatasync |
NewerOlder