Skip to content

Instantly share code, notes, and snippets.

View njanirudh's full-sized avatar
🤖

Anirudh NJ njanirudh

🤖
View GitHub Profile
@njanirudh
njanirudh / TP-LinkWR841N_OpenWRT.md
Last active July 10, 2025 19:51
Using OpenWRT with TP-Link WR841N

📘 Installing OpenWRT on TP-Link TL-WR841N (v14)

⚠️ Warning: Flashing custom firmware may void your warranty or brick your device if not done correctly. Proceed with caution.


✅ Prerequisites

  • TP-Link TL-WR841N v14 router
  • Ethernet cable (to connect your PC to the router's LAN port)
@njanirudh
njanirudh / new_ubuntu_setup.sh
Last active April 27, 2025 07:37
Bash script to setup a new Ubuntu PC with my custom setup
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# --------------------------------------------------
# SSH Key Setup
echo "Setting up SSH keys..."
if [ ! -f "$HOME/.ssh/id_rsa" ]; then
ssh-keygen -t rsa -b 4096 -C "$USER@$(hostname)" -N "" -f "$HOME/.ssh/id_rsa"
@njanirudh
njanirudh / bashrc
Last active July 10, 2025 20:03
Example ~/.bashrc
# ----------------USER--------------
# Showing git branch
source /usr/lib/git-core/git-sh-prompt
export PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u:\[\033[01;34m\]\w\[\033[00m\]\$(__git_ps1)\[\033[00m\] $"
# ROS2
source /opt/ros/galactic/setup.bash
source $HOME/ubica_ws/install/setup.bash
@njanirudh
njanirudh / sim_tutorial.md
Last active July 11, 2020 17:37
Coppelia Sim

Objects

Object Interaction Properties

  • Dynamic object : Affected by gravity, collisions and other constraints.

  • Static object : Not affected by forces.

  • Respondable object : Produces a collision reaction with other respondable objects.

  • Respondable mask : Used to filter respondability to only some objects.

Object Special Properties

@njanirudh
njanirudh / Tricks
Last active November 19, 2021 09:03
Batch rename files
ls | cat -n | while read n f; do mv "$f" `printf "%04d.jpg" $n`; done
Finds all the executables in the folder (source)[https://superuser.com/questions/492501/how-do-i-list-all-of-the-executables-in-a-linux-directory-sub-dirs-path]
find . -type f –executable

Docker ROS

Docker basic ROS commands

docker run -it ros
docker ps -l
docker image ls
docker exec -it nostalgic_morse bash
source /opt/ros//setup.bash
docker container prune
docker image rm

@njanirudh
njanirudh / image_augmentor.py
Created October 31, 2019 11:17
Augments the image present in a földer
# References
# 1. https://github.com/mdbloice/Augmentor
import Augmentor
p = Augmentor.Pipeline("/home/jayasimha/NJ/Datasets/Nuts/nonsense")
p.skew_left_right(probability=0.5)
p.skew_top_bottom(probability=0.5)
p.random_brightness(probability=0.5,min_factor=0.9,max_factor=1.0)
@njanirudh
njanirudh / sift.py
Last active August 27, 2019 11:10
Using sift to check the correspondence between images
__author__ = "Anirudh NJ"
__email__ = "[email protected]"
__license__ = "GNU"
import cv2
import sift
import os
from glob import glob
import pickle
import numpy as np
@njanirudh
njanirudh / openai_gym.py
Created August 20, 2019 07:42
OpenAI Gym
### OpenAI GYM ###
# 1. https://gym.openai.com/docs/
# 2. https://gym.openai.com/envs/#board_game
import gym
# Create an env for RL
# print(envs.registry.all())
env = gym.make('CartPole-v0')
observation = env.reset()
#----- XOR Patterns --------
# https://www.reddit.com/r/math/comments/bpfq1w/weird_prime_pattern/
# https://medium.com/biffures/part-2-the-beauty-of-bitwise-and-or-cdf1d8d87891
import numpy as np
import cv2 as cv2
# Width and height of the image
width = 1000
height = 1000