Skip to content

Instantly share code, notes, and snippets.

View ricardodeazambuja's full-sized avatar

Ricardo de Azambuja ricardodeazambuja

View GitHub Profile
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@ricardodeazambuja
ricardodeazambuja / Remote OpenGL Setup.md
Created November 11, 2019 16:27 — forked from shehzan10/Remote OpenGL Setup.md
Remote OpenGL Without Display

Remote OpenGL Setup without X

A full OpenGL profile requires X to be running. For X to run, it requires a display to be connected to the machine. Given that most server machines do not have this, it becomes difficult to run OpenGL.

This document details how to get OpenGL and X up and running without having a display connected to the sevrer.

Requirements

You will need access to the remote system over SSH. To run the tool, you will need libGL.so and libX11.so. These are installed when X and the NVIDIA Drivers are installed. So there is nothing special required to install these.

Another tool I would recommend strongly is glewinfo. Most linux distributions ship this with the glew-utils package. An alternate to glewinfo is glxinfo which is present on all systems with X. You can substitute glewinfo with glxinfo in all the commands below if needed.

@ricardodeazambuja
ricardodeazambuja / HowToOpenAnotherTerminal-BashInstanceInARunningDockerContainer.md How To Open Another Terminal/Bash Instance In A Running Docker Container #gistblog #bash #docker

How To Open Another Terminal/Bash Instance In A Running Docker Container

Add the following to your bashrc.

#Add another docker window
function dock()
{
  if [ "$1" == "-h" ]
 then
@ricardodeazambuja
ricardodeazambuja / colab_xface_vnc.ipynb
Created July 17, 2019 19:28 — forked from ahmedengu/colab_xface_vnc.ipynb
Use google colab as a remote machine with the help of ngrok, vnc server and xface desktop you can change the configurations and desktop environment as you please it's just a start
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ricardodeazambuja
ricardodeazambuja / dgoogle_download.sh
Last active February 16, 2020 14:32 — forked from isphus1973/dgoogle_download.sh
How to download stuff directly from google drive into a jupyter notebook / colab
#!/bin/sh
######Usage#######
# ./dgoogle_download.sh FILE_ID OUTPUT_NAME
## Remember to chomod +x dgoogle_download.sh
#This scrip is based on https://unix.stackexchange.com/questions/136371/how-to-download-a-folder-from-google-drive-using-terminal
@ricardodeazambuja
ricardodeazambuja / docker-cleanup-resources.md
Created June 30, 2019 12:51 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@ricardodeazambuja
ricardodeazambuja / tf-rasp.md
Created May 26, 2019 11:56 — forked from EKami/tf-rasp.md
Building TensorFlow for Raspberry Pi: a Step-By-Step Guide

Building TensorFlow 1.3.0-rc1 for Raspberry Pi/Ubuntu 16.04: a Step-By-Step Guide

Here you'll learn how to build Tensorflow for the raspberry pi 3 with either the Python API or as a standalone shared library which can be interfaced from the C++ API and eventually as a library which can be used in other languages.

For the C++ library this tutorial will show you how extract tensorflow library and headers to use in any environment you want.

(This tutorial couldn't be possible without the help of the people from the References section)

What You Need

@ricardodeazambuja
ricardodeazambuja / ffmpeg.md
Created March 6, 2019 19:43 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

#!/usr/bin/env bash
# Create isolated ROS Workspace
cd ~
mkdir ros_py35
cd ros_py35
# Unset sourced workspace
# Go to ~/.bashrc and comment out lines from previous installation of ROS (Lunar)