Skip to content

Instantly share code, notes, and snippets.

View jeongho's full-sized avatar

Jeongho Park jeongho

  • Deception Island, Antarctica
View GitHub Profile
@jeongho
jeongho / plot_mandelbrot.py
Created February 27, 2018 19:55
Mandelbrot set
#!/usr/bin/env python
#https://matplotlib.org/examples/showcase/mandelbrot.html
#http://www.scipy-lectures.org/intro/numpy/auto_examples/plot_mandelbrot.html
"""
Mandelbrot set
==============
Compute the Mandelbrot fractal and plot it
@jeongho
jeongho / GridSearch.md
Last active February 27, 2018 22:04
h2o.ai Grid Search (Hyperparameter Search) API

Grid Search (Hyperparameter Search) API

REST

The current implementation of the grid search REST API exposes the following endpoints:

  • GET /<version>/Grids: List available grids, with optional parameters to sort the list by model metric such as MSE
  • GET /<version>/Grids/<grid_id>: Return specified grid
  • POST /<version>/Grids/<algo_name>: Start a new grid search
    • <algo_name>: Supported algorithm values are {glm, gbm, drf, kmeans, deeplearning}
@jeongho
jeongho / random hyperparmeter search and roadmap.md
Last active February 27, 2018 22:26
h2o.ai Hyperparameter Optimization in H2O : A guide to Grid Search and Random Search in H2O.

Hyperparameter Optimization in H2O: Grid Search, Random Search and the Future

"Good, better, best. Never let it rest. 'Til your good is better and your better is best." - St. Jerome

Overview

H2O now has random hyperparameter search with time- and metric-based early stopping. Bergstra and Bengio[^1] write on p. 281:

Compared with neural networks configured by a pure grid search, we find that random search over the same domain is able to find models that are as good or better within a small fraction of the computation time.

@jeongho
jeongho / gcp_adding_or_resize_persistent_disks.sh
Created March 20, 2018 19:11
GCP Adding or Resizing Persistent Disks
#https://cloud.google.com/compute/docs/disks/add-persistent-disk
#Formatting and mounting a persistent disk
sudo lsblk
sudo mkfs.ext4 -m 0 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/[DEVICE_ID]
sudo mkdir -p /mnt/disks/[MNT_DIR]
sudo mount -o discard,defaults /dev/[DEVICE_ID] /mnt/disks/[MNT_DIR]
sudo chmod a+w /mnt/disks/[MNT_DIR]
sudo cp /etc/fstab /etc/fstab.backup
sudo blkid /dev/[DEVICE_ID]
echo UUID=`sudo blkid -s UUID -o value /dev/sdb` /mnt/disks/disk-1 ext4 discard,defaults,nofail 0 2 | sudo tee -a /etc/fstab
@jeongho
jeongho / tmux-cheatsheet.markdown
Created October 25, 2018 18:03 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jeongho
jeongho / jq_flatten_solr_metrics.sh
Last active December 11, 2018 06:07
jq flattening solr metrics json
curl -sS --retry 5 --retry-delay 5 -m 60 "http://localhost:8983/solr/admin/metrics" | jq -r '.metrics | tostream
| select(length==2)
| (.[0] | map(tostring) | join(".")) as $k
| .[1] as $v
| "\"\($k)\" = \"\($v)\";"' \
| sed "s/\"//g;s/ms$//g;s/\;$//g;s/ = / /g;s/\//_/g;s/\._/\./g;s/'//g;s/-/./g;s/:/./g;s/\.shard[0-9]*\.replica[^\.]*//g" \
| tr [:upper:] [:lower:] | egrep -v "(rate|ms) " | egrep -v "(\.duration\.|http\.__|handlerstart)" \
| awk '/ -?[0-9]*\.?[0-9]*$/ { if ($1 in keys) { keys[$1] += $2 } else { keys[$1] = $2 } } END { for (key in keys) { printf("%s %s ms\n", key, keys[key]) } }' \
| egrep "^solr.jetty|^solr.jvm|^solr.node|^solr.core.*\.deleteddocs|^solr.core.*\.maxdoc|^solr.core.*\.numdocs" \
| head -n 20
@jeongho
jeongho / dig_axfr.sh
Created January 11, 2019 18:50
digging dns with a zone transfer
dig axfr aa05.penguin.antarcticatec.com | grep -v ob | sort | sed -n -E "s/(.*)[0-9]{3,}.aa05.*$/\1/gp" | grep -E "(^ul|^dt)" |sort -u |grep -v CNAME
@jeongho
jeongho / convert_to_utf8.sh
Last active November 13, 2019 01:50
convert euc-kr to utf-8
#!/usr/bin/env bash
#sudo apt install uchardet
#sed -i 's/\r$//' convert_to_utf8.sh
#bash ./convert_to_utf8.sh ./t3series-common
[ $# -eq 0 ] && { echo "Usage: bash $0 target_directory (eg. ./t3series-common)"; exit 1; }
[ ! -d $1 ] && { echo "Directory $1 not exists"; exit 1; }
pushd "$1"
@jeongho
jeongho / ref_color_map.ipynb
Created April 21, 2020 05:38
Named colors in matplotlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeongho
jeongho / fix_catalina_java.sh
Created August 8, 2020 10:21
Cannot generate native image using GRAALVM in OS X Catalina
#https://stackoverflow.com/questions/59717111/cannot-generate-native-image-using-graalvm-in-os-x-catalina
sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.1.0