Skip to content

Instantly share code, notes, and snippets.

View usuyama's full-sized avatar
🎾

Naoto Usuyama usuyama

🎾
View GitHub Profile
@greymd
greymd / sudo新一.md
Last active April 25, 2024 06:34
sudo新一

 オレは高校生シェル芸人 sudo 新一。幼馴染で同級生の more 利蘭と遊園地に遊びに行って、黒ずくめの男の怪しげな rm -rf / 現場を目撃した。端末をみるのに夢中になっていた俺は、背後から近づいてきたもう1人の --no-preserve-root オプションに気づかなかった。 俺はその男に毒薬を飲まされ、目が覚めたら・・・ OS のプリインストールから除かれてしまっていた!

sudo がまだ $PATH に残っていると奴らにバレたら、また命を狙われ、他のコマンドにも危害が及ぶ』

 上田博士の助言で正体を隠すことにした俺は、 which に名前を聞かれて、とっさに『gnuplot』と名乗り、奴らの情報をつかむために、父親がシェル芸人をやっている蘭の $HOME に転がり込んだ。ところが、このおっちゃん・・・とんだヘボシェル芸人で、見かねた俺はおっちゃんになりかわり、持ち前の権限昇格能力で、次々と難タスクを解決してきた。おかげで、おっちゃんは今や世間に名を知られた名エンジニア、俺はといえばシェル芸 bot のおもちゃに逆戻り。クラスメートの convertojichattextimg にお絵かきコマンドと誤解され少年ワンライナーお絵かき団を結成させられる始末。

 ではここで、博士が作ってくれたメカを紹介しよう。最初は時計型麻酔 kill 。ふたについた照準器にあわせてエンターを押せば、麻酔シグナルが飛び出し、プロセスを瞬時に sleep させることができる。 次に、蝶ネクタイ型 banner 。裏についているダイヤルを調整すれば、ありとあらゆる大きさのメッセージを標準出力できる。必殺のアイテムなら fork 力増強シューズ。電気と磁力で足を刺激し、 :(){ :|:& };: でプロセステーブ

@usuyama
usuyama / launch_tensorboard_azureml.py
Last active June 3, 2020 19:32
Tensorboard with AzureML
'''
https://docs.microsoft.com/en-us/azure/machine-learning/how-to-monitor-tensorboard
make sure to install
pip install tensorflow azureml-tensorboard
Tensorboard logs need to be written in the logs folder by AML training runs.
SummaryWriter(log_dir="logs/test_run")
'''
@kaityo256
kaityo256 / howto.md
Last active April 2, 2024 14:43
研究者として生きていくコツ

研究者として生きていくコツ

これは卜部さんの優秀なプログラマーになるためのコツに影響されて書いたものです。

著者について

自分を構成する要素は、大きい順にシステムエンジニア、プログラマ、研究者だと思っています。でも、おそらく給料は「研究者」として払われているため、研究者として生きていくコツとしました。僕はさほど優秀とは言えませんが、とりあえずそれなりに長いことそれで食っています。大学の教授のウェブサイトに「研究者としてのコツ」みたいなことが書いてあることがありますが、これには「既に大学の教授になっている人が書いている」という強烈なバイアスがかかっています。もちろん参考になることも書いてありますが、「死ぬほど研究しろ、研究のことだけ考えろ」的な文章が多い印象です。これは普通の人にとって役に立たない助言です。これは平均的な研究者として生きていくための戯言、ポエムだと思ってください。

健康第一

@rverton
rverton / chrome_headless_screenshot.py
Created July 10, 2017 08:53
Make a screenshot with a headless google chrome in python
# Install chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
import os
from optparse import OptionParser
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
CHROME_PATH = '/usr/bin/google-chrome'
@luiscape
luiscape / install_packages.sh
Created January 16, 2017 14:36
Install Python dependency packages from requirements.txt using conda.
#
# Original solution via StackOverflow:
# http://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t
#
#
# Install via `conda` directly.
# This will fail to install all
# dependencies. If one fails,
# all dependencies will fail to install.
@antonlindstrom
antonlindstrom / spark-wordcount-sorted.py
Created March 13, 2014 16:47
Spark Wordcount Job that lists the 20 most frequent words
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@urschrei
urschrei / basemap_descartes.py
Last active November 6, 2020 02:49
How to plot Shapely Points using Matplotlib, Basemap, and Descartes
"""
required packages:
numpy
matplotlib
basemap: http://matplotlib.org/basemap/users/installing.html
shapely: https://pypi.python.org/pypi/Shapely
descartes: https://pypi.python.org/pypi/descartes
random
@Danik
Danik / capslock_remap_alt.ahk
Last active April 15, 2024 11:34
Autohotkey Capslock Remapping Script. Makes Capslock function as a modifier key to get cursor keys etc. on the left side of the keyboard, so you never have to move your hand to the right.
; Autohotkey Capslock Remapping Script
; Danik
; More info at http://danikgames.com/blog/?p=714
; danikgames.com
;
; Functionality:
; - Deactivates capslock for normal (accidental) use.
; - Hold Capslock and drag anywhere in a window to move it (not just the title bar).
; - Access the following functions when pressing Capslock:
; Cursor keys - J, K, L, I
@usuyama
usuyama / qsub_and_wait.sh
Created June 2, 2012 03:34
qsub and check qstat
#!/bin/bash
#$ -S /bin/bash
#$ -cwd
job_id=$(qsub $@ | ruby -ane 'print $F[2]')
while true
do
is_exist=$(qstat | ruby -ane "print 1 if \$F.first == '$job_id'")
if [ -z "$is_exist" ];then
break
@arq5x
arq5x / dbsnp-to-bed.sh
Created March 7, 2011 23:19
Make a BED file from the raw UCSC file
export GENOME=hg19
export SNPBUILD=131
curl -s http://hgdownload.cse.ucsc.edu/goldenPath/$GENOME/database/snp$SNPBUILD.txt.gz | \
zcat | \
cut -f 2,3,4,5,6,7,10,16 > dbsnp.$SNPBUILD.$GENOME.bed
head dbsnp.$SNPBUILD.$GENOME.bed
chr1 10433 10433 rs56289060 0 + -/C near-gene-5
chr1 10491 10492 rs55998931 0 + C/T near-gene-5
chr1 10518 10519 rs62636508 0 + C/G near-gene-5