Skip to content

Instantly share code, notes, and snippets.

View yk-tanigawa's full-sized avatar

Yosuke Tanigawa yk-tanigawa

View GitHub Profile
@ochilab
ochilab / gist-gadget.xml
Last active October 27, 2015 16:08 — forked from omoshetech-t/gist-gadget.xml
Google siteにてGistのコード埋め込みスクリプトを表示するためのGoogle Gadgetスクリプト。
<?xml version="1.0"?>
<Module>
<ModulePrefs title="Gist">
<Require feature="dynamic-height"/>
</ModulePrefs>
<UserPref name="id" display_name="Gist ID" required="true" default_value="10683373"/>
<UserPref name="font_size" display_name="Font size (px)" required="true" default_value="12"/>
<UserPref name="line_height" display_name="Line height (px)" required="true" default_value="16"/>
<Content type="html">
<![CDATA[
CC = gcc
LD = gcc
CFLAGS = -Wall -Wextra -O2
LDFLAGS = #-lpthread -lm
SRCS := $(wildcard *.c)
OBJS = $(SRCS:.c=.o)
DEPS = $(SRCS:.c=.dep)
EXEC = $(SRCS:.c=)
RM = rm -f

install necessary software to cluster machine

pyenv

  • download and install pyenv via github
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
  • add the following to ~/.bash_profile
@yk-tanigawa
yk-tanigawa / .ssh_config
Last active June 21, 2017 18:39
Templates
Host github.com
User somebody@somewhere.com
Port 22
Hostname github.com
IdentityFile ~/.ssh/github
IdentitiesOnly yes
Host *
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p

This script works as a wrapper for sbatch command.

Usage: sherlock-one-liner python --version

@yk-tanigawa
yk-tanigawa / jupyter-remote-login.sh
Created February 2, 2018 09:46
ssh port forwarding scripts
#!/bin/bash
# parse args
if [ $# -lt 2 ] ; then
echo "usage: $0 <target-server> <login-server> [local port (default: 18888)] [target port (default: 8888)] [login port (default: rand)]" >&2
exit 1
fi
target=$1
@sasaki-shigeo
sasaki-shigeo / NumericConstants.scala
Created September 15, 2012 10:11
Numeric Constants in Scala (Scala の数値定数)
Int.MaxValue // Int の最大値
Int.MinValue // Int の最小値
Long.MaxValue // Long の最大値
Long.MinValue // Long の最小値
Byte.MaxValue // Byte の最大値
Byte.MinValue // Byte の最小値
Short.MaxValue // Short の最大値
@kmizu
kmizu / gist:1876800
Last active December 22, 2019 00:05 — forked from gakuzzzz/gist:1865400
Scala環境構築

Scala 開発環境構築手順

前提条件

  • JDKがinstall済みであること
  • java コマンドに環境変数Pathが通っていること
@bittner
bittner / gnu-tools-for-mac.sh
Last active December 11, 2021 20:05
Cross-OS compatibility with GNU tools (readlink, sed, zcat, zless, zdiff, ...) for Mac OS X towards Linux
# DESCRIPTION OF PROBLEM: Implementations of sed, readlink, zcat, etc. are different on OS X and Linux.
# NOTE: Put this on top of your script using sed, readlink, zcat, etc. that should work alike on Mac OS X.
# cross-OS compatibility (greadlink, gsed, zcat are GNU implementations for OS X)
[[ `uname` == 'Darwin' ]] && {
which greadlink gsed gzcat > /dev/null && {
unalias readlink sed zcat
alias readlink=greadlink sed=gsed zcat=gzcat
} || {
echo 'ERROR: GNU utils required for Mac. You may use homebrew to install them: brew install coreutils gnu-sed'
@palexander
palexander / gist:2975305
Last active January 21, 2022 14:03
Compiling and running mosh on Dreamhost
# Thanks to @samsonjs for the cleaned up version:
# https://gist.github.com/samsonjs/4076746
PREFIX=$HOME
VERSION=1.2.3
# Install Protocol Buffers
wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
tar -xf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1