Skip to content

Instantly share code, notes, and snippets.

View amane-katagiri's full-sized avatar

Amane Katagiri amane-katagiri

View GitHub Profile
@amane-katagiri
amane-katagiri / 203.178.132.107.txt
Last active September 26, 2017 16:28
信頼できる筋(?)
$ host 203.178.132.107
107.132.178.203.in-addr.arpa is an alias for 107.64.132.178.203.in-addr.arpa.
107.64.132.178.203.in-addr.arpa domain name pointer napt3.tsukuba.wide.ad.jp.
@amane-katagiri
amane-katagiri / scrape.fish
Created May 27, 2017 06:16
pixiv scraping tool
#!/usr/bin/fish
function init_cookie
set LOGIN_URL "https://accounts.pixiv.net/login"
set TMP1 (mktemp)
set TMP2 (mktemp)
set TMP3 (mktemp)
if [ (count $argv) -ge 1 ]
set COOKIE $argv[1]
else
@amane-katagiri
amane-katagiri / get_broadcasters_list.sh
Last active January 11, 2018 03:52 — forked from muyesh/radiko.sh
radikoをlinuxで聞いたり録音したりするやつ
#!/bin/bash
# http://radiko.jp/index/ から放送局のリストを取得
curl -Ss "http://radiko.jp/index/" \
| xmllint --xpath '//div[@class="content__rwd rwd channel-list"]//a' --html - 2>/dev/null | sed -e 's#</a>#</a>\n#g' \
| sed -e 's#<a href="/index/##g' | sed -e 's#</a>##g' \
| sed -e 's#/\?">#\t#g'
@amane-katagiri
amane-katagiri / shall-i-collide.py
Last active January 21, 2018 17:28
Create a PDF file with the same SHA-1 hash that displays two different images.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Create a PDF file with the same SHA-1 hash that displays two different images.
Works Cited ...
* JPEG: Still Image Data Compression Standard
* http://hp.vector.co.jp/authors/VA032610/JPEGFormat/markers.htm
Inspired by ...
@amane-katagiri
amane-katagiri / detect_replace.py
Last active March 28, 2018 10:11
魚拓サービスはIPを書き換えているか?
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from http.server import HTTPServer, SimpleHTTPRequestHandler
class EchoHandler(SimpleHTTPRequestHandler):
def make_response(self):
table = str.maketrans("0123456789.:", "〇一二三四五六七八九、:")
real_address = "{}:{}".format(*self.client_address)
response = "You are: {}\n\n{}".format(real_address, str(self.headers))
@amane-katagiri
amane-katagiri / yt-search.py
Created April 2, 2018 01:50 — forked from Igglybuff/yt-search.py
youtube-search
#!/usr/bin/python3
import urllib.request
import urllib.parse
import re
import sys
inargs = sys.argv
inargs.remove(inargs[0])
inargs = ' '.join(inargs)
@amane-katagiri
amane-katagiri / youtube-info
Last active April 2, 2018 02:19
お歌を聴く
#!/bin/bash -Cue
if [ "$#" -lt 1 ]; then
echo "usage: $0 YOUTUBE_URL_TO_GET_INFO" 1>&2
exit 1
fi
curl -SsL "$1" | grep -oP '(?<=<title>).+(?=</title>)'
@amane-katagiri
amane-katagiri / sshrc
Created June 27, 2018 02:25
/etc/ssh/sshrc
curl -Ss -d 'payload={"text": "'"$USER has logged on $(hostname) in from $SSH_CLIENT at `date +\"%Y/%m/%d %p %I:%M:%S\"`"'"}' "https://hooks.slack.com/services/TOKEN/TOKEN/TOKEN" >/dev/null
@amane-katagiri
amane-katagiri / shichihenge.css
Created June 27, 2018 05:07
You are the eighth alphabet.
@keyframes shichihenge {
0% {background-color: #ff0080;}
10% {background-color: #ff0000;}
30% {background-color: #ffff00;}
50% {background-color: #00ff00;}
70% {background-color: #00ffff;}
90% {background-color: #ff00ff;}
100% {background-color: #ff0080;}
}
@keyframes nanahenge {
@amane-katagiri
amane-katagiri / book.tex
Created July 26, 2018 02:51
縦書き本に横向き文字のmaketitleをしたかったが、TeX Live 2018.20180724から上手く行かなくなったように見える。
\documentclass[twocolumn,twoside,a5j]{ltjtbook}
\title{Title Name}
\author{作者 名前}
\makeatletter
\renewcommand\maketitle{
\onecolumn
\thispagestyle{empty}
\vspace*{\stretch{1}}