Skip to content

Instantly share code, notes, and snippets.

View maxswjeon's full-sized avatar

Sangwan Jeon maxswjeon

  • Seoul, Korea, Republic of
  • 05:36 (UTC +09:00)
View GitHub Profile
@maxswjeon
maxswjeon / kp
Created May 26, 2023 05:07
`kp` - Kill process by Port
#!/bin/bash
if [ $# -ne 1 ]; then
echo "usage: kp [port]"
exit 1
fi
NODE_PID=$(ss -lptn "sport = :$1" | grep -o 'pid=[0-9]\+' | cut -d '=' -f 2)
if [ -z $NODE_PID ]; then
@maxswjeon
maxswjeon / tasks.json
Created April 21, 2023 13:47
Visual Studio Code MSVC Build
{
"version": "2.0.0",
"windows": {
"options": {
"shell": {
"executable": "cmd.exe",
"args": [
"/C"
]
}
@maxswjeon
maxswjeon / main.py
Created April 28, 2022 17:55
Learnus Downloader
from calendar import c
import os
import re
import requests
import subprocess
from bs4 import BeautifulSoup
def _parse_range(numbers: str):
for x in numbers.split(','):
x = x.strip()
@maxswjeon
maxswjeon / scan_disks.sh
Created July 19, 2021 06:07
Rescan Hard Disks
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "This script needs to be ran as root"
exit
fi
for controller in $(ls /sys/class/scsi_host); do
echo "- - -" > /sys/class/scsi_host/$controller/scan
done
@maxswjeon
maxswjeon / tos.txt
Created April 9, 2021 18:27
올라운더마케팅 Facebook ToS
Empty
@maxswjeon
maxswjeon / Delete Jupyter Notebook Registery.reg
Last active March 23, 2021 04:14
Add "Open Jupyter Notebook Here" in windows explorer context menu
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\JupyterNotebook]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\JupyterNotebook\command]
@maxswjeon
maxswjeon / server.py
Created September 5, 2020 08:31
Bluetooth Image Server
#!/usr/bin/python3
from picamera import *
from bluetooth import *
from io import BytesIO
from struct import pack
from PIL import Image
import time
import base64

Keybase proof

I hereby claim:

  • I am maxswjeon on github.
  • I am maxswjeon (https://keybase.io/maxswjeon) on keybase.
  • I have a public key ASB_P8nOARLuo0IgBmM4WoSwJpJERMBd3aYCrwL1pLZYRAo

To claim this, I am signing this object:

@maxswjeon
maxswjeon / Matrix.hpp
Last active April 4, 2020 16:58
Fully Templated Mathematical Matrix
#pragma once
#include <type_traits>
#include <array>
#include <cassert>
#include <iomanip>
#include <iostream>
template <size_t X, size_t Y, typename T = double>
class Matrix
@maxswjeon
maxswjeon / Vector.hpp
Last active October 5, 2019 13:10
Full Templated Vector in C++
#pragma once
#include <array>
#include <type_traits>
#include <cassert>
namespace Math
{
template <typename... > struct typelist;