Skip to content

Instantly share code, notes, and snippets.

View tsuyo's full-sized avatar
💭
Where there is a will, there is a way

Tsuyoshi Miyake tsuyo

💭
Where there is a will, there is a way
View GitHub Profile
@tsuyo
tsuyo / JavaC.sublime-build
Created August 2, 2012 07:00
JavaC.sublime-build to both compile & run a Java class at the same time for Sublime Text 2
{
"cmd": ["sh", "-c", "javac $file_base_name.java && java $file_base_name"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.java"
}
@tsuyo
tsuyo / eclipse_memo.txt
Created March 3, 2016 15:06
Eclipse Memo
# keybind (for ver 4.5.0)
Window -> Preferences -> General -> Keys
Scheme: Emacs
Delete Previous: Ctrl+H
Contenst Assist: Ctrl+/
Set Mark: Ctrl+Space
Find and Replace: Ctrl+], Shift+5 (aka M-%)
@tsuyo
tsuyo / ncdc.sh
Last active February 14, 2022 14:42 — forked from aligusnet/ncdc.sh
Download a weather dataset from the National Climatic Data Center (NCDC, http://www .ncdc.noaa.gov/). Prepare it for examples of "Hadoop: The Definitive Guide" book by Tom White. http://www.amazon.com/Hadoop-Definitive-Guide-Tom-White/dp/1449311520Usage:./ncdc.sh 1901 1930 # download wheather datasets for period from 1901 to 1930.
#!/usr/bin/env bash
# global parameters
g_tmp_folder="ncdc_tmp";
g_output_folder="ncdc_data";
g_remote_host="ftp.ncdc.noaa.gov";
g_remote_path="pub/data/noaa";
@tsuyo
tsuyo / aws-user-data-jdk
Last active July 22, 2024 00:25
AWS user-data for JDK installation
#!/bin/bash
# You can use this script as AWS user-data like
# $ aws ec2 run-instances [<other_params>] --user-data https://gist.githubusercontent.com/tsuyo/a6fe43549599b622c8f2331a14f795da/raw/aws-user-data-jdk
JDK_URL=http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.tar.gz
JDK_VER=jdk1.8.0_102
CUR_USER=${SUDO_USER:-$(tail -1 /etc/passwd | cut -d: -f1)}
installJDK() {
@tsuyo
tsuyo / README.md
Last active March 4, 2018 12:51
Toggle input sources (English or Japanese) by shift + space in Karabiner-Elements

How to use

  1. Copy this "shift_space_input_source.json" to ~/.config/karabiner/assets/complex_modifications/
  2. Karabiner-Elements -> Preferences -> Complex Modifications -> Add rule -> Enable "Toggle input sources (English or Japanese) by shift + space"
create 'test', 'cf'
list 'test'
describe 'test'
put 'test', 'row1', 'cf:a', 'value1'
put 'test', 'row2', 'cf:b', 'value2'
put 'test', 'row3', 'cf:c', 'value3'
scan 'test'
get 'test', 'row1'
disable 'test'
enable 'test'
hdfs dfs -mkdir input
hdfs dfs -put ${HADOOP_HOME}/etc/hadoop/*.xml input
hadoop jar ${HADOOP_HOME}/share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar grep input output 'dfs[a-z.]+'
hdfs dfs -cat output/*
@tsuyo
tsuyo / jfrog_artifactory_installation_and_setup.md
Last active April 11, 2020 10:57
JFrog Artifactory Installation and Setup

Standalone on Mac / Linux (tested on Mac)

Download Artifactory or Download Artifactory from Bintray

$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk-11.0.5.jdk/Contents/Home
$ export JFROG_HOME=/opt/jfrog
$ tar -C $JFROG_HOME -zxvf jfrog-artifactory-pro-7.2.1-darwin.tar.gz
$ ln -s /opt/jfrog/artifactory-pro-7.2.1 $JFROG_HOME/artifactory-pro
$ $JFROG_HOME/artifactory-pro/app/bin/artifactoryctl start

Jenkins Installation and Setup

@tsuyo
tsuyo / dashboard-adminuser.sh
Created May 7, 2020 13:09
Quick installation & configuration for k8s dashboard on Mac
#!/bin/bash
cat > /tmp/dashboard-adminuser-1.yaml << EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
EOF