Skip to content

Instantly share code, notes, and snippets.

View jungin500's full-sized avatar

LimeOrangePie jungin500

View GitHub Profile
@jungin500
jungin500 / convert_utf8.sh
Last active August 28, 2019 05:21
Convert EUC-KR or another charset into UTF-8
#!/bin/bash
# Requirement: uchardet
iconv -f `uchardet $1` -t utf8 -o "$1.new" "$1"
echo "Converting `uchardet $1` into UTF-8."
if [ "$?" -eq 0 ]; then
mv -f "$1.new" "$1"
else
echo "Wrong format!!"
@jungin500
jungin500 / compile-ffmpeg-nvenc-docker.sh
Last active October 2, 2019 10:41
Building static Ffmpeg build with NVENC and VAAPI hardware-accelerated support on Docker
#!/bin/bash
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu.
#See the prefix path and compile options if edits are needed to suit your needs.
#install required things from apt
installLibs(){
echo "Installing prerequisites"
apt-get update
apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev libgpac-dev \
@jungin500
jungin500 / openvpn-reverse@.service
Created March 25, 2020 02:30
OpenVPN with SSH Reverse proxy for outer network accessing
[Unit]
Description=OpenVPN Reverse Service
[Service]
EnvironmentFile=/etc/openvpn-reverse/%I.conf
ExecStart=/usr/bin/autossh -N -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 30" -R 127.0.0.1:${TARGET_INTERNAL_PORT}:${TARGET_IP}:${TARGET_PORT} ${REMOTE_USER}@${REMOTE_IP}
[Install]
WantedBy=multi-user.target
let $__cP = nowPageNum;
function $__gNp() {
if ($__cP <= totalPageNum) {
opener.PageMove2019AfterVersion($__cP);
console.log(`${$__cP} 페이지를 수강완료했습니다.`);
$__cP += 1;
setTimeout(() => $__gNp(), 1000);
} else {
alert('강의 수강이 완료되었습니다!');
}
@jungin500
jungin500 / recommended-transcoding.sh
Last active April 16, 2021 08:33
FFmpeg recommended GPU transcoding command sets
@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 / 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 / fix-link-structure.py
Created September 7, 2021 01:56
Fix base system image's link structure
@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 / 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)