Skip to content

Instantly share code, notes, and snippets.

View michikora's full-sized avatar

michikora michikora

  • In front of a monitor
  • 22:34 (UTC +09:00)
View GitHub Profile
@michikora
michikora / dl_requests_tqdm.py
Created April 16, 2025 11:52 — forked from yanqd0/dl_requests_tqdm.py
Python requests download file with a tqdm progress bar
import requests
from tqdm import tqdm
def download(url: str, fname: str, chunk_size=1024):
resp = requests.get(url, stream=True)
total = int(resp.headers.get('content-length', 0))
with open(fname, 'wb') as file, tqdm(
desc=fname,
total=total,
@michikora
michikora / vnc_install.sh
Created March 30, 2025 20:56 — forked from x43x61x69/vnc_install.sh
Steam Deck VNC Installation
#!/bin/bash
#
# Script for installing x11vnc on Steam Deck.
#
# Install:
#
# sh -c "$(curl -fsSL https://gist.githubusercontent.com/x43x61x69/9a5a231a25426e8a2cc0f7c24cfdaed9/raw/vnc_install.sh?$RANDOM)"
#
# This will modify root filesystem so it will probably get
# overwrite on system updates but is totally ok executing
@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=ブロック数