Skip to content

Instantly share code, notes, and snippets.

View codieboomboom's full-sized avatar
💻
Getting Rusty

Boom codieboomboom

💻
Getting Rusty
View GitHub Profile
@codieboomboom
codieboomboom / 4 - Data Wrangling
Last active August 8, 2020 03:26
Answers for Missing Semester by MIT
#Find words that has at least 3 A or a and does not end with 's. What is the most 2 character ending ?
grep -E "\w*[Aa]\w*[Aa]\w*[Aa][^\']$" /usr/share/dict/words | sed -E 's/.*(..)$/\1/' | sort | uniq -c | sort
# Calculating the avaerage start up time using journalctl log
journalctl | grep "Startup finished"|grep "kernel" | sed -E "s/^.*Startup finished in ([0-9]*\.[0-90]*)s \(kernel\).*$/\1/"
#syntax for inplace substitution
sed -i 's/regrex/substitution/' input.txt
#List out messages that are not common amongst the past 3 boot
#Step 1: find and extract messages from the past 3 boot:
for i in 0 -1 -2; do journalctl -b $i > boot_log.txt; done
Qns 1:
`journalctl -b | grep -i sudo` #find in the latest boot, what is the sudo command (can see that after execute that, the sudo session will be ended)
Qns 3:
`for f in ./*.m3u` #instead we use globbing here
Qns 5:
# Usage of cProfile:
`python3 -m cProfile sorts.py`
#Qns 1:
log2(100000C4) ~= 61 bits , takes 73117802169.4 years to crack if 10000 pwd per secs
log2(62c8) ~= 31 bits, takes about 68 years to crack
which one safer depends on the threat model (online or offline, any restriction in timing, whether they have access to the dictionary or not)
@codieboomboom
codieboomboom / jetson_xavier_nx_getting_started.md
Last active May 28, 2021 03:58
Getting started with Jetson Xavier NX
  1. Prepare an empty SD card for flashing OS image, monitor, keyboard, mouse, ethernet connection and a M2 SSD (optional) for storage of data purpose
  2. Download the SD card image from https://developer.nvidia.com/embedded/downloads (for xavier nx)
  3. Flash the os image onto the SD card (using something like balena etcher(https://www.balena.io/etcher/))
  4. Insert SD card into the jetson xavier nx and power it on (take note of pin J18 that must not be shorten)
  5. Follow instructions by Ubuntu 18.04LTS installation wizard to fully set up the jetson xavier nx kit.
  6. On first boot-up, make sure your ssd is formatted properly and is mounted.
  7. Configure of environment for development: a. Follow this guide by jkjung(https://jkjung-avt.github.io/setting-up-xavier-nx/). Only first step is important, the rest depends on your need b. (Optional) Clone a dotfile repo(https://github.com/AnhTuDo1998/dotfiles) (something i use to sync up my bash tools and environments across different machine) c. Run the setup.sh in
@codieboomboom
codieboomboom / jetson_xavier_nx_ros_install
Last active January 13, 2021 07:50
Install ROS and other tools, dependency for xavier nx
Note: ROS melodic use opencv3.2 by default while the kit software came with opencv4.1.1 pre-installed. Follow this guide to uninstall that. the opencv3.2 stable will be installed tgt with desktop-full of ros-melodic
How to uninstall opencv 4.1.1 (https://forums.developer.nvidia.com/t/trouble-with-catkin-make-hector-slam/126470) last comment.
1. Install ROS (Melodic for Ubuntu 18.04 LTS) as shown here (http://wiki.ros.org/melodic/Installation/Ubuntu)
2. For convenience, add the setup script for ros into your .bashrc or .profile so that it naturally run at every new instance of shell
3. (Optional) Install python catkin tools (a higer level, out-of-source build system for catkin). It has similar concepts to using the native catkin-make tools with improvements
link: https://catkin-tools.readthedocs.io/en/latest/
4. (Optional) When using realsense D435i cameras as visual sensor, follow this github repository to install it (https://github.com/IntelRealSense/realsense-ros).
5. (Optional - Continue of 4) To launch
1. ORB_Slam2 requires opencv3.2, Pangolin and Eigen, etc... Follow the link https://github.com/raulmur/ORB_SLAM2
2. Should the compiling process (cmake) complaining about missing opencv3.2 refer to the jetson_xavier_nx_ros_install gist
@codieboomboom
codieboomboom / semantic_slam_setup.md
Last active May 28, 2021 03:59
Guide on how to set up semantic_slam
  1. Create a catkin workspace if you have not done so $ mkdir -p ~/catkin_ws/src && cd ~/catkin_ws/src
  2. Clone semantic_slam git clone https://github.com/floatlazer/semantic_slam
  3. (with python-catkin-tools installed) Init the catkin_ws and source devel/setup.bash
  cd ~/catkin_ws
  catkin init
  source devel/setup.bash
@codieboomboom
codieboomboom / audit-on-push.yml
Created February 25, 2022 04:47 — forked from LukeMathWalker/audit.yml
GitHub Actions - Rust setup
name: Security audit
on:
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
runs-on: ubuntu-latest
steps: