Skip to content

Instantly share code, notes, and snippets.

@olih
olih / jq-cheetsheet.md
Last active May 2, 2024 00:42
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@vladwa
vladwa / SSH.py
Created December 31, 2017 07:30
Python code to execute command as a sudo user over ssh connection on a remote server using "paramiko" module. On The code snippet establishes connection and executes the command and return the status and output of the executed command.
import logging
import paramiko
class SSH:
def __init__(self):
pass
def get_ssh_connection(self, ssh_machine, ssh_username, ssh_password):
"""Establishes a ssh connection to execute command.
:param ssh_machine: IP of the machine to which SSH connection to be established.
@m-radzikowski
m-radzikowski / script-template.sh
Last active April 25, 2024 18:43
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@JADC362
JADC362 / ROS2DebugVSCode.md
Last active April 10, 2024 23:18
Debug ROS2 C++ node on VSCode (Ubuntu)

Debug ROS2 C++ node on VSCode (Ubuntu)

Description

This is a small tutorial on how to debug a ROS2 C++ node usign VSCode.

Requeriments

This implementation was done using:

@simonw
simonw / how-to.md
Last active March 26, 2024 23:21
How to create a tarball of a git repository using "git archive"
@scottjacobsen
scottjacobsen / git+clone+ssh+agent+forward+sudo
Created December 14, 2012 00:07
Git clone using ssh agent forwarding and sudo
SSH agent forwarding is great. It allows you to ssh from one server to
another all the while using the ssh-agent running on your local
workstation. The benefit is you don't need to generate ssh key pairs
on the servers you are connecting to in order to hop around.
When you ssh to a remote machine the remote machine talks to your
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK
environment variable.
So you the remote server you can do something like:
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@awesomebytes
awesomebytes / debian_from_ros_pkg.md
Last active March 6, 2024 17:51
How to create a debian from a ROS package
@giraldeau
giraldeau / CMakeLists.txt
Created November 3, 2017 21:48
The missing example to use cmake qt5_create_translation
cmake_minimum_required(VERSION 3.8)
project(tsProject)
# Managing translations require LinguistTools module
# The cmake function is defined in the Qt installation tree:
# i.e. Qt5.9.1/5.9.1/gcc_64/lib/cmake/Qt5LinguistTools/Qt5LinguistToolsMacros.cmake
# Reference: https://doc.qt.io/qt-5/cmake-manual.html#qt5linguisttools-macros
find_package(Qt5 COMPONENTS Widgets LinguistTools)
set (CMAKE_CXX_STANDARD 11)
set(CMAKE_INCLUDE_CURRENT_DIR ON)