Skip to content

Instantly share code, notes, and snippets.

View hiracchi's full-sized avatar

Toshiyuki HIRANO hiracchi

  • The University of Tokyo
  • 4-6-1 Komaba, Meguro, Tokyo, 153-8505, Japan
View GitHub Profile
#!/bin/bash
usage='search-sym SYMBOL'
if [ $# -ne 1 ];then
echo "invalid arguments!"
echo $usage
exit 1
fi
sym=$1
@hiracchi
hiracchi / python-setup.py
Created May 19, 2020 14:39
python snippet
#!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == "__main__":
main()
@hiracchi
hiracchi / rpi_backup_usb.sh
Created September 8, 2019 02:40
copy microsd data to USB memory at raspberry pi
#!/bin/bash
DEVICE="/dev/sda"
export LANG=C
sudo parted -s -a optimal ${DEVICE} -- mklabel msdos
sudo parted -s -a optimal ${DEVICE} -- mkpart primary fat32 0% 100M set 1 boot on
sudo parted -s -a optimal ${DEVICE} -- mkpart primary ext4 100M 100%
sudo parted -s -a optimal ${DEVICE} -- print
@hiracchi
hiracchi / brew-install-ghostscript-9.26.sh
Last active December 18, 2023 04:41
install ghostscript 9.26 on MacOS by using homebrew
#!/bin/bash
brew unlink ghostscript
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
git checkout 6ec0c1a03ad789b6246bfbbf4ee0e37e9f913ee0 ghostscript.rb
brew install ghostscript
brew pin ghostscript
@hiracchi
hiracchi / dot.envrc
Last active August 30, 2017 05:14
direnv setting for building ProteinDF
#!/bin/bash
# PDF_HOME
export PDF_HOME="${HOME}/local/ProteinDF.201704.GNU"
if [ x${PATH} != x ]; then
PATH=${PATH}:${PDF_HOME}/bin
else
PATH=${PDF_HOME}/bin
fi
export PATH
@hiracchi
hiracchi / build-amesh.sh
Created December 13, 2016 03:49
desktop app for Tokyo amesh (http://tokyo-ame.jwa.or.jp/) built by using "nativefier"
#!/bin/bash
WIDTH=990px
HEIGHT=728px
nativefier --name "amesh" \
--width ${WIDTH} --min-width ${WIDTH} --max-width ${WIDTH} \
--height ${HEIGHT} --min-height ${HEIGHT} --max-height ${HEIGHT} \
"http://tokyo-ame.jwa.or.jp/"
@hiracchi
hiracchi / build_pdf_osx.sh
Last active October 29, 2015 05:33
build script for ProteinDF on MacOSX
#!/bin/bash
# a build script for ProteinDF on MacOSX
#
# 1. prepare build tools by using homebrew.
# $ brew install gcc automake autoconf libtool
# 2. install LAPACK into ${HOME}/local
# In this case, "librefblas.a" and "liblapack.a" are found in the ${HOME}/local/lib directory.
# 3. install OpenMPI into ${HOME}/local/openmpi
# This build-script uses "${HOME}/local/openmpi/bin/mpicxx" as MPI-C++ compiler.
@hiracchi
hiracchi / build_SGE.sh
Last active August 29, 2015 14:26
build son-grid-engine on ubuntu 14.04
#!/bin/bash
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install git tcsh automake autoconf ant libopenmpi-dev libssl-dev libdb-dev libpam0g-dev junit javacc
sudo apt-get install libxt-dev libmotif-dev libxext-dev
git clone http://arc.liv.ac.uk/repos/git/sge
(cd source; bash scripts/bootstrap.sh && ./aimk) 2>&1 | tee out.build
@hiracchi
hiracchi / rc.local
Created July 17, 2015 04:41
Start vagrant VMs on host boot
#!/bin/sh -e
#
# /etc/rc.local
# see. http://stackoverflow.com/questions/18098510/stat-vagrant-vm-on-host-boot
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
@hiracchi
hiracchi / build_gt.sh
Last active August 29, 2015 14:22
build globus-toolkit for HPCI
#!/bin/bash
export GLOBUS_LOCATION=${HOME}/local/gt
export PATH=${GLOBUS_LOCATION}/bin:${PATH}
export DYLD_LIBRARY_PATH=${GLOBUS_LOCATION}/lib
# sudo aptitude install libltdl-dev
./configure --prefix=${GLOBUS_LOCATION} --with-flavor=gcc64dbg 2>&1 | tee out.configure
make gsi-openssh gsi-myproxy 2>&1 | tee out.make