Skip to content

Instantly share code, notes, and snippets.

View jungin500's full-sized avatar

LimeOrangePie jungin500

View GitHub Profile
@jungin500
jungin500 / I'm a night 🦉
Last active September 22, 2023 00:10
Productivity Metrics!
🌞 Morning 46 commits ███▎░░░░░░░░░░░░░░░░░ 16.0%
🌆 Daytime 96 commits ██████▉░░░░░░░░░░░░░░ 33.3%
🌃 Evening 98 commits ███████▏░░░░░░░░░░░░░ 34.0%
🌙 Night 48 commits ███▍░░░░░░░░░░░░░░░░░ 16.7%
@jungin500
jungin500 / disable-xbox-acc-dongle-linux.rules
Last active July 2, 2023 14:01
udev rules to disable XBOX ACC (Windows Xbox Wireless Dongle) on Linux, Udev rules. Tested on Ubuntu 22.04.
# Disable XBOX ACC, Microsoft Inc., XYZXYZ
# -- Run following after saving this file as: /etc/udev/rules.d/00-block-xbox-usb.rules
# -- $ sudo udevadm trigger && sudo systemctl restart udev
# -- Also, run following to persist for next reboot.
# -- $ sudo update-initramfs -u -k all
ACTION=="add", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02fe", RUN="/bin/sh -c '[ -f /sys$devpath/authorized ] && echo 0 >/sys$devpath/authorized || true'"
@jungin500
jungin500 / install_docker_in_colab.sh
Created June 25, 2023 13:50 — forked from mwufi/install_docker_in_colab.sh
Install Docker in Google Colab!
# First let's update all the packages to the latest ones with the following command
sudo apt update -qq
# Now we want to install some prerequisite packages which will let us use HTTPS over apt
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq
# After that we will add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# We will add the Docker repository to our APT sources
@jungin500
jungin500 / Dockerfile
Last active June 25, 2023 10:51
Dockerfile of `gcr.io/kubeflow-ci/pytorch-dist-mnist_test:1.0` generated with `dfimage`
RUN set -xe \
&& echo '#!/bin/sh' > /usr/sbin/policy-rc.d \
&& echo 'exit 101' >> /usr/sbin/policy-rc.d \
&& chmod +x /usr/sbin/policy-rc.d \
&& dpkg-divert --local --rename --add /sbin/initctl \
&& cp -a /usr/sbin/policy-rc.d /sbin/initctl \
&& sed -i 's/^exit.*/exit 0/' /sbin/initctl \
&& echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup \
&& echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean \
&& echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean \
@jungin500
jungin500 / control_command_switch.json
Last active April 13, 2023 04:01
[Karabiner][V13] left_shift twice to toggle between Control <=> Command - https://dailylime.kr/898/
{
"title": "[V13] left_shift twice to toggle between Control <=> Command",
"rules": [
{
"description": "Press left_shift twice to toggle between Control and Command key. Another key pressed during each left_shift press will be considered as a cancel, and timeout will also considered as cancel.",
"manipulators": [
{
"conditions": [
{
"type": "variable_if",
@jungin500
jungin500 / install-ncnn.sh
Last active April 10, 2023 08:58
[macOS] Installing older version of NCNN (20210720) on Ventura
#!/bin/bash
# Install NCNN with OpenMP, OpenCV, Vulkan
# Reference: https://github.com/actions/runner-images/issues/5555#issuecomment-1133906879
## Install homebrew requirements
brew install libomp protobuf
## OpenCV 3.x is recommended for examples installation
brew install opencv@3
export PATH="/opt/homebrew/opt/opencv@3/bin:$PATH"
@jungin500
jungin500 / weave-daemonset-k8s.yaml
Created February 19, 2023 09:42
Kubernetes Weave Net 2.8.1 (arm64 architecture issue fix)
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: ServiceAccount
metadata:
name: weave-net
labels:
name: weave-net
namespace: kube-system
#!/bin/bash
MB_SCALE=1024
GPU_NAME=$(nvidia-smi --query-gpu=name --format=csv,noheader | head -n 1)
GPU_COUNT=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l)
VRAM_MB=$(nvidia-smi -q -i 0 | grep Total | head -n 1 | awk '{ print $3 }')
VRAM_GB=$((VRAM_MB / MB_SCALE))
if [ -z "$VRAM_MB" ]; then
>&2 echo "Graphics cards not detected by nvidia-smi!"
@jungin500
jungin500 / build.sh
Created March 19, 2022 05:54
Raspberry Pi 3B 32bit (armv7l) CXX_FLAGS
# OS: Raspbian Buster(10) armv7l on Raspberry Pi 3B (1GB)
# Standard command (-mfpu=neon-fp-armv8 pr -mfpu=neon-vfpv4 is necessary for build!)
g++ -o benchmark main.cpp fun_neon.cpp fun.cpp -mfpu=neon-vfpv4
# Scalar: 360.64 msec, 0.00 Mcycles
# NEON: 171.59 msec, 0.00 Mcycles
# Standard command with "-mfloat-abi=hard"
g++ -o benchmark main.cpp fun_neon.cpp fun.cpp -mfpu=neon-vfpv4 -mfloat-abi=hard
# Scalar: 362.39 msec, 0.00 Mcycles
@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