This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo chmod 666 /sys/bus/pci/devices/0000\:$1\:00.0/remove | |
sudo echo 1 > /sys/bus/pci/devices/0000\:$1\:00.0/remove | |
sudo chmod 666 /sys/bus/pci/rescan | |
sudo echo "1" > /sys/bus/pci/rescan |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch --tree-filter "rm -f <file>" HEAD | |
git filter-branch --tree-filter "rm -f -r <directory>/" HEAD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hex_str = '10010000214601360121470136007EFE09D21901' | |
sum = sum(int(b) for b in bytearray.fromhex(hex_str)) & 0xff | |
print(hex((0x100-(sum)) & 0xff)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* refer: https://support.typora.io/Custom-Font/ */ | |
#typora-source { | |
font-family: Utatane; | |
--monospace: Utatane; /* for code blocks and inline code inside source code mode */ | |
} | |
body { | |
--monospace: Utatane /* for all code blocks, inline code, and source code mode */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git filter-branch -f --env-filter "\ | |
GIT_AUTHOR_NAME='nv-h'; \ | |
GIT_AUTHOR_EMAIL='[email protected]'; \ | |
GIT_COMMITTER_NAME='nv-h'; \ | |
GIT_COMMITTER_EMAIL='[email protected]'; \ | |
" HEAD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PowerShell Core7でもConsoleのデフォルトエンコーディングはsjisなので必要 | |
[System.Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("utf-8") | |
[System.Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("utf-8") | |
# git logなどのマルチバイト文字を表示させるため (絵文字含む) | |
$env:LESSCHARSET = "utf-8" | |
# 音を消す | |
Set-PSReadlineOption -BellStyle None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.graph_objects as go | |
from datetime import datetime, timedelta | |
# Create figure | |
fig = go.Figure() | |
now = datetime.now() | |
print(now) | |
# Increment 1 hour |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setws . | |
set symbol [configapp -app fsbl define-compiler-symbols] | |
if {[string first "FSBL_DEBUG_INFO" $symbol] == -1} { | |
configapp -app fsbl -add define-compiler-symbols FSBL_DEBUG_INFO | |
projects -clean -type app -name fsbl | |
} | |
projects -build -type app -name fsbl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# https:/github.com/torvalds/linux/blob/master/Documentation/usb/gadget_configfs.txt | |
# http:/irq5.io/2016/12/22/raspberry-pi-zero-as-multiple-usb-gadgets/ | |
# 上記2つを参考に同時に二つのガジェットを有効化する。 | |
# 1. mass storageで、SDカードをUSBメモリとして見せる | |
# 2. rndisで、USBをetherデバイスとして見せる | |
# ドライバを依存関係含めてロード | |
modprobe usb_f_rndis |