Skip to content

Instantly share code, notes, and snippets.

View mamemomonga's full-sized avatar

Shotaro Takahashi mamemomonga

View GitHub Profile
@mamemomonga
mamemomonga / misoji-no-yoru.txt
Last active January 29, 2020 00:34
三十路の夜 / 尾崎豊
三十路の夜 / 尾崎豊
落書きのドキュメントと ツイッターばかり見てる俺
超高層ビルの箱の中 届かない夢を見てる
やりばのない 気持の扉破りたい
5ちゃんねるに書き込んだこと 見つかれば逃げ場もない
パソコンにむかい 背を向けながら
心のひとつもわかり合えない 上司達をにらむ
そして仲間達は今夜 バックレの計画をたてる
とにかくもう 会議や会社にはいたくない
@mamemomonga
mamemomonga / ffmpeg.md
Last active October 17, 2023 04:31
ffmpegメモ

ffmpegメモ

1080Pの動画の 70秒目から5秒ぶん切り出し、音声なし720Pに変換する

$ ffmpeg -ss 70 -i infile.mp4 -t 5 -vf scale=1280:-1 -an outfile.mp4

映像音声2倍速

-vf setpts=PTS/2.0 -af atempo=2.0 
@mamemomonga
mamemomonga / git-user.md
Last active December 16, 2019 06:23
Gitでgit config user.name, git config user.email を設定せず、環境変数で設定する

Gitでgit config user.name, git config user.email を設定せず、環境変数で設定する

export GIT_AUTHOR_NAME=ユーザ名
export GIT_AUTHOR_EMAIL=メールアドレス
export GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
export EMAIL=$GIT_AUTHOR_EMAIL
@mamemomonga
mamemomonga / !README.md
Last active December 14, 2019 15:58
まめもどん Advent Calendar 2019
@mamemomonga
mamemomonga / cloud-ssh.sh
Last active December 16, 2019 00:32
EC2, GCEを起動してsshfsでホームディレクトリをマウント、tmuxを起動し、tmuxをぬけるとsshfsをアンマウントしてインスタンスを終了するスクリプト
# こちらに移動
# https://github.com/mamemomonga/cloud-workspace-instance-starter
@mamemomonga
mamemomonga / debian-buster-setup.sh
Created December 11, 2019 13:42
Debian Busterセットアップスクリプト
#!/bin/bash
set -eu
# Build Essentialをインストールする
INSTALL_BUILD_ESSENTIAL=1
# Dockerをインストールする
INSTALL_DOCKER=1
if [ "$(id -u)" != 0 ]; then
@mamemomonga
mamemomonga / awscli.md
Last active December 11, 2019 12:47
AWSとawscliメモ

AWSとawscliメモ

Profile機能をつかって、複数のAWSアカウントを利用する

初期設定

$ aws configure --profile=myaws1

次回以降、ターミナルログインのたびに以下のコマンドを実行すれば、そのプロファイルが使用される

@mamemomonga
mamemomonga / xrdp.md
Created December 8, 2019 13:42
Ubuntu 18.04へのxrdpの導入と面倒なダイアログ削除

Ubuntu 18.04へのxrdpの導入と面倒なダイアログ削除

$ sudo apt install xrdp
$ sudo sh -c 'cat > /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf' << 'EOS'
polkit.addRule(function(action, subject) {
   if ((action.id == "org.freedesktop.color-manager.create-device" ||
        action.id == "org.freedesktop.color-manager.create-profile" ||
        action.id == "org.freedesktop.color-manager.delete-device" ||
        action.id == "org.freedesktop.color-manager.delete-profile" ||

action.id == "org.freedesktop.color-manager.modify-device" ||

@mamemomonga
mamemomonga / tmux-plus.md
Last active March 1, 2022 16:06
tmuxにおけるssh-agentの継続利用

tmuxにおけるssh-agentの継続利用

  • bin/run-tmuxというシェルスクリプトを経由して起動する。デタッチ後も以前のssh-agentを利用できるようにする。
  • セッションがあればattach、セッションがなければ新しいセッションを開始する
  • セッションがなければ、ssh-agentを起動し、SSH_AUTH_SOCK, SSH_AGENT_PIDを .ssh/tmux-ssh-agent に保存しtmuxセッションを開始する。
  • bash や zsh起動時には .ssh/tmux-ssh-agent の環境変数を読み込むことでssh-agentを利用可能にする。
  • セッション開始時に bin/run-tmux agent-killer を起動し、数秒おきにtmuxの終了をチェック、終了されていたらssh-agentを停止する。
  • ssh-agentのPIDが無効ならばファイルを削除する。

注意点