Skip to content

Instantly share code, notes, and snippets.

View shinkbr's full-sized avatar
:shipit:
'"><svg/onload=alert()>{{7*7}}

Shintaro Kobori shinkbr

:shipit:
'"><svg/onload=alert()>{{7*7}}
View GitHub Profile
@shinkbr
shinkbr / kazuha_precure.sh
Last active August 29, 2015 14:01
パンツ先生のプリキュア芸術の取得
#!/bin/sh
# 実行したディレクトリにパンツ先生のプリキュア芸術の泉を爆誕させる
# http://diary.fc2.com/cgi-sys/ed.cgi/kazuharoom/
usage(){
echo "Usage: `basename $0` YEAR(yyyy) [MONTH(m)]"
exit 1
}
@shinkbr
shinkbr / numbers.rb
Last active August 29, 2015 14:10
SECCON 2014 online qualifiers: Numbers
#!/usr/bin/env ruby
# coding: utf-8
require 'socket'
s = TCPSocket.open('number.quals.seccon.jp', 31337)
count = 1
while line = s.readline('?')
puts line
@shinkbr
shinkbr / private.xml
Last active August 29, 2015 14:11
private.xml for Karabiner
<?xml version="1.0"?>
<root>
<item>
<name>Control+[ to EISUU+Escape</name>
<identifier>private.lctrl_lbracket.escape_eisuu</identifier>
<autogen>
__KeyToKey__
KeyCode::BRACKET_LEFT, ModifierFlag::CONTROL_L,
KeyCode::ESCAPE, KeyCode::JIS_EISUU
</autogen>
#!/usr/bin/env ruby
# coding: utf-8
h1 = Hash.new(0)
h1[:a] += 1
p h1 #=> {:a=>1}
h2 = Hash.new({a: 0})
h2[:a][:a] += 1
p h2 #=> {}
@shinkbr
shinkbr / configure-dock.sh
Last active December 14, 2022 18:38
Configure the macOS dock
#!/usr/bin/env bash
# Configure the macOS dock
defaults delete com.apple.dock
killall Dock
sleep 5
defaults write com.apple.dock autohide -bool yes
defaults write com.apple.dock minimize-to-application -bool yes
@shinkbr
shinkbr / rand.sh
Last active January 21, 2018 18:41
generate random string with a given byte size
#!/usr/bin/env bash
num=4
if [[ "${1}" -gt "0" ]]; then
num="${1}"
fi
openssl rand -hex "${num}"
@shinkbr
shinkbr / uri.sh
Last active November 20, 2017 02:18
URI encode / decode strings.
#!/usr/bin/env bash
usage () {
echo "Usage: $( basename $0 ) <e|d>"
}
if [ "$#" -ne 1 ]; then
usage
exit 1
fi
@shinkbr
shinkbr / query.sh
Last active November 20, 2017 02:19
Extract and split URL query parameters
#!/usr/bin/env bash
read uri
query=${uri##*\?}
echo -n "$query" | tr "&" "\n"

Keybase proof

I hereby claim:

  • I am shinkbr on github.
  • I am shinkbr (https://keybase.io/shinkbr) on keybase.
  • I have a public key ASBsCQn4yQsMGCbliF0qFt3zEUj1FjLnObjjDNV4UqNo8Ao

To claim this, I am signing this object:

@shinkbr
shinkbr / password.rb
Created January 21, 2018 20:19
Generate random and complex passwords
#!/usr/bin/env ruby
# coding: utf-8
length = 12
if ARGV.size > 0 && (ARGV[0].to_i.to_s == ARGV[0]) &&
ARGV[0].to_i >= 4 && ARGV[0].to_i <= 128
length = ARGV[0].to_i
end