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
folder=mwc_$(date +%s%N) | |
mkdir $folder | |
cd $folder | |
sudo apt-get -qq --assume-yes install minify npm | |
eval npm install \ | |
@material/mwc-button \ | |
@material/mwc-checkbox \ | |
@material/mwc-circular-progress \ |
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
#!/usr/bin/env python | |
""" | |
Problem statement: Find the three digit number | |
147 - One digit is right but in the wrong place | |
189 - One digit is right and in its place | |
964 - Two digits are correct but both are in the wrong place | |
523 - All digits are wrong | |
286 - One digit is right but in the wrong place | |
""" |
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
function toYAML(src, pad=0, nested_list=false){ | |
function f(i, nested_list, size){ | |
if (i == 0 && !nested_list) return `\r\n${" ".repeat(size)}` | |
else if(i != 0) return `${" ".repeat(size)}` | |
return "" | |
} | |
var tabsize = 2 | |
var dst = "" | |
if(Array.isArray(src)){ | |
src.forEach(function(s, i){ |
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
export ROS_PYTHON_VERSION=3 | |
sudo apt-get install python3-rosdep2 python3-rosinstall-generator python3-wstool | |
rosinstall_generator ros_comm --rosdistro noetic --deps --tar > ros.rosinstall | |
wstool init -j8 src ros.rosinstall | |
rosdep install -r -y --from-paths src --ignore-src --rosdistro noetic | |
catkin_make_isolated --install -DCATKIN_ENABLE_TESTING=0 | |
# rosinstall_generator common_msgs geometry navigation --rosdistro noetic --deps --tar > extras.rosinstall | |
# wstool merge -t src extras.rosinstall | |
# wstool update -t src |
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
# linux-meson.com/doku.php#howto | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig | |
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image dtbs | |
mkimage -A arm64 -O linux -T kernel -C none -a 0x1080000 -e 0x1080000 -n linux-next -d arch/arm64/boot/Image ../uImage | |
cp arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dtb ../uImage BOOT_PARTITION | |
# ROOTFS_PARTITION can be any arm64 Linux root filesystem |
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
#!/usr/bin/env python3 | |
import argparse | |
import usb | |
def find_interface(dev): | |
for config in dev: | |
for iface in config: | |
ep_out, ep_in = None, None | |
for ep in iface: |
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
cython3 --embed src.py --output-file dst.c | |
g++ dst.c -I/usr/include/python -L/usr/lib/x86_64-linux-gnu -lpython |
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
wget http://developer.download.nvidia.com/embedded/L4T/r21_Release_v5.0/source/kernel_src.tbz2 | |
tar -xpf kernel_src.tbz2 |
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
sudo apt-get remove openjdk-* | |
sudo apt-get install openjdk-8-jdk-headless | |
# Download from https://developer.android.com/studio#command-tools | |
wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip | |
unzip commandlinetools-linux-*_latest.zip | |
mkdir ~/Android | |
mv tools ~/Android | |
echo "export ANDROID=$HOME/Android" >> ~/.bashrc |
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
nvidia-smi -lms 500 | grep Default --line-buffered | cut -c36-70 |
OlderNewer