Skip to content

Instantly share code, notes, and snippets.

@michikora
michikora / tmux-migrate-options.py
Created June 5, 2021 18:31 — forked from tbutts/tmux-migrate-options.py
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
@michikora
michikora / gist:537a353fc05fe37ee4adcc34fd206acb
Created September 13, 2018 17:29
swapファイルの作り方

スワップファイルの作成

システムの稼動中などに,一時的にスワップ領域を確保したい場合などにスワップファイルを作成します。そして,作成したファイルをスワップ領域に追加をします。

(1)スワップファイルの作成

コマンドオプションの「of」にファイルのパスを指定して「bs」に基準となる容量の単位を指定して「count」にbsの量を指定します。

# dd if=/dev/zero of=作成するファイル名 bs=ブロックサイズ(byte) count=ブロック数

Upgrading to Ubuntu 17.10 on WSL

Note: This workaround is no longer necessary in Windows 10 Insider build 17046 and later. As of 2018-02-07, the patch hasn't yet made it to stable.

  1. Upgrade with do-release-upgrade, as you normally would. It will error out and leave your system in a partially upgraded state.
  2. Close all WSL terminals and ensure that all WSL processes have terminated
  3. Run as a normal user (not root): wget -O - https://gist.githubusercontent.com/Zenexer/10bc12fa5c99848b4b2150184f6beee5/raw/ubuntu-fix.sh | sh -s
  4. Answer any prompts (sudo password, version disambiguation)
  5. If there are errors, resolve them and re-run the script. It is idempotent, meaning that it is safe to run any number of times, even if it only partially completes.