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 / synology_dsm6_tips.txt
Created August 26, 2017 17:36
Synology DSM 6 tips
# restart service
sudo su -
/usr/syno/sbin/synoservice --list
/usr/syno/sbin/synoservice --restart <service_name>
# passwordless ssh
#1. fix /etc/ssh/sshd_config
AuthorizedKeyFile .ssh/authorized_keys
#2. fix acl
chmod 755 <home_directory>
@jeongho
jeongho / maven-archetype-quickstart.txt
Created August 23, 2017 21:01
maven-archetype-quickstart
mvn archetype:generate -DgroupId=com.antarcticatec -DartifactId=antarcticatec-app -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
mvn archetype:generate \
-DgroupId=com.antarcticatec \
-DartifactId=antarcticatec-app \
-DarchetypeArtifactId=maven-archetype-quickstart \
-DinteractiveMode=false
@jeongho
jeongho / scikit-learn_test.sh
Created August 2, 2017 00:18
scikit-learn classifier comparison plot
#!/usr/bin/env bash
#http://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html#sphx-glr-auto-examples-classification-plot-classifier-comparison-py
git clone https://github.com/scikit-learn/scikit-learn
cd scikit-learn
# check anacona scikit version and upgrade necessary
pip list | grep scikit
conda install scikit-learn
@jeongho
jeongho / hello_world_tensorflow.sh
Last active September 26, 2017 05:21
Installing TensorFlow on Mac OS X
#!/usr/bin/env bash
# install with anacona
# https://www.tensorflow.org/install/install_mac#installing_with_anaconda
conda create -n tensorflow
source activate tensorflow
#Python 2.7
TF_PYTHON_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.3.0-py2-none-any.whl
#Python 3.4, 3.5, or 3.6
@jeongho
jeongho / smtp_mail_test.sh
Last active May 23, 2017 20:39
smtp mail test script
echo "<h1>body</h1>" | /bin/mailx \
-S smtp=smtp://aspmx.l.google.com \
-S from=no-reply@wonderland.com \
-s 'Subject [$(date -u %Y-%m-%d)] Hello World \nContent-Type: text/html\n' alice@wonderland.com
@jeongho
jeongho / latency.txt
Created April 28, 2017 06:16 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@jeongho
jeongho / run_spark_terasort.sh
Last active April 14, 2017 23:48
Spark terasort
# https://github.com/ehiggs/spark-terasort
# https://samanaghazadeh.wordpress.com/2015/04/18/terasort-equivalent-for-apache-spark/
10gb
application_1492200106363_0096 TeraGen (10GB) 2017/04/14 20:33:33 2017/04/14 20:34:41 1.1 min hdfs 2017/04/14 20:34:41
application_1492200106363_0098 TeraSort 2017/04/14 20:46:55 2017/04/14 20:48:07 1.2 min hdfs 2017/04/14 20:48:07
application_1492200106363_0099 TeraValidate 2017/04/14 20:48:51 2017/04/14 20:49:20 29 s hdfs 2017/04/14 20:49:20
100gb
application_1492200106363_0097 TeraGen (100GB) 2017/04/14 20:35:37 2017/04/14 20:48:15 13 min hdfs 2017/04/14 20:48:15
@jeongho
jeongho / gcp_tips.txt
Created March 30, 2017 23:32
Google Cloud Platform tips
ssh -i your_key_file -o UserKnownHostsFile=/dev/null \
-o CheckHostIP=no -o StrictHostKeyChecking=no user@ip_address
https://cloud.google.com/solutions/connecting-securely#socks-proxy-over-ssh
gcloud compute ssh example-instance \
--project my-project \
--zone us-central1-a \
--ssh-flag="-D" \
--ssh-flag="1080" \
--ssh-flag="-N"
@jeongho
jeongho / aws_socks_proxy.txt
Created March 4, 2017 05:11
Configuring a SOCKS Proxy for Amazon EC2
https://www.cloudera.com/documentation/director/latest/topics/director_security_socks.html
Step 1: Set Up a SOCKS Proxy Server with SSH
nohup ssh -i "your-key-file.pem" -CND 8157 ec2-user@instance_running_director_server &
Step 2: Configure Your Browser to Use the Proxy
Setting Up SwitchyOmega on the Google Chrome Browser
proxy autoconfig:
function regExpMatch(url, pattern) {
@jeongho
jeongho / https_self_signed_cert.txt
Created February 23, 2017 04:17
Java HTTPS to a server with a self-signed certificate Raw
http://www.artificialworlds.net/blog/2015/12/07/java-https-to-a-server-with-a-self-signed-certificate/
cat << EOF > Get.java
import java.net.URL;
public class Get
{
public static void main( String[] args ) throws Exception
{
try
{