Skip to content

Instantly share code, notes, and snippets.

@mulderu
mulderu / python-util.py
Created December 19, 2018 03:01
python utility sets
def loadLines(path, rmSharp=False):
""" line by line reader : output : array """
fp = open(path, "r")
alls = fp.read().split("\n")[:-1]
if (rmSharp):
lines = []
for line in alls:
line = line.strip()
if line.startswith('#'):
continue
@mulderu
mulderu / point-algebra.html
Last active July 7, 2018 23:09
2point distance angle make extend length
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>2point algebra</title>
<script src="https://code.jquery.com/jquery.min.js"></script>
<style>
#pan { position: relative; width: 1000px; height: 800px; }
.jum { position: absolute; background-color:blue; width: 5px; height: 5px; }
@mulderu
mulderu / mysetup.md
Last active July 14, 2018 04:59
mysetup, vscode, vim, bash, and more

httpd.conf

allow show directory index

<IfModule alias_module>
    ...
    Alias /Project /Users/mulder/Project
</IfModule>
<Directory "/Users/mulder/Project">
 AllowOverride None
@mulderu
mulderu / vim_key_info.txt
Last active December 13, 2017 20:58
vim and cmd util space 4 or space 2 and line number and special chars
vim
$ cat .vimrc
--------------------
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=2
" when indenting with '>', use 4 spaces width
set shiftwidth=2
" On pressing tab, insert 4 spaces
@mulderu
mulderu / python_pil_demo_study.py
Created November 23, 2017 04:28
python, pillow, pil, image processing demo
import os
import numpy as np
import cv2
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFilter
'''
ref : http://pillow.readthedocs.io/en/3.4.x/index.html
ref : basic : https://www.youtube.com/watch?v=Fd_0ns8bmCY
@mulderu
mulderu / ssh-reverse-ssh.sh
Created August 31, 2017 07:15
reverse ssh, ssh forwarding
# reverse ssh tunneling
# simple way
# ref from : https://www.howtoforge.com/reverse-ssh-tunneling
#
# env-summary
# target : 192.168.5.10 (internal ip in firewall)
# ssh-gateway : 100.100.100.10 (static ip in public access)
#
# step 1) login to ssh-gateway from target(target is your final destination)
ssh -R 19999:localhost:22 mulder@100.100.100.10
@mulderu
mulderu / bash-util-01.sh
Last active July 17, 2018 03:13
bash util
# locale setup
sudo locale-gen "en_US.UTF-8"
sudo locale-gen "ko_KR.UTF-8"
#.bashrc
export LANG="ko_KR.UTF-8"
export LC_ALL="ko_KR.UTF-8"
# multiple fname pattern find
find /home/mulder/Downloads/phone_0 -name "*.jpg" -o -name "*.png"
@mulderu
mulderu / bash-file-read-and-work.sh
Last active May 15, 2018 04:41
bash, file read, loop, work
#!/bin/bash
k=1
input="t1"
while IFS= read -r var
do
echo "$k ]"
echo "$var"
cat "$var"
wc -l "$var"
@mjdietzx
mjdietzx / waya-dl-setup.sh
Last active March 13, 2024 15:08
Install CUDA Toolkit v8.0 and cuDNN v6.0 on Ubuntu 16.04
#!/bin/bash
# install CUDA Toolkit v8.0
# instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network))
CUDA_REPO_PKG="cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG}
sudo dpkg -i ${CUDA_REPO_PKG}
sudo apt-get update
sudo apt-get -y install cuda
@itzikbenh
itzikbenh / db-class.php
Last active October 5, 2016 22:23
Simple WordPress query builder. In progress.
<?php
class Ath_DB
{
protected static $table = null;
function __construct()
{
global $wpdb;
$this->db = $wpdb;