Skip to content

Instantly share code, notes, and snippets.

View kakkun61's full-sized avatar
🚂
Choo-choo

Kazuki Okamoto kakkun61

🚂
Choo-choo
View GitHub Profile
@kakkun61
kakkun61 / wsl-hosts.ps1
Last active August 10, 2022 02:50 — forked from MichaelBelgium/wsl2-hosts-sync.ps1
WSL v2 windows hosts sync (powershell - updates domains to wsl2 ip)
If (!(New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host 'Run this as administrator.'
$choice = Read-Host 'Do you want to re-run this as administrator? [y/N]'
if ($choice -ne 'y') {
exit 1
}
$actualScriptRoot = $PSScriptRoot
if ((Get-Item $PSCommandPath).Target) {
$actualScriptRoot = Split-Path -Parent ((Get-Item $PSCommandPath).Target)
}
@kakkun61
kakkun61 / tmux_and_xsel.md
Last active May 21, 2019 02:43 — forked from pn11/tmux_and_xsel.md
リモートのtmuxのコピーモードとクリップボードを共有する

リモートのtmuxのコピーモードとクリップボードを共有する

  • ローカルマシン: Mac (iTerm2)
  • リモートマシン: Linux (ROOT権限なし)

という状況でtmuxのコピーモードでコピーしてきたものをMacで扱いたい。

C-b zでズームしてからoptionキー押しながらマウスでコピーでもいいんだけど(iTerm2のみ?、ズームしないと複数行コピーするときに隣のペインも選択してしまう)、キーボードだけでやりたい。そこでxselを使う。