Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ktkr3d
ktkr3d / encode_decode_uri.html
Created October 29, 2021 08:53
Encode / Decode URI
<html>
<head>
<title></title>
</head>
<body>
<form name="f01">
<div>
<textarea name="ta01" rows="3" placeholder="Input encoded URI!" style="width:60%"></textarea>
<input type="button" value="decodeURI" onclick="document.f01.ta02.value=decodeURI(document.f01.ta01.value)" />
<input type="button" id="btn02" value="copy" />
@ktkr3d
ktkr3d / addtime.sh
Created August 22, 2020 06:43
ファイルのタイムスタンプ(YYYYMMDD-hhmmss)をファイル名の先頭に追加する。
#!/bin/bash
mkdir -p renamed
while read -d $'\0' file; do
file=`echo "${file}" | sed 's!^.*/!!'`
timestamp=`date "+%Y%m%d-%H%M%S" -r "${file}"`
mv "${file}" ./renamed/${timestamp}_"${file}"
done < <(find . -mindepth 1 -maxdepth 1 -type f -print0)
.\" ~/man/ja/manl/shortcuts.l
.TH SHORTCUTS "1" "2020年8月" "shortcuts 0.1" "チートシート"
.SH 名称
shortcuts \- Linux 端末キーボードショートカットのチートシート
.SH Ctrl 系
Ctrl+A カーソルを行頭へ移動 (Home)
.br
Ctrl+B カーソルを前の文字へ移動 (Left)
.br
# insert date & time in japanese
days = ["日", "月", "火", "水", "木", "金", "土"]
insertDateTime = () ->
d = new Date
year = d.getFullYear()
month = d.getMonth() + 1
date = d.getDate()
hour = d.getHours()
min = d.getMinutes()
#!/bin/sh
# time sync over proxy
date -s "`wget -q -O - https://ntp-a1.nict.go.jp/cgi-bin/time`"
# proxy authentication setting to 'proxy.example.com:8080'
alias proxy='read -p "user: " proxy_user && read -sp "pass: " proxy_pass && echo && export {http,https,ftp}_proxy="http://$proxy_user:$proxy_pass@proxy.example.com:8080"'
# Update installed packages
alias upd='sudo apt update -y && sudo apt dist-upgrade && sudo apt autoremove -y'
# Change locale
alias en='export LC_ALL=en_US.UTF8'
alias ja='export LC_ALL=ja_JP.UTF8'