Skip to content

Instantly share code, notes, and snippets.

@shirou
shirou / ssh_keyscan.yml
Last active March 6, 2025 06:47
run ssh-keyscan to add keys to known_hosts. This is a playbook for ansible
---
- hosts: all
gather_facts: no
sudo: no
tasks:
- name: run ssh-keyscan to add keys to known_hosts
local_action: shell ssh-keyscan {{ ansible_ssh_host }} >> ~/.ssh/known_hosts
@saitoha
saitoha / penetrate.py
Last active August 3, 2021 13:31
cat sixel file with penetrating GNU Screen
% screen
% cat test.png | pngtopnm | pnmquant 256 | ppmtosixel | ./penetrate.py && cat
% cat test.png | sixelconv | ./penetrate.py && cat
@saitoha
saitoha / graphics.c.diff
Created December 6, 2013 12:29
xterm: enable 256-colored sixel graphics for vt340 mode (with "-ti vt340" option)
--- xterm-300/graphics.c 2013-12-06 21:26:36.000000000 +0900
+++ xterm-300/graphics.c 2013-12-06 21:26:13.000000000 +0900
@@ -418,7 +418,7 @@
graphic->valid_registers = 4;
break;
case 340:
- graphic->valid_registers = 16;
+ graphic->valid_registers = 256;
break;
default:
# 私が考える安全なプログラムを書くために必要なこと
今も昔も「入力によって挙動が大幅に変わるAPI」が世の中には多数存在していて、プログラマが本来意図した挙動と異なる動作を引き起こしている。
- ファイルを開こうとしたらコマンドを実行できてしまったり
- CSSセレクタを書いてるつもりがHTMLタグを生成してしまったり
- SELECT文を発行するつもりがDELETE文を発行できてしまったり
こういったときに
- 入力値検証をしないと危険になる
@saitoha
saitoha / Makefile
Last active January 16, 2023 13:16
SIXEL color graphics DEMO (xterm pl#301 and gnuplot)
#
# SIXEL color graphics DEMO
#
# xterm pl#301 with --enable-sixel-graphics option
# gnuplot with --with-bitmap-terminals option
#
# Now the color palette of xterm VT-340 mode is limited to 16.
# If you want to change it to 256, apply the following patch.
# https://gist.github.com/saitoha/7822989/raw/20727b88f0f826bfcb9d644907944b29a456b67f/graphics.c.diff
#
@teramako
teramako / df.cmd
Last active August 29, 2015 13:56
Windows でディスク使用率等の一覧を表示する
@if(0)==(0) ECHO OFF
CScript //NoLogo //E:JScript "%~f0" %*
GOTO :EOF
@end
var COLUMN_INFOs = {
k: {
drive: { width: 5, align: "left" },
type: { width: 4, align: "left" },
total: { width: 14, align: "right" },
@yoheia
yoheia / perl_oneliner_example
Last active August 26, 2024 05:55
Perlワンライナー&マルチライナー集
Perl ワンライナーサンプル集
■概要
障害解析のためのログの調査、非互換対応でのソースコードの調査といった
テキスト処理で使った Perl ワンライナーのサンプル集です。
Perl ワンライナーは以下の点が良いと思います。
・Perl は Oracle Database (10g以降) に同梱されている。
 従って、Windows プラットフォームでも使える。
@saitoha
saitoha / LICENCE
Last active August 29, 2015 13:59
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2014 Hayaki Saito <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@yasushiyy
yasushiyy / vagrant_coreos_docker.md
Last active January 28, 2019 11:35
Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

Vagrant + CoreOS + Dockerを利用した開発環境セットアップ

MacOSX + Vagrant + CoreOS + Docker + Ubuntuの環境。

2014年6月11日時点での情報。

  • Version: CoreOS 343.0.0
  • Kernel: 3.14.5
  • Docker: 1.0
@deton
deton / dot.screenrc
Last active July 17, 2017 00:56
GNU screenで継続行をコピーする際に、`\`等を除く方法
bind g command -c buffilt
bind -c buffilt \\ eval writebuf screen 'stuff "scrbuf.sh rmwrap-emacs&&exit^M"'
bind -c buffilt > eval writebuf screen 'stuff "scrbuf.sh rmwrap-vim&&exit^M"'
bind -c buffilt + eval writebuf screen 'stuff "scrbuf.sh rmwrap-mutt&&exit^M"'
bind -c buffilt ^E eval writebuf screen 'stuff "scrbuf.sh rmwrap-width&&exit^M"'
bind -c buffilt $ eval writebuf screen 'stuff "scrbuf.sh picklastarg&&exit^M"'
bind -c buffilt ' ' eval writebuf screen 'stuff "scrbuf.sh join-with-blank&&exit^M"'
bind -c buffilt e eval writebuf screen 'stuff "scrbuf.sh edit&&exit^M"'
bind -c buffilt g eval writebuf screen 'stuff "scrbuf.sh grep2l&&exit^M"'
bind -c buffilt h eval writebuf screen 'stuff "scrbuf.sh rmhtmltag&&exit^M"'