Skip to content

Instantly share code, notes, and snippets.

@adujardin
adujardin / install_cudnn.sh
Created July 11, 2018 10:26
Install cuDNN on linux
#!/bin/bash
set -e
NONE='\x1b[m'
BOLD='\x1b[1m'
RED='\x1b[31m'
ITALIC='\x1b[3m'
tmp_folder="/tmp/cudnn_install"
@adujardin
adujardin / gen_randstr_and_cpy.sh
Created July 25, 2018 09:24
Generate random string and put them int the clipboard in a loop
#!/bin/bash
while true
do
random_str=" $(cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 15 | head -n 1)"
echo $random_str
echo -ne " $random_str" | xclip -selection c
sleep 0.1
done
@adujardin
adujardin / Loader.cpp
Created July 26, 2018 16:30
Dynamic loading of a lib
#define MAJOR_VER 1
#define MINOR_VER 0
#ifdef _WIN32
#define WINDOWS
#endif
#ifdef WINDOWS
#include <Windows.h>
#include <delayimp.h>
@adujardin
adujardin / mount_ext4.sh
Created July 30, 2018 12:37
Mount partition fstab
#https://ubuntuforums.org/showthread.php?t=1145596
# Make mounting point
sudo mkdir /mnt/mountpoint # Pick the name for "mountpoint" and use it throughout
sudo chown -R ${USER}: /mnt/mountpoint # Example: sudo chown -R john: /mnt/mountpoint
# find UUID
sudo blkid | grep "sdb1" # assuming it's sdb1
# edit fstab
@adujardin
adujardin / jetpack_auvidea_j120_tx2.sh
Last active August 13, 2019 16:47
Patch the jetpack for the auvidea carrier board J120 and Tegra X2 https://auvidea.com/firmware/
#/bin/bash
# https://auvidea.com/firmware/
path_jetpack="./64_TX2/"
backup_folder="./64_TX2_backup_files/"
patch_name="auvidea-kernel-J90-J120-v1.6"
wget "http://www.auvidea-pcb.com/firmware/tx2/1.6/${patch_name}.zip"
unzip "${patch_name}.zip"
// From the excellent answer here : https://stackoverflow.com/a/17955149/7036639
/*
* daemonize.c
* This example daemonizes a process, writes a few log messages,
* sleeps 20 seconds and terminates afterwards.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@adujardin
adujardin / ccache_setup.sh
Created August 23, 2018 13:19
ccache setup ubuntu
#https://askubuntu.com/a/470636/609717
# Install package
sudo apt install -y ccache
# Update symlinks
sudo /usr/sbin/update-ccache-symlinks
# Prepend ccache into the PATH
echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc
@adujardin
adujardin / multi_zed.py
Created September 13, 2018 09:02
Python sample to open 2 ZED with the ZED SDK (https://github.com/stereolabs/zed-python)
import cv2
import pyzed.camera as zcam
import pyzed.types as tp
import pyzed.core as core
import pyzed.defines as sl
def main():
print("Running...")
init = zcam.PyInitParameters()
@adujardin
adujardin / filter_yolo_coco_class.sh
Last active September 10, 2021 11:48
Filter yolo coco class with class id remapping
#!/bin/bash
# Assume coco folder from YOLO
coco_original_path="/path/to/coco"
coco_new_path="/path/to/coco_customclass"
mkdir -p ${coco_new_path}
cp -R ${coco_original_path}/annotations ${coco_new_path}/
cp -R ${coco_original_path}/common ${coco_new_path}/