Skip to content

Instantly share code, notes, and snippets.

@yue82
yue82 / matrix2qr.py
Created August 27, 2016 18:07
IceCTF Matrix writeup
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import Image
import numpy as np
def hex2bin(hexmat):
binmattemp = [bin(m)[2:] for m in hexmat]
rowlen = max([len(m) for m in binmattemp])
binmat = [[0]+[int(b) for b in row.zfill(rowlen)] for row in binmattemp]
@yue82
yue82 / iosdc2019_heatmap_crop.py
Last active September 11, 2019 05:17
iOSDC 2019 NOC heatmap 01
# -*- coding: utf-8 -*-
import os
from PIL import Image
import numpy as np
def find_edge(pix_line, pix_th):
edge1, edge2 = 0, len(pix_line)
for i, pix in enumerate(pix_line):
@yue82
yue82 / iosdc2019_heatmap_clients.py
Last active September 10, 2019 17:14
iOSDC 2019 NOC heatmap 02
# -*- coding: utf-8 -*-
import os
from PIL import Image, ImageDraw, ImageFont
import pyocr
import pyocr.builders
def read_clients_number(image_dir, num_list, left, top, width, height, ext='png'):
clients_file = '{}/clients.csv'.format(image_dir)
@yue82
yue82 / reiwa_q.py
Last active May 2, 2019 06:16
reiwa ctf zero ha?
# -*- coding: utf-8 -*-
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('zerois-o-reiwa.seccon.jp', 23615))
for num in range(100):
data = ''
while data[:2] != '0=':
data = s.recv(1024)
@yue82
yue82 / next_week.sh
Created May 19, 2018 09:41
generate weekly memo
#! /bin/bash
year=`date +%Y`
month=`date +%m`
day=`date +%d`
weekday=5
next_weekstartday=3
if [ -z $1 ]; then
@yue82
yue82 / daily.sh
Last active May 19, 2018 09:40
generate daily memo
#! /bin/bash
year=`date +%Y`
month=`date +%m`
day=`date +%d`
if [ ! -e ~/memos/$year"_"$month ]; then
mkdir ~/memos/$year"_"$month
fi
@yue82
yue82 / post_slack_prog_btn.py
Created July 8, 2016 16:53
Slack Progress Checker with Interactive Button
# -*- coding: utf-8 -*-
import requests
import json
from datetime import date
def make_month_prog_msg(work):
grades = ['B4', 'M1', 'M2']
month = date.today().month
return '{}さん,{}の進捗どうですか?'.format(grades[month%3], work)
@yue82
yue82 / qr2txt.py
Last active March 20, 2018 06:36
ksnctf C92 E1 Mysterious Light
# -*- coding: utf-8 -*-
from PIL import Image
dth, lth = 50, 175
marks = {'dark': 'X', 'light': '_', 'unknown': '?'}
def get_pix(filename):
with Image.open(filename) as img:
@yue82
yue82 / SupporterzColab_2017_1025_blockchain.md
Last active October 26, 2017 05:42
サポーターズCoLab勉強会 ブロックチェーンの基本の「き」 2017.10.25 memo
@yue82
yue82 / NaniwaTECH_2016_1218_1_gpu.md
Last active September 24, 2017 07:30
なにわTECH道 2016.12.18 memo

GPUの基礎知識 アーキテクチャと歴史

なつたんさん

GPU

  • フリンの分類ではSIMD

  • ベクトル計算に強い

  • CUDA(Compute Unified Device Architecture)