Skip to content

Instantly share code, notes, and snippets.

Ricardo de Azambuja ricardodeazambuja

Block or report user

Report or block ricardodeazambuja

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bash.generate.random.alphanumeric.string.sh
#!/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
View Remote OpenGL Setup.md

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
View HowToOpenAnotherTerminal-BashInstanceInARunningDockerContainer.md

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 Jul 17, 2019 — 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
View colab_xface_vnc.ipynb
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
Created Jul 2, 2019 — forked from isphus1973/dgoogle_download.sh
Small bash script that downloads a Google Drive file with wget
View dgoogle_download.sh
#!/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 Jun 30, 2019 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

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 / take_photo_colab.py
Last active Jun 29, 2019
Saving images from webcam on Google Colab
View take_photo_colab.py
# I have no idea who is the author of the code
# in this cell that saves an image from a webcam
# inside google colab.
# It comes from a notebook called "📸 Take a photo with your webcam"
from IPython.display import HTML, Audio
from google.colab.output import eval_js
from base64 import b64decode
import numpy as np
import io
@ricardodeazambuja
ricardodeazambuja / Dockerfile
Last active Jun 29, 2019
Docker image for RPI ZERO with OpenCV4 and friends... more compact, but annoying to build.
View Dockerfile
FROM balenalib/rpi-raspbian:stretch
# This is responsible for making your current docker work with arm images:
# $ sudo apt install qemu qemu-user-static binfmt-support-
# And this line is responsible for enabling it (MUST run after a restart):
# $ docker run --privileged linuxkit/binfmt:v0.7
ENV OPENCV_VERSION=4.1.0
@ricardodeazambuja
ricardodeazambuja / test_pizero_opencv.py
Created Jun 21, 2019
Testing the OpenCV Optical Flow tutorial on the Raspberry Pi Zero
View test_pizero_opencv.py
import io
import time
import picamera
#from PIL import Image
import cv2 as cv
import numpy as np
NoI = 200
@ricardodeazambuja
ricardodeazambuja / Dockerfile
Last active Jun 20, 2019
Docker image for RPI ZERO with OpenCV4 and friends...
View Dockerfile
FROM balenalib/rpi-raspbian:stretch
# This is responsible for making your current docker work with arm images:
# $ sudo apt install qemu qemu-user-static binfmt-support-
# And this line is responsible for enabling it (MUST run after a restart):
# $ docker run --privileged linuxkit/binfmt:v0.7
RUN apt-get update
RUN apt-get upgrade -y
You can’t perform that action at this time.