Skip to content

Instantly share code, notes, and snippets.

View JeonghunLee's full-sized avatar
🤗
I may be slow to respond.

JeongHun (James) Lee JeonghunLee

🤗
I may be slow to respond.
View GitHub Profile
1. Execute make first. This will result in a netlinkKernel.ko output among many others.
2. Execute $ gcc netlinkUser.c -o netlinkUser
3. Insert kernel module by :$ sudo insmod netlinkKernel.ko
4. Run ./netlinkUser to see message and run dmesg to see debug messages
5. Remove module by : $ sudo rmmod netlinkKernel
6. Finally make clean to remove output files.
/*
* Jeonghun Lee
* Recently, I made FIFO functions by using Array in MSP430 for optimization
*/
#define MAX_TX_BUFF 1024
#define MAX_RX_BUFF 128
/*
@JeonghunLee
JeonghunLee / gist:252480befcbf05d1e7dbc09c875bb813
Created February 27, 2019 15:51
python matplotlib의 plot 사용시 naviationtool bar 사용
## https://stackoverflow.com/questions/14896580/matplotlib-hooking-in-to-home-back-forward-button-events/15109266
## https://www.csie.ntu.edu.tw/~azarc/sna/matplotlib/lib/matplotlib/backend_bases.py
import matplotlib.pyplot as plt
from matplotlib.backend_bases import NavigationToolbar2, Event
home = NavigationToolbar2.home
back = NavigationToolbar2.back
forward = NavigationToolbar2.forward
@JeonghunLee
JeonghunLee / gist:c79fb515a32d00583e77adf45a9b9677
Created February 27, 2019 15:54
python Histogram Test program
import cv2
import numpy as np
import random
from matplotlib import pyplot as plt
from matplotlib.backend_bases import NavigationToolbar2
# https://opencv-python.readthedocs.io/en/latest/doc/19.imageHistograms/imageHistograms.html#mask
# https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_histograms/py_histogram_equalization/py_histogram_equalization.html
# https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_histograms/py_histogram_begins/py_histogram_begins.html
import os
import argparse
import cv2
import numpy as np
import random
import matplotlib.pyplot as plt
from matplotlib.backend_bases import NavigationToolbar2, Event
# https://stackoverflow.com/questions/4098131/how-to-update-a-plot-in-matplotlib
import cv2
import sys
import pytesseract
import numpy as np
from matplotlib import pyplot as plt
#import matplotlib.pyplot as plt
#
# /usr/share/tesseract-ocr/4.00/tessdata
#
int __io_putchar(int ch)
{
HAL_UART_Transmit(&huart4, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
@JeonghunLee
JeonghunLee / gist:8d55ef0b722c53cc0632a3ea0c180b47
Last active September 10, 2019 07:51
jpeg_histogram_view
import os
import argparse
import cv2
import numpy as np
import random
import matplotlib.pyplot as plt
from matplotlib.backend_bases import NavigationToolbar2, Event
parser = argparse.ArgumentParser(
description='Run OpenCV ')
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
#!/bin/bash
#
# rename jpg files in sequence with same pattern
#
# Author : Jeonghun Lee
# Version : 0.1
#
# ./rename.sh
# or
# ./rename.sh 1stArg 2ndArg