Skip to content

Instantly share code, notes, and snippets.

View masa-ita's full-sized avatar

Masatoshi Itagaki masa-ita

  • Masatoshi Itagaki Consulting Firm
  • Niigata, Japan
View GitHub Profile
@masa-ita
masa-ita / translate_notebook.py
Created April 2, 2020 05:42
Translate Jupyter Notebook with Google Cloud Translation
#!/usr/bin/env python
# coding: utf-8
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@masa-ita
masa-ita / transdiff.sh
Last active December 24, 2019 05:48
Compare a translated notebook/md file with the English original in tensorflow/docs using nbdiff-web
#!/bin/bash
# This tool is to compare a translated notebook or markdown file to
# the original English document in tensorflow/docs.
# Check if the nbdiff is available
if ! [ -x "$(command -v nbdiff-web)" ]; then
echo 'Error: nbdiff-web is not installed. `pip install nbdime` please' >&2
exit 1
fi
@masa-ita
masa-ita / base.tplx
Last active August 8, 2018 01:31
日本語のJupyter NotebookをPDFとしてダウンロードする ref: https://qiita.com/masa-ita/items/8d5ebe8afe0d580af184
((= Latex base template (must inherit)
This template builds upon the abstract template, adding common latex output
functions. Figures, data_text,
This template does not define a docclass, the inheriting class must define this.=))
((*- extends 'document_contents.tplx' -*))
%===============================================================================
% Abstract overrides
%===============================================================================
#!/bin/bash
# install packages needed to compile ruby
yum -y install make gcc zlib-devel openssl-devel \
readline-devel gdbm-devel bison \
libffi-devel wget
# you should register EPEL repository to install libyaml
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
yum -y install libyaml-devel
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
#!/usr/bin/env bash
# Tested for Ubuntu 12.04
[[ "$(id -u)" -ne "0" ]] && echo "must be root!" && exit 1
RBVER="2.0.0-p0"
apt-get update
apt-get install -y build-essential bison zlib1g-dev libssl-dev libgdbm-dev libreadline-dev libncurses-dev libffi-dev libyaml-dev wget rsync git-core
@masa-ita
masa-ita / chef_bootstrap_on_ruby1.8_for_ubuntu.sh
Created July 9, 2012 12:34
Compile Ruby 1.8.7 and install Rubygems and Chef on Ubuntu
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p370.tar.gz
tar -xvzf ruby-1.8.7-p370.tar.gz
cd ruby-1.8.7-p370/
./configure --prefix=/usr/local
make
make install
@masa-ita
masa-ita / compile_ruby_on_centos.sh
Created June 30, 2012 13:35
Compile Ruby 1.9.3 on CentOS 6.2 from source files
#!/bin/bash
# install packages needed to compile ruby
yum -y install make gcc zlib-devel openssl-devel \
readline-devel gdbm-devel bison \
libffi-devel wget
# you should register EPEL repository to install libyaml
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
yum -y install libyaml-devel
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz