Skip to content

Instantly share code, notes, and snippets.

@macrat
macrat / image.go
Created November 9, 2017 05:25
golangでグラデーション作ったり、文字入れたり。
package main
import (
"image"
"image/color"
"image/png"
"os"
"golang.org/x/image/font"
"golang.org/x/image/font/basicfont"
@tomo-makes
tomo-makes / 20171217-docx-to-markdown-with-pandoc.md
Last active February 16, 2024 02:33
Wordファイル(.docx)をMarkdownへ変換する
$ pandoc -s <input>.docx --wrap=none --reference-links --extract-media=media -t gfm --filter ./despan.py -o <output>.md

いろいろと試した挙句、下記の観点でこれがベスト。

  • --wrap=none 勝手にwrapさせたくない(defaultではwrapしてしまう)
  • --reference-links
  • --extract-media=media docxに埋め込まれたpngなどを抽出できる
  • -t gfm github形式のmarkdownで出力したい(tableがpandoc defaultのmarkdownは他の形式になってしまう)
@atsunoda
atsunoda / crlfi_via_path_of_request-uri.md
Last active September 2, 2022 22:32
Request-URIのパスからのCRLFインジェクション
@atsunoda
atsunoda / analyzing_samy_xss_worm.md
Last active July 3, 2024 16:59
XSSワーム「Samy」の動作を解析する
@sloanlance
sloanlance / jq_tsv_conversion.md
Last active March 21, 2025 01:47
jq: JSONL → TSV conversion

jq: JSONL → TSV conversion

What is TSV?

TSV means "tab-separated values". I prefer this format over CSV ("comma-separated values") because it doesn't require as much quoting. Many programs that can use CSV formatted data can also use TSV, although they may need to be explicitly told of the different format if it's not detected automatically.

However, in any of the jq scripts below, "@tsv" can usually be replaced with "@csv" to get CSV output instead.

@atsunoda
atsunoda / impact_of_cookie_bomb.md
Last active September 2, 2022 22:34
CRLFインジェクションによるCookie Bombの脅威
@masatokinugawa
masatokinugawa / 0ctf_h4x0rs.space.md
Last active May 28, 2023 03:06
0CTF/TCTF 2018 Quals h4x0rs.space Writeup (Web 1000)

0CTF/TCTF 2018 Quals h4x0rs.space Writeup (Web 1000)

問題

I've made a blog platform let you write your secret. 
Nobody can know it since I enabled all of modern web security mechanism, is it cool, huh?

Get `document. cookie` of the admin.

h4x0rs.space
@c-bata
c-bata / kqueue_stdin_read.go
Last active May 14, 2019 21:51
Read user input from stdin using Kqueue
// kqueue reading sample for https://github.com/c-bata/go-prompt
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
@Informatic
Informatic / domain.xml
Last active May 4, 2025 08:51
How to use Windows 10 OEM license in libvirt VM (<smbios mode='host' /> does not work as Windows seems to verify UUID; apparmor/security configuration changes may be needed)
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<!-- ... -->
<qemu:commandline>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/slic.bin'/>
<qemu:arg value='-acpitable'/>
<qemu:arg value='file=/some/path/msdm.bin'/>
<qemu:arg value='-smbios'/>
<qemu:arg value='file=/some/path/smbios_type_0.bin'/>
<qemu:arg value='-smbios'/>
@mustafauysal
mustafauysal / docker-compose.yml
Created September 1, 2018 17:45
Graylog docker compose file
version: '2'
services:
# MongoDB: https://hub.docker.com/_/mongo/
mongodb:
image: mongo:3
# Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/5.6/docker.html
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.6.3
environment:
- http.host=0.0.0.0