Skip to content

Instantly share code, notes, and snippets.

View naoki-mizuno's full-sized avatar

Naoki Mizuno naoki-mizuno

  • Kobe, Japan
  • 07:20 (UTC +09:00)
View GitHub Profile
#!/bin/bash
TIMEOUT=9
while getopts "ht:" flag; do
case $flag in
t)
TIMEOUT="$OPTARG"
;;
h)
@naoki-mizuno
naoki-mizuno / dislocker-mount
Created March 25, 2022 01:34
Utility script for mounting BitLocker drives using dislocker
#!/bin/bash
DEVICE="$1"
MOUNT_DIR="$2"
PASSWORD="$3"
MY_UID="$( id -u )"
MY_GID="$( id -g )"
TEMP_DIR="$( mktemp -d )"
@naoki-mizuno
naoki-mizuno / sample.py
Last active February 26, 2021 10:37
Sample script to use command line arguments in Qt (QML)
#!/usr/bin/env python3
from PySide2.QtCore import Slot
from PySide2.QtCore import Signal
from PySide2.QtCore import QUrl
from PySide2.QtCore import QObject
from PySide2.QtGui import QGuiApplication
from PySide2.QtQml import QQmlApplicationEngine
from PySide2.QtQml import qmlRegisterType
#!/usr/bin/env python
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import cv2
import numpy as np
[Unit]
Description=ifup for NCXX USB Dongle (%I)
After=local-fs.target network-pre.target apparmor.service
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
DefaultDependencies=no
IgnoreOnIsolate=yes
StopWhenUnneeded=yes
[Service]
#!/usr/bin/env python
import rospy
import roslib.message
from geometry_msgs.msg import PoseStamped
import argparse
def parse_args():
description = 'Subscribe to a Pose and print C++ or Python code for it'
@naoki-mizuno
naoki-mizuno / make_code.bash
Created January 15, 2020 07:33
jsk_rviz_plugins Pictogram code generator
#!/bin/bash
# Path to metadata/icons.yml
FONTAWESOME_YML=$1
# Path to pictogram_font_mapping.h
PICTOGRAM_FONT_MAPPING=$2
echo "Generating C++ code from $FONTAWESOME_YML"
./to_cpp_code.py $FONTAWESOME_YML > ./new_code.cpp
@naoki-mizuno
naoki-mizuno / rpy2q
Last active August 3, 2023 03:07
Convert roll, pitch, yaw to quaternion
#!/usr/bin/env python
import tf.transformations as tft
import numpy as np
import sys
import argparse
def parse_args():
@naoki-mizuno
naoki-mizuno / charuco_webcam.py
Last active October 28, 2023 00:23
ChArUco calibration and detection using a webcam
#!/usr/bin/env python
import cv2
import numpy as np
import matplotlib.pyplot as plt
import glob
import random
import sys
@naoki-mizuno
naoki-mizuno / charuco_calib.py
Last active July 5, 2019 06:57
ChArUco calibration and detection from jpeg image files
#!/usr/bin/env python
import cv2
import numpy as np
import matplotlib.pyplot as plt
import glob
import random
import sys