Skip to content

Instantly share code, notes, and snippets.

View Bak-Jin-Hyeong's full-sized avatar

Bak, Jin Hyeong Bak-Jin-Hyeong

View GitHub Profile
// ==UserScript==
// @name ASTx2 Emulator
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author @BawAppie
// @match https://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=ahnlab.com
// @grant none
// ==/UserScript==
@hugeblank
hugeblank / tiktok.sh
Last active December 31, 2023 23:09
Tiktok speech to text parser
#!/bin/zsh
# Tiktok speech to text parser
# by hugeblank, April 2022
# API endpoint & oneshot reading and playing discovered by @scanlime
# https://twitter.com/scanlime/status/1512288857596653568
# First argument - string of text to read
# Second argument - voice to use
# Usage examples:
@RulerOf
RulerOf / ec2-exec.sh
Created November 16, 2021 10:05
Synchronously run commands on an SSM-managed EC2 instance
#!/bin/bash
which jq > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
>&2 echo Error: this script requires jq; exit 1
fi
which aws > /dev/null 2>&1
if [ "$?" -ne 0 ]; then
>&2 echo Error: this script requires awscli; exit 1
@wickedev
wickedev / fzftail.sh
Last active October 24, 2021 15:02
fzf + tail + nl
#!/bin/bash
tail -n +0 $1 \
| nl -ba \
| fzf --multi \
--ansi \
--no-sort \
--reverse \
--tac \
--preview 'sed -n "$(({n}-4)),$(({n}+6))p" '$1' | nl -v $(({n}-4)) -ba' \
@leoh0
leoh0 / README.md
Last active September 15, 2022 00:43
containerd를 이용해서 standalone kubelet 사용하기

standalone-kubelet-with-containerd.md

가끔 kubernetes 같은건 너무 무거워서 단일 호스트에 docker만 띄워서 운영하는 경우같은걸 고민 하게 됩니다. 하지만 그냥 docker만 가지고 사용하면 컨테이너가 죽었을때 관리해 줘야 하는 불편함과 같이 기능을 보다 더 필요로 하게 됩니다. 그래서 이 방법을 소개해 드립니다.

이건 standalone kubelet 이라고 불리는 master 없이 node만 관리해주는 kubelet을 이용해서 container를 관리하는 방법입니다. 이건 k8s 초기 부터 원래 존재했던 컨셉이나 많이 알려져 있지 않아서 모르시는 분들이 많아서 이글을 작성해 봤습니다.

이 방법을 이용하면 실제 master 없이 kubelet 만으로 서비스를 할 수 있습니다. 컨테이너 자동 재시작, port forwarding, resource limit 등 기본적인 kubelet에서 제공하는 다양한 방법으로 컨테이너들을 관리 할 수 있습니다.

@vegard
vegard / kernel-dev.md
Last active June 6, 2024 02:54
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@Treeki
Treeki / TurnipPrices.cpp
Last active May 27, 2024 15:18
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@ageldama
ageldama / URLs.txt
Created January 6, 2020 13:34
DBus, org.freedesktop.Notifications, dbus-send fun
https://dbus.freedesktop.org/doc/dbus-send.1.html
https://www.freedesktop.org/wiki/Software/dbus/
# Desktop Notifications Specification
http://www.galago-project.org/specs/notification/0.9/x408.html
@serithemage
serithemage / konlpy+mecab_install_to_amazon_linux2.sh
Last active November 5, 2019 22:15
konlpy와 mecab을 amazon linux2에 인스톨하는 스크립트입니다
#!/bin/bash
sudo amazon-linux-extras install epel
sudo yum install -y https://packages.groonga.org/centos/groonga-release-latest.noarch.rpm
sudo yum install -y -enablerepo=epel groonga
sudo yum install -y gcc-c++ java-1.8.0-openjdk-devel python-devel python3-devel fontconfig fontconfig-devel libstdc++
sudo yum install mecab mecab-devel mecab-ipadic git make curl xz patch
sudo pip3 install konlpy
@travisdowns
travisdowns / cache-counters-rant.md
Created October 13, 2019 16:46
Discussion of x86 L1D related cache counters

The counters that are the easiest to understand and the best for making ratios that are internally consistent (i.e., always fall in the range 0.0 to 1.0) are the mem_load_retired events, e.g., mem_load_retired.l1_hit and mem_load_retired.l1_miss.

These count at the instruction level, i.e., the universe of retired instructions. For example, could make a reasonable hit ratio from mem_load_retired.l1_hit / mem_inst_retired.all_loads and it will be sane (never indicate a hit rate more than 100%, for example).

That one isn't perfect though, in that it may not reflect the true costs of cache misses and the behavior of the program for at least the following reasons:

  • It appplies only to loads and can't catch misses imposed by stores (AFAICT there is no event that counts store misses).
  • It only counts loads that retire - a lot of the load activity in your process may be due to loads on a speculative path that never retire. Loads on a speculative path may bring in data that is never used, causing misses and d