This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nana@hibiki:~$ sudo id | |
uid=0(root) gid=0(root) groups=0(root) | |
nana@hibiki:~$ sudo -u '#-1' id | |
uid=0(root) gid=1000(nana) groups=1000(nana) | |
nana@hibiki:~$ id | |
uid=1000(nana) gid=1000(nana) groups=1000(nana),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),108(lxd),114(netdev) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash -xe | |
BUCKET='gs://nana-youtube' | |
TEMPDIR=$(mktemp -d) | |
DATE=$(date +%s) | |
./youtube-dl -v -o "${TEMPDIR}/${DATE}-%(title)s-%(id)s.%(ext)s" "$1" | |
./youtube-dl -J "$1" | tee "${TEMPDIR}/${DATE}.json" | |
gsutil cp "${TEMPDIR}/*" ${BUCKET} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img[data-stringify-emoji*=parrot], img[data-stringify-emoji*=ultra], img[data-stringify-emoji*=fast], img[data-stringify-emoji*=yuma] { | |
filter: grayscale(1) blur(10px); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# どうせjsonっぽいものにしか使わないから有限長でしょ。 | |
STDIN=$(cat) | |
echo "${STDIN}" | jq "$@" > /dev/null 2>&1 | |
if [ $? -eq 0 ]; then | |
# 前段で出力をバッファしたりすると、色とかが消えちゃうのでもう一回実行する。 | |
echo "${STDIN}" | jq "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash -xeu | |
BUCKET='nana-camera' | |
: ${SLACK_WH:?'define SLACK_WH'} | |
report() { | |
local MSG=${1:-'コケた'} | |
curl -X POST --data-urlencode "payload={\"text\": \"${MSG}\"}" ${SLACK_WH} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'json' | |
require 'shellwords' | |
require 'net/https' | |
require 'uri' | |
MAHIRO = URI.parse "~~" | |
MORI = URI.parse "~~" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax enable | |
set expandtab | |
set tabstop=2 | |
set shiftwidth=2 | |
set softtabstop=2 | |
set autoindent | |
set smartindent | |
set number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1100101010000110001101100010111010100110001001101111101011111010101011110110000111000100000010011110000011000001000100001001111011011001101001001000001011000110010100000110001001010011000001011110000001101001000101001101111001010110011100010111011011010100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <memory> | |
#include "deflate.h" | |
#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES | |
#include "miniz.c" | |
// using std::begin; | |
// using std::end; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function date2str(date, sep) { | |
function pad(number) { | |
return number < 10 ? "0" + number : number.toString(); | |
} | |
return date.getYear() + sep + pad(date.getMonth()+1) + sep + pad(date.getDate()); | |
} | |
function toQif(date, desc, debit, credit, amount) { | |
return [ | |
"!Clear:AutoSwitch", |