Skip to content

Instantly share code, notes, and snippets.

View kachick's full-sized avatar
😋
😪

Kenichi Kamiya kachick

😋
😪
View GitHub Profile
@kachick
kachick / podman-shell.nix
Created March 29, 2024 07:03 — forked from adisbladis/podman-shell.nix
Use podman within a nix-shell
{ pkgs ? import <nixpkgs> {} }:
let
# To use this shell.nix on NixOS your user needs to be configured as such:
# users.extraUsers.adisbladis = {
# subUidRanges = [{ startUid = 100000; count = 65536; }];
# subGidRanges = [{ startGid = 100000; count = 65536; }];
# };
@kachick
kachick / AuthyToOtherAuthenticator.md
Created February 13, 2024 18:56 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


*update: This might affect how easy it is to use this technique past August 2024: https://www.theverge.com/2024/1/8/24030477/authy-desktop-app-shutting-down


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

@kachick
kachick / ForkMITLicensedProject.md
Created July 1, 2022 13:17 — forked from fbaierl/ForkMITLicensedProject.md
HOWTO fork a MIT licensed project

No, you are not allowed to change the copyright notice. Indeed, the license text states pretty clearly:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

But you are allowed to add a copyright notice.

If you want to keep the MIT license, which is what I would advise you to do, you only need to add a single line to the license file, before or after Copyright (c) 2012 Some Name with your own copyright notice. The final LICENSE file will look like this:

The MIT License (MIT)

@kachick
kachick / README.md
Created July 30, 2018 12:34
pg gem のインストール時にpg_config ~ libpq-feでコケたら

TL;DR

gem install pg -v '0.21.0' --source 'https://rubygems.org/' -- --with-pg-config=/usr/local/Cellar/postgresql@9.4/9.4.18/bin/pg_config

こんなエラーが出たときに上記で解消した。

gem install pg -v '0.21.0' --source 'https://rubygems.org/'
@kachick
kachick / failed-capybara-webkit-on-mac.md
Created April 12, 2017 12:06
gem install capybara-webkit が Mac でコケたら

ぐぐると xcode とか qt とか色々出て来て、手当たり次第やってたら直った。 なのでどれかが不要かもだけど、取り敢えず関係しそうな事的には

  • brew install qt@5.5 # 5.6以降で fail なのが罠なので、多分これが原因っぽい
  • qmake --version で 5.5 使われているか確認。
  • xcode 立ち上げて component install # 関係ないかも
@kachick
kachick / use-old-mongodb.md
Last active July 28, 2018 03:27
古いmongodb を MacOSX + homebrew で使う
brew unlink mongodb
brew install homebrew/versions/mongodb32
brew info mongodb
mongod --version
# kill -9 で 古いmongod殺した。
brew link homebrew/versions/mongodb32
brew services start homebrew/versions/mongodb32
@kachick
kachick / ruby-hash-splat.md
Created December 29, 2016 08:58
ruby で hash の splat merge (っていうのか知らないけど) する時は 2.2 からにしといた方が無難

キーワード引数対応あたりから、 ruby でも hash の splat で merge 出来るようになってたのをすっかり見落としてた。 でも https://bugs.ruby-lang.org/issues/10315 が気になるので、使う時は 2.2 からにしといた方が良さそう(最近古いの触らないけど)

ruby -e 'h1={a: 1, b: 1, c: 1}; h2={b: 2, c: 2, d: 2}; p({ **h1, **h2, a: 3 })'

on ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-darwin16.0]

@kachick
kachick / tips_atom.md
Created October 5, 2016 10:58
しょぼい Atom 周りの tips

Atom

  • cmd + k の後にキーを離して上下左右で、そちらへのペイン分割。移動はcmd + k の後にキーを離して cmd + n/p。とじはcmd + k の後にキーを離してcmd + w
  • ctrl + cmd + m で現在の カッコ内を全選択。 大カッコとかも含むんで、配列の中ぜん選択とかもできて便利!
  • alt + cmd + . で 直近のタグを閉じる
@kachick
kachick / tips_mac_os_x.md
Created October 5, 2016 10:57
しょぼい Mac OS X 周りの tips

Mac OS X

  • http://qiita.com/ogomr/items/71e4d2024794ea08d978 でまずはキーの読み方覚えないとイカン。
  • cmd + ctrl + d: Mac標準搭載の辞書で選択箇所の訳が出る。イイ
  • command + option + D で dock の on/off
  • ⁠⁠⁠⁠sudo nvram boot-args=niog=1 で、閉じず(クラムシェルモード)に外部ディスプレイへ出せる?
  • open . で、カレントディレクトリを finder で開ける