Skip to content

Instantly share code, notes, and snippets.

View jmkim's full-sized avatar

Jongmin Kim jmkim

  • Senior Engineer, SSD FW Eng @doubleOplus
  • Busan, Republic of Korea
  • 18:46 (UTC +09:00)
View GitHub Profile
@wzjoriv
wzjoriv / clustering.py
Last active May 8, 2024 02:28
Nearest Neighbor, K Nearest Neighbor and K Means (NN, KNN, KMeans) implemented only using PyTorch
import torch as th
"""
Author: Josue N Rivera (github.com/wzjoriv)
Date: 7/3/2021
Description: Snippet of various clustering implementations only using PyTorch
Full project repository: https://github.com/wzjoriv/Lign (A graph deep learning framework that works alongside PyTorch)
"""
def random_sample(tensor, k):
@scientificRat
scientificRat / keymap.py
Last active May 3, 2024 18:31
Use raspberry pi as Bluetooth HID mouse/keyboard emulator
#
# Taken from https://www.gadgetdaily.xyz/create-a-cool-sliding-and-scrollable-mobile-menu/
#
# Convert value returned from Linux event device ("evdev") to a HID code. This
# is reverse of what's actually hardcoded in the kernel.
#
# Lubomir Rintel <lkundrak@v3.sk>
# License: GPL
#
# Ported to a Python module by Liam Fraser.
@MatheusRich
MatheusRich / final-evaluation.md
Last active September 3, 2019 18:37
Google Summer of Code 2019 Work Product Submission

Google Summer of Code 2019 Report

Integrate functionality from gem-web into RubyGems gem CLI

[Gem-web][gem-web] is a tool that capable of providing an interface that allows opening documentation, source code, and website of a ruby gem. My goal on GSoC was integrating it on RubyGems' CLI, which would make this feature available out of the box to all ruby users, improving their productivity, since there would have no need to search this information manually.

My Planning

@Akrabut
Akrabut / GSoC2019.md
Last active July 27, 2021 11:49
Google Summer of Code 2019 Summary (Ruby Language)

Summer of Code

Ruby Bundler and gem metrics, statistics, and analytics

Goals and Achievements

Project Goal

To have Bundler report anonymous usage metrics over HTTP to rubygems.org when a heavy command is run (to avoid deteriorating the runtime), and to have a backend API endpoint in rubygems.org to instrument it.

Did we achieve the goal?

Basically, yes. The actual implementation changed a little bit, and we decided to only instrument the low cardinality metrics using Datadog, as the free Datadog version limits value cardinality and wouldn't work with, for example, time related metrics.

@jmkim
jmkim / logcombiner.sh
Created June 18, 2018 01:36
Log combiner for logrotate
#!/bin/bash
for a in $(ls -1 access* | sort -t. -k3,3nr)
do
cat "$a" >> combined_access.log
done
for e in $(ls -1 error* | sort -t. -k3,3nr)
do
cat "$e" >> combined_error.log
@srnghn
srnghn / ANOVA_Spark_2.0.py
Created October 20, 2016 23:16
ANOVA Test for Spark 2.0 using PySpark. The function returns 5 values: degrees of freedom between (numerator), degrees of freedom within (denominator), F-value, eta squared and omega squared.
from pyspark.sql.functions import *
# Implementation of ANOVA function: calculates the degrees of freedom, F-value, eta squared and omega squared values.
# Expects that 'categoryData' with two columns, the first being the categorical independent variable and the second being the scale dependent variable
def getAnovaStats(categoryData) :
cat_val = categoryData.toDF("cat","value")
cat_val.createOrReplaceTempView("df")
newdf = spark.sql("select A.cat, A.value, cast((A.value * A.value) as double) as valueSq, ((A.value - B.avg) * (A.value - B.avg)) as diffSq from df A join (select cat, avg(value) as avg from df group by cat) B where A.cat = B.cat")
grouped = newdf.groupBy("cat")
#!/bin/bash
# This script will create you CA-signed client certificate.
#
# First, please follow these steps:
# - Create the root pair
# - Create the intermediate pair
# in https://jamielinux.com/docs/openssl-certificate-authority/
#
# Second, this script will NOT use attributes defined in your
# `openssl.cnf'. Define your C, ST, and O to the head of this
@whophil
whophil / jupyter.service
Last active October 30, 2023 16:33 — forked from doowon/jupyter_systemd
A systemd script for running a Jupyter notebook server.
# After Ubuntu 16.04, Systemd becomes the default.
# It is simpler than https://gist.github.com/Doowon/38910829898a6624ce4ed554f082c4dd
[Unit]
Description=Jupyter Notebook
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/home/phil/Enthought/Canopy_64bit/User/bin/jupyter-notebook --config=/home/phil/.jupyter/jupyter_notebook_config.py
@jmkim
jmkim / chmodbatch.sh
Last active October 5, 2016 06:47
Batch change the mode bit (the permission of files and directories)
#!/bin/bash
# Batch change the mode bit (the permission of files and directories)
#
# USAGE: script_name [path1] [path2]...
# script_name
#
# Author: Jongmin Kim (kdzlvaids@gmail.com)
@joepie91
joepie91 / vpn.md
Last active May 9, 2024 17:09
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.