Skip to content

Instantly share code, notes, and snippets.

View tenomoto's full-sized avatar

Takeshi Enomoto tenomoto

View GitHub Profile
@tenomoto
tenomoto / cpuinfo.sh
Created September 28, 2018 02:10
Processor information of Mac
# https://apple.stackexchange.com/questions/238777/how-do-i-identify-which-cpu-a-macbook-uses
sysctl -n machdep.cpu.brand_string
system_profiler SPHardwareDataType
@tenomoto
tenomoto / add_read_permission.sh
Last active October 7, 2018 01:38
Add read permission to files and directories and execute only to directories
# a: all
# =: reset
# r: read
# X: execute excluding files
# u: user (owner)
# +: add
# w: write
chmod -R a=rX,u+w directory
@tenomoto
tenomoto / Animation.ipynb
Last active October 6, 2018 08:25
Animate pcolormesh and scatter
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tenomoto
tenomoto / jrap_grib2nc.sh
Created November 9, 2018 03:32
Convert JMA Radar-AMeDAS in GRIB2 to netcdf
#!/bin/sh
yyyymmdd=20180701
hhmm=0000
fname=Z__C_RJTD_${yyyymmdd}${hhmm}00_RDR_JMAGPV__grib2
tar xf ${fname}.tar
wgrib2 ${fname%__grib2}_Ggis1km_Prr10lv_ANAL_grib2.bin -netcdf ${hhmm}.nc
@tenomoto
tenomoto / settings.py
Last active December 23, 2018 02:25
add password reset to django admin
# use console backend for development
# https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-EMAIL_BACKEND
# https://docs.djangoproject.com/en/2.1/topics/email/#django.core.mail.backends.smtp.EmailBackend
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# use admin site to login
# https://docs.djangoproject.com/en/2.1/ref/settings/#std:setting-LOGIN_URL
LOGIN_URL = '/admin/'
@tenomoto
tenomoto / nmdash.ahk
Created February 17, 2019 06:03
Send en- and em-dash
!-::Send {U+2013}
+!-::Send {U+2014}
@tenomoto
tenomoto / units.markdown
Created July 12, 2019 08:32
Install R package units on Mac
  • udunits2 is installed with MacPorts
$ curl -O https://mran.microsoft.com/snapshot/2018-08-01/src/contrib/units_0.6-0.tar.gz
$ sudo R CMD INSTALL units_0.6-0.tar.gz --configure-args='--with-udunits2-include=/opt/local/include/udunits2 --with-udunits2-lib=/opt/local/lib'
@tenomoto
tenomoto / install_owl_freebsd.md
Last active August 22, 2019 02:48
Install OCaml and Owl on FreeBSD

This gist describes steps to install the latest version of OCaml and Owl on FreeBSD. Tested with FreeBSD 12.0-RELEASE-p9 on Hyper-V/Windows 10 Pro 1903.

Install opam

Install opam as described How to install opan. EDIT the first line may not work. Install opam with pkg.

sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
opam init
eval $(opam env)
@tenomoto
tenomoto / maclike.ahk
Created March 1, 2020 20:45
Autohotkey script to send _ withouth shift and en/em dash with alt/alt+shift+-
SC073::_
; en-dash and em-dash
; https://my.wealthyaffiliate.com/pamdemonium/blog/how-to-create-em-dash-shortcut-using-autohotkey-on-windows
; conflicts with sending <- with alt+- in RStudio
!-::Send {U+2013}
+!-::Send {U+2014}
@tenomoto
tenomoto / x11-openssh.ps1
Created October 21, 2020 04:52
X11 forwarding from Windows 10 OpenSSH client in PowerShell
# Add the following in $profile
# OpenSSH-Win64 installed in Program Files
#$env:PATH += "$env:ProgramFiles/OpenSSH-Win64;"
# Windows 10 OpenSSH client
$env:PATH += "$env:SystemRoot/System32/OpenSSH;"
# X11
$env:DISPLAY = "localhost:0.0"