Skip to content

Instantly share code, notes, and snippets.

View lattice0's full-sized avatar
🦀

Lattice 0 lattice0

🦀
View GitHub Profile
@lattice0
lattice0 / gist:c23561ff62af5647c4ac0f3d8d26a739
Last active March 28, 2024 06:29
Vstarcam raspberry pi IP finder and HTTP port
#Give an IP address in the range of the camera to the eth0 interface
sudo ip address add 192.168.1.133/24 dev eth0
#First, scan the eth0 interface to find all the IPs connected to it
nmap -e eth0 192.168.1.0/24
#Now that you found the camera's IP, scan which ports are open to find the HTTP port (suupose the IP is ...189)
nmap -e eth0 192.168.1.104 -p 0-65535
#SSH and foward the HTTP port of the discovered camera
@lattice0
lattice0 / bootstrap.sh
Last active February 4, 2024 17:23
bootstrap
#!/bin/bash
# Clone and cat to inspect and chmod +x:
# wget https://gist.githubusercontent.com/lattice0/292d7234498ffacb4e76903b4d8ed769/raw/bootstrap.sh
set -x
set -e
#asks for sudo earlier
sudo touch a && sudo rm a
sudo apt update
# Asks for sudo password early
sudo touch a
# sudo apt update && sudo apt-get install -y wget curl git
# Installs vagrant
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install vagrant
@lattice0
lattice0 / gist:ac47e45d8b781d06e0c777b626951df6
Last active August 7, 2022 05:46
gitlab + runner installation process
# Install gitlab dockerized
export GITLAB_HOME=/srv/gitlab
sudo docker run --detach \
--hostname gitlab.example.com \
--publish 443:443 --publish 80:80 --publish 23:22 \
--name gitlab \
--restart always \
--volume $GITLAB_HOME/config:/etc/gitlab \
@lattice0
lattice0 / emulator_init.sh
Last active May 17, 2022 20:31
android emulator init
# Installs Android Emulator standalone, and creates a default emulator. You shouuld be able to
# re-run this script if it fails, everything should be redone
set -x
sudo apt-get update && sudo apt-get install -y openjdk-11-jdk
export ANDROID_SDK_ROOT=/home/$USER/android_sdk_root
rm -rf $ANDROID_SDK_ROOT
mkdir -p $ANDROID_SDK_ROOT
CMD_LINE_TOOLS_URL=https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip
CMD_LINE_TOOLS_SHA256=d71f75333d79c9c6ef5c39d3456c6c58c613de30e6a751ea0dbd433e8f8b9cbf
wget -O command_line_tools.zip $CMD_LINE_TOOLS_URL
@lattice0
lattice0 / gist:0040c1d29606c7a8f34c3b5b78814fdb
Created April 16, 2022 04:39
socat android redirection emulator
# On Host
socat tcp-listen:5037,bind=192.168.122.1,reuseaddr,fork tcp:localhost:5037
# On virtual machine
socat tcp-listen:5037,bind=localhost,reuseaddr,fork tcp:192.168.122.1:5037
# First run setup
HOST=lz@192.168.1.11 && ssh $HOST "sed -i 's/[#WaylandEnable=false]/[WaylandEnable=false]/' [/etc/gdm3/custom.conf] && sudo -S apt-get update && sudo -S apt-get install -y x11vnc && sudo reboot"
# Connect and forward ports
HOST=lz@192.168.1.11 && ssh $HOST -L 5900:localhost:5900 -L5901:localhost:5901 -L5902:localhost:5902 -L5903:localhost:5903 "x11vnc -listen localhost"
@lattice0
lattice0 / key
Last active April 14, 2022 03:35
key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDEhU8Fvn57jx3SgH2i88sF4473n/ugZfe7gsmUdMkSA/MzT9o3q4C66lfLcEgAVjXOs9N1XVHQ1ycoGJXsyRHDO8ijs3XuAmRWW/9/e+fph4Rpeh04ESjKQqpXuGXQHPCiMyn3A5QhDGerochwAy+rLDAi02FRqNU83OPls9sk8uV67gJK52PrB5nX/c9AIm2HldlswRzxaatCeCkq5bwW7C7b47wXbWZ2qLj7V+9NXuM37uWUGdX6a5G0FteNPH9QjImcEfrIoPDH58SpIbyTx0ZmRn785rFvbETTHpcmU5VwjA+XzFTAOqC6ZKN0za9nZrapv5Pn/MVuVVR77rHAFqXDsuWHYP3Sh08bANur/loGLH+5b9eF7XYbYDMRz4uj03USI4Ca4VjjudKWHi2NOJZN6d7BQvPulkskD/5rHGnIBSARvOa/o2uBbQrBJjybbNoG2XxxfYxvZXhB/TagtIrHZDLwW6/I7qpPoaVudTOSIiZT7HI9x309z13XkzBEtNK43ImdpbE8MPsNuFIIBa0iinJdrWZ60cP3fbhVzrwBtmfmIcRy+T0PziSPp0hbuC5DTAm32imXfTEblGPNehFI+rK+FjXZ2mtQjA7cus4J4DcVPVLSEtXPLaQMzfqPx6IlIoYERrxvdsFNC6Q5f8/sLAtP6sjO9G+pYZJ6BQ== cardno:000616358784
https://datatracker.ietf.org/doc/html/rfc6184#section-8.1
https://www.itu.int/rec/T-REC-H.264-202108-I/en
#https://forums.developer.nvidia.com/t/how-do-i-change-the-device-tree/154431/6
#Install kernel deps
set -x
set -e
sudo apt update && sudo apt-get install -y build-essential bc git curl wget xxd kmod libssl-dev
#Gets the kernel