Skip to content

Instantly share code, notes, and snippets.

View jungin500's full-sized avatar

LimeOrangePie jungin500

View GitHub Profile
@jungin500
jungin500 / build.sh
Created March 19, 2022 05:44
Raspberry Pi 4B 64bit (aarch64) CXX_FLAGS
# OS: Ubuntu Server 20.04 aarch64 on Raspberry Pi 4B (4GB)
# Standard command
g++ -o benchmark main.cpp fun_neon.cpp fun.cpp
# Scalar: 131.32 msec, 0.00 Mcycles
# NEON: 72.39 msec, 0.00 Mcycles
# Extended with march and mtune as shown here:
# https://gist.github.com/fm4dd/c663217935dc17f0fc73c9c81b0aa845
g++ -o benchmark main.cpp fun_neon.cpp fun.cpp -mtune=cortex-a72 -mcpu=cortex-a72
@jungin500
jungin500 / synology-disable-hdd-swap.sh
Created March 16, 2022 13:22
Disable HDD physical swap device (environment where zram is on, and reliable amount of RAM)
if [ ! -z "$(swapon | grep /dev/md)" ]; then swapoff $(swapon | grep /dev/md | awk '{ print $1 }'); fi
@jungin500
jungin500 / remote-remove-image.sh
Created March 15, 2022 08:42
Remove remote image from private docker container registry (set PRIVATE_REGISTRY_HOST to use)
#!/bin/bash
ARGS=$1
PRIVATE_REGISTRY_HOST="https://<some-registry-url-here>:<port><without-tailing-slash>"
IMAGE=$(echo $ARGS | awk -F\: '{ print $1 }')
TAG=$(echo $ARGS | awk -F\: '{ print $2 }')
TOP_REPOSITORY=$(echo $IMAGE | awk -F\/ '{ print $1 }')
if [ -z "$TAG" ]; then
TAG="latest"
@jungin500
jungin500 / sunzip
Last active February 3, 2022 04:46
Smart Unzip - handy linux unzip helper script for mixed multiple zip files including root and rootless archives
#!/bin/bash
ARG=$@
TOP_FILE_SIZE=$(unzip -l $@ | head -n 4 | tail -n 1 | awk '{ print $1 }')
if [ "$TOP_FILE_SIZE" -eq "0" ]; then
echo "Top folder exists"
unzip "$ARG" -d .
else
echo "Top folder not exists"
FILENAME=$(echo $ARG | rev | cut -f 2- -d '.' | cut -f -1 -d '/' | rev)
@jungin500
jungin500 / inspect-voc-dataset-classes.py
Created November 23, 2021 07:17
Inspect VOC-type Dataset Annotations (Class List)
from argparse import ArgumentParser
import sys
import glob
import os
import xml.etree.ElementTree as ET
from functools import reduce
def parse_annotation(xml_filename):
objects = []
@jungin500
jungin500 / fix-link-structure.py
Created September 7, 2021 01:56
Fix base system image's link structure
@jungin500
jungin500 / tapupdown.sh
Created June 22, 2021 02:31
tapupdown - OpenVPN up/down script for TAP device with Ubuntu 20.04 afterwards
#
# tap-up.sh
#
#!/bin/bash
# TAP after-up script for OpenVPN TAP connection
# LimeOrangePie, 2021/06/15
TAP=$1
PERM_ADDR=02:c1:93:29:f1:5d # it's randomly generated TAP device MAC!
@jungin500
jungin500 / rc.local
Created May 20, 2021 01:44
Raspberry Pi 4 Raspbian OS rc.local which initializes wwan0 (LTE Radio) and acquires internet connection
#!/bin/bash
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
@jungin500
jungin500 / recommended-transcoding.sh
Last active January 9, 2025 23:49
FFmpeg recommended GPU transcoding command sets
let $__cP = nowPageNum;
function $__gNp() {
if ($__cP <= totalPageNum) {
opener.PageMove2019AfterVersion($__cP);
console.log(`${$__cP} 페이지를 수강완료했습니다.`);
$__cP += 1;
setTimeout(() => $__gNp(), 1000);
} else {
alert('강의 수강이 완료되었습니다!');
}