Skip to content

Instantly share code, notes, and snippets.

@itkq
itkq / 3-4Q.csv
Last active August 22, 2017 14:44
後期輪講日程
Start Date Start Time End Date End Time Location Subject
2017/10/05 15:05 2017/10/05 16:35 Room 300 輪講 (B4*2)
2017/10/05 16:50 2017/10/05 18:20 Room 300 輪講 (M1)
2017/10/12 15:05 2017/10/12 16:35 Room 300 輪講 (M1)
2017/10/12 16:50 2017/10/12 18:20 Room 300 輪講 (M1)
2017/10/16 13:20 2017/10/16 14:50 Room 300 輪講 (D)
2017/10/23 13:20 2017/10/23 14:50 Room 300 輪講 (B4)
2017/10/23 15:05 2017/10/23 16:35 Room 300 輪講 (B4)
2017/10/26 15:05 2017/10/26 16:35 Room 300 輪講 (D)
2017/10/30 13:20 2017/10/30 14:50 Room 300 輪講 (M1)
require 'fileutils'
require 'nokogiri'
require 'open-uri'
BASE_URL = 'http://rst-project.com'
def ordinal n
case n
when 1
"1st"

Keybase proof

I hereby claim:

  • I am itkq on github.
  • I am itkq (https://keybase.io/itkq) on keybase.
  • I have a public key ASDBnNWJy8KGros0EwG_jp_VkMHCY-1YYK8sTjm8xUAshAo

To claim this, I am signing this object:

@itkq
itkq / calc_gakubu_average.js
Last active July 10, 2017 15:33
東工大編入生が自分の学部成績の真の平均点を知るためのスクリプト
count=sum=0;$('div.tableSet01 > div > table > tbody > tr > td:nth-child(5)').each(function(){point_str=$(this).text();if(point_str=="認定"){point = 60; count++;}else if(point_str == "合格"){point=0;}else{point=Number(point_str);count++}sum+=point;});console.log(sum/count);
[[snippets]]
description = "Get my ip address"
command = "curl ipconfig.io"
output = ""
#!/bin/bash
set -e
LIST_PATH=$HOME/.mfalist.encrypted
KEY_PATH=$HOME/.ssh/id_rsa
case $(uname) in
"Darwin") copy_cmd='pbdopy' ;;
"Linux" ) copy_cmd='xsel -bi' ;;
esac
require 'time'
def convert_zone(orig, to_zone)
original_zone = ENV["TZ"]
utc_time = orig.gmtime
ENV["TZ"] = to_zone
to_zone_time = utc_time.localtime
ENV["TZ"] = original_zone
to_zone_time
end
function tenki() {
local loc=${1:-大田区}
curl "wttr.in/$loc?0_lang=ja"
}
#!/bin/bash
ls /var/log/nginx/access.log-*.gz | tail -n 1 \
| xargs zgrep 404 | egrep 'php|admin|db|sql|struts' | awk '{print $1}' | uniq \
| awk '{$0="deny " $0 ";"; print}' >> /etc/nginx/dropip.conf
@itkq
itkq / docker-compose.yml
Created March 8, 2017 09:16
Dockerized Zabbix 2.4
version: '2'
services:
db-data:
image: busybox:latest
volumes:
- /var/lib/mysql
zabbix-db:
image: monitoringartist/zabbix-db-mariadb
environment:
- MARIADB_USER=zabbix