Skip to content

Instantly share code, notes, and snippets.

View inureyes's full-sized avatar

Jeongkyu Shin inureyes

View GitHub Profile
@inureyes
inureyes / install_packages_backendai_basic.sh
Last active April 29, 2024 08:54
Backend.AI 24.03 single machine installation on Ubuntu (package install)
# Install docker
sudo apt update
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
@inureyes
inureyes / initial_lamp.sh
Created August 19, 2022 09:10 — forked from duan-li/initial_lamp.sh
Ubuntu 14.04 LTS apache php-fpm setup
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
CURRENT_USER=$(id -u -n)
CURRENT_GROUP=$(id -g -n)
CURRENT_USER_HOME=$(eval echo ~${SUDO_USER})
@inureyes
inureyes / LibHook.h
Created March 28, 2022 17:03 — forked from NeoCat/LibHook.h
Hook hidden symbol call (x86_64)
#include <string.h>
#include <dlfcn.h>
#include <err.h>
#include <errno.h>
#include <sys/mman.h>
#define LIB_PATH "libc.so.6"
template <class RET, class... ARGV>
class LibHook {
@inureyes
inureyes / High_Performance_Redis.md
Created March 28, 2022 16:48 — forked from neomantra/High_Performance_Redis.md
Notes on running Redis with HPC techniques

High Performance Redis

In response to this brief blog entry, @antirez tweeted for some documentation on high-performance techniques for Redis. What I present here are general high-performance computing (HPC) techniques. The examples are oriented to Redis. but they work well for any program designed to be single- or worker-threaded and asynchronous (e.g. uses epoll).

The motivation for using these techniques is to maximize performance of our system and services. By isolating work, controlling memory, and other tuning, you can achieve significant reduction in latency and increase in throughput.

My perspective comes from the microcosm of my own bare-metal (vs VM), on-premises deployment. It might not be suitable for all scenarios, especially cloud deployments, as I have little experience with HPC there. After some discussion, maybe this can be adapted as [redis.io documentation](https://redis.io/do

@inureyes
inureyes / auto-sign-commits-mac.md
Created February 20, 2020 03:03 — forked from lucko/auto-sign-commits-mac.md
Auto-sign commits with IntelliJ on MacOS

Run:

  • brew install gnupg gnupg2 pinentry-mac
  • git config --global user.signingkey <key>
  • git config --global commit.gpgsign true
  • git config --global gpg.program gpg

Followed by:

  • nano ~/.gnupg/gpg.conf
@inureyes
inureyes / VinpokTaptic.json
Created June 13, 2019 02:14
Ultimate VInpok taptic patch for right shift using karabiner-element (put it in .config/karabiner/complex_modifications)
{
"title": "Vinpok Taptek (left shift patch)",
"rules": [
{
"description": "Up arrow as it is if type alone, otherwise work as shift (Bluetooth)",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "up_arrow",
@inureyes
inureyes / sds011.py
Created December 20, 2016 07:14 — forked from geoffwatts/sds011.py
Read an SDS011 Laser PM2.5 Sensor (Nova PM Sensor) with Python
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import serial, time, struct
ser = serial.Serial()
ser.port = "/dev/cu.wchusbserial1410" # Set this to your serial port
ser.baudrate = 9600
ser.open()
@inureyes
inureyes / RPi_I2C_driver.py
Created July 28, 2016 15:16 — forked from DenisFromHR/RPi_I2C_driver.py
RaspberryPi I2C LCD Python stuff
# -*- coding: utf-8 -*-
"""
Compiled, mashed and generally mutilated 2014-2015 by Denis Pleic
Made available under GNU GENERAL PUBLIC LICENSE
# Modified Python I2C library for Raspberry Pi
# as found on http://www.recantha.co.uk/blog/?p=4849
# Joined existing 'i2c_lib.py' and 'lcddriver.py' into a single library
# added bits and pieces from various sources
# By DenisFromHR (Denis Pleic)
@inureyes
inureyes / ddns.py
Created May 10, 2016 03:23 — forked from allieus/ddns.py
Route 53 에 내 도메인 정보 반영하기 (Dynamic DNS 로 활용하기)
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from boto.route53 import connect_to_region
from boto.route53.record import ResourceRecordSets
def apply(domain, ip, ttl, region, access_key=None, secret_key=None):
if access_key:
os.environ.setdefault('AWS_ACCESS_KEY_ID', access_key)
<link rel="import" href="{{ STATIC_URL }}vendor/polymer/polymer.html">
<link rel="import" href="{{ STATIC_URL }}vendor/core-ajax/core-ajax.html">
<polymer-element name="django-ajax" extends="core-ajax">
<script>
Polymer({
ready: function() {
this.super();
this.headers = {
"X-CSRFToken": {{ csrf_token }},