Skip to content

Instantly share code, notes, and snippets.

@kaz3w
kaz3w / color.sh
Created April 19, 2019 17:16
Color Code Sample
#!/bin/bash
#
# このファイルは、様々なカラーコードを端末にエコーし、どんな色が
# 使用可能かを示します。
# それぞれの行では、黒とグレイの背景の上に一つの色を示し、コードを中央に
# 表示しています。白、黒、グリーンの背景色で確認してあります。(2 Dec 98)
#
echo " On Light Gray: On Black:"
echo -e "\033[47m\033[1;37m White \033[0m\
1;37m \
@kaz3w
kaz3w / my_create_rsa256_2048bit_key.sh
Created April 24, 2019 12:51
Generating an RS256 key for Google Cloud IoT Core
#!/bin/sh
openssl genpkey -algorithm RSA -out rsa_private.pem -pkeyopt rsa_keygen_bits:2048
openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem
@kaz3w
kaz3w / prepare_librealsense_for_jetson_nano.sh
Created May 4, 2019 07:39
Prepare to build librealsense for Jetson NANO
#!/bin/sh
sudo apt install -y libxinerama-dev libvulkan-dev libxcursor-dev libgtk-3-dev
git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense/
mkdir build
cd build
cmake ..
make
@kaz3w
kaz3w / prepare-build-openpose.sh
Created May 6, 2019 07:58
openpose-build-preparation for Jetson NANO
#/bin/sh
sudo apt install python3-pip
cd local/src/openpose
pip3 install -r requirements.txt
pip3 install pycocotools
@kaz3w
kaz3w / raspivid_2_mp4.sh
Created May 7, 2019 06:33
Convert from RaspiVid output to MP4 (using mp4box)
#!/bin/sh
/usr/local/bin/MP4Box -fps 30 -add ${1} ${2}
@kaz3w
kaz3w / resolve_meta_release_lts_check_error.sh
Created May 12, 2019 08:46
Ubuntu 18. Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
sudo rm /var/lib/ubuntu-release-upgrader/release-upgrade-available
sudo /usr/lib/ubuntu-release-upgrader/release-upgrade-motd
@kaz3w
kaz3w / h264 -> mp4
Created June 24, 2019 03:06
convert all .264 to .mp4 with MP4Box
#!/bin/bash
for file in `find . -name "*.h264"`; do
/usr/local/bin/MP4Box -v -fps 30 -add $file ${file/h264/mp4}
done
@kaz3w
kaz3w / my_docker_rmi.sh
Created September 3, 2019 01:01
delete <none> tagged images
#!/bin/sh
for id in `docker images | grep 'none' | awk '/[0-9a-f]+/{ print $3 }'`
do
docker rmi -f $id
echo "remove image ID:" $id
done
docker images
@kaz3w
kaz3w / replace_with_sed.sh
Last active October 2, 2023 15:14
Replace string with sed
#!/usr/bin/bash
for file in `find . -maxdepth 1 -type f`; do /usr/bin/sed -i s/\"SymbolName\":\".*\",\"T/\"T/g $file
done