Skip to content

Instantly share code, notes, and snippets.

@sgarciav
sgarciav / connect_to_internet.md
Created May 22, 2024 01:27
Connect to internet from terminal

Instructions

Taken from here:

  ip a # get DEVICE
  sudo ifconfig <DEVICE> up
  nmcli dev wifi list # get SSID
  sudo nmcli --ask dev wifi connect <SSID>
@sgarciav
sgarciav / pdfgrep_pdftk.md
Created March 27, 2024 19:18
Extract a specfic pdf page given a keyword
  1. Find the page that hosts the keyworkd:

    pdfgrep -in <keyword> <pdf-file>

  2. Extract specific pdf page:

pdftk cat output

@sgarciav
sgarciav / docker_no_sudo.md
Last active October 16, 2023 16:02
Docker without sudo

About

When you first install Docker, you have to execute its commands with sudo. Follow these steps to add your user to the docker group such that there won't be a need to execute with sudo.

Steps

  • Add the docker group if it doesn't already exist:

    sudo groupadd docker

@sgarciav
sgarciav / web-app-notes.md
Last active March 26, 2023 15:01
Collection of notes for Flask and Django development

Alternative method for displaying an image

This method relies on a static folder. Doesn't work when hosted on the web - which is why I needed to leverage the Google Cloud Storage.

@app.route('/display/<filename>')
def display_image(filename):
    return redirect(url_for('static', filename='processed_imgs/' + filename), code=301)

Syntax to use in html file if wanting to use the display_image function

About

Instructions for using git lfs to track large file (greater tham 100MBs). See instructions here.

You can also watch this video to learn about the different features that lfs provides.

$ sudo apt install git-lfs
$ cd /path/to/[GIT REPO]
$ git lfs install
$ git track [filename or type of file you wish to track]

About

Sometimes a Docker container can get stuck in the "Removal in progress" status. If and when this happens it just hangs forever. Running docker rm -f doesn't work. The following set of instructions is a good workaround.

  1. Stop the docker daemon ($ sudo systemctl stop docker.socket)
  2. Remove the remaining container files ($ sudo rm -rf /var/lib/docker/containers/[FULL CONTAINER ID])
  3. Start the docker daemon ($ sudo systemctl restart docker.socket).
@sgarciav
sgarciav / galaxy_buds.md
Last active December 7, 2021 16:02
connect galaxy buds pro to ubuntu
@sgarciav
sgarciav / transformCoordinates.cpp
Last active September 22, 2021 23:38
Transform some coordinates from source to target frame
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_eigen/tf2_eigen.h>
bool transformCoordinates(const std_msgs::Float32MultiArray& points,
const std_msgs::Header& header,
std::vector<geometry_msgs::Vector3Stamped>& transformed_points);
@sgarciav
sgarciav / docker-compose-rviz.yml
Created June 9, 2021 23:37
docker-compose file to run Rviz inside a Docker container
version: "3.4"
services:
ros-rviz:
build:
context: .
dockerfile: Dockerfile
image: rviz_container:melodic
container_name: rviz_test
network_mode: "host"