Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Daisuke Sato Tiryoh

🏠
Working from home
View GitHub Profile
@Tiryoh
Tiryoh / add_target_blank_in_markdown.sh
Created Jun 15, 2021
A shell script to add target="_blank" option to link in Markdown text
View add_target_blank_in_markdown.sh
#!/usr/bin/env bash
set -eu
# (C) 2021 Daisuke Sato
# Released under the MIT License
# https://tiryoh.mit-license.org/2021
SRC_DIR=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)
# there is no Negative Lookahead in sed
@Tiryoh
Tiryoh / settings.json
Created Jul 29, 2020
CS+用VSCodeの設定
View settings.json
{
"files.encoding": "shiftjis",
"C_Cpp.default.defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"_VSCODE"
],
"C_Cpp.default.includePath": [
"${workspaceFolder}/**",
@Tiryoh
Tiryoh / setup-ds4drv.sh
Last active Aug 2, 2020
DualShock4のUbuntu用ドライバのセットアップ手順(Python3)
View setup-ds4drv.sh
#!/usr/bin/env bash
set -eu
# tested on Ubuntu 18.04.4
git clone https://github.com/ds4-driver/ds4drv.git
cd ds4drv
mkdir -p ~/.local/lib/python3.6/site-packages
python3 setup.py install --prefix ~/.local
sudo cp udev/50-ds4drv.rules /etc/udev/rules.d/
@Tiryoh
Tiryoh / raspimouse_read_mcp3208_via_spidev.py
Last active Jul 9, 2020
A Python script to read MCP3208 via spi0.0 on Jetson Nano
View raspimouse_read_mcp3208_via_spidev.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# raspimouse_read_mcp3208_via_spidev.py
# (C) 2020 Daisuke Sato@RT CORPORATION
# Released under the MIT License
# special thanks: https://www.denshi.club/pc/raspi/5raspberry-pi-zeroiot8a-d5mcp3208.html
import time
import spidev
@Tiryoh
Tiryoh / jetson_nano_install_archer_t2u_nano_driver.sh
Last active Mar 22, 2020
Jetson Nano USB WiFi dongle(Archer T2U Nano) driver installer
View jetson_nano_install_archer_t2u_nano_driver.sh
#!/usr/bin/env bash
set -eu
sudo apt update
sudo apt install --no-install-recommends dkms
mkdir -p ~/workspace
cd ~/workspace
git clone https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git
cd rtl8812AU_8821AU_linux
git checkout 4235b0ec7d7220a6364586d8e25b1e8cb99c36f1
sed -i -e "s/CONFIG_PLATFORM_ARM_JET_NANO = n/CONFIG_PLATFORM_ARM_JET_NANO = y/g" -e "s/CONFIG_PLATFORM_I386_PC = y/CONFIG_PLATFORM_I386_PC = n/g" Makefile
@Tiryoh
Tiryoh / kicad_gerber_renamer.sh
Last active Dec 3, 2020
rename scripts to rename KiCad gerber file to elecrow format
View kicad_gerber_renamer.sh
#!/usr/bin/env bash
set -eux
for filename in *Cu.gtl; do
if [[ -f $filename ]]; then
newfilename=$(echo $filename | sed -e 's/\(.*\)-F_Cu.gtl/\1.gtl/g')
mv $filename $newfilename
fi
done;
for filename in *Mask.gts; do
@Tiryoh
Tiryoh / room_map.pgm
Last active Dec 18, 2019
Rasperry Pi Mouse + ROS 2 Cartographer generated map
@Tiryoh
Tiryoh / raspbian_spi_i2c_enabler.sh
Created Oct 16, 2019
A script to enable SPI and I2C on Raspbian
View raspbian_spi_i2c_enabler.sh
#!/usr/bin/env bash
set -eu
# MIT License
# (c) 2017 Pimoroni Ltd.
# (c) 2019 Tiryoh
# function define
confirm() {
@Tiryoh
Tiryoh / ros_melodic_install_raspizero.bash
Created Oct 16, 2019
ROS Melodic installation on Raspberry Pi Zero/Raspberry Pi Zero W
View ros_melodic_install_raspizero.bash
#!/usr/bin/env bash
set -eu
# (C) 2019 Daisuke Sato
# https://tiryoh.mit-license.org/2019
# Special thanks to @nomumu
sudo apt update
sudo apt install -y build-essential gdebi
mkdir -p ~/tmp && pushd ~/tmp
@Tiryoh
Tiryoh / download_gazebo_models.sh
Last active Sep 30, 2020
A script to download Gazebo models from models.gazebosim.org manually
View download_gazebo_models.sh
#!/usr/bin/env bash
set -eu
# (C) 2019 Daisuke Sato
# https://tiryoh.mit-license.org/2019
function download_model(){
if [[ -d $HOME'/.gazebo/models/'$1 ]]; then
echo model $1 is ready.
else