Skip to content

Instantly share code, notes, and snippets.

View andrewssobral's full-sized avatar
🔴
I may be very slow to respond.

Andrews Cordolino Sobral andrewssobral

🔴
I may be very slow to respond.
View GitHub Profile

Portainer

Portainer runs as a lightweight Docker container (the Docker image weights less than 4MB) on a Docker engine or Swarm cluster.

$ docker volume create portainer_data
$ docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

Then, connect to http://localhost:9000/

@andrewssobral
andrewssobral / pytorch_mnist_visdom.py
Last active March 13, 2021 16:57
pytorch_mnist_visdom
from __future__ import print_function
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
# remove docker containers from specific image
docker rm -f $(docker ps -a -f "ancestor=activeeon/visdom_server" -q)
# run in background
nohup command &>/dev/null &
@andrewssobral
andrewssobral / print_env_info.py
Created February 27, 2018 14:45
env_info (python)
#import os
import socket
import platform
print('-------------------------------------------------------------')
print('Interpreter')
print('platform.python_version: ', platform.python_version())
print('platform.python_compiler: ', platform.python_compiler())
print('platform.python_build: ', platform.python_build())
print()
print('Platform')
@andrewssobral
andrewssobral / LICENCE SUBLIME TEXT
Created May 3, 2018 13:44 — forked from cprakashagr/LICENCE SUBLIME TEXT
Sublime Text 3 Serial key build is 3143
## Sublime Text 3 Serial key build is 3103
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
@andrewssobral
andrewssobral / gist:1417d380fcdada4112a150ebdf933124
Created May 3, 2018 14:04 — forked from yumitsu/gist:ec0c8f1f03dbc94eed8c
ST3 build 3065, Linux x64 - licenses

These licenses will be valid after sublime_text patching:

- BEGIN License -
Love
Unlimited user license
EA7E-8441
918381ACA844A0379CCAC729059720A4
BC9D409098618744BB45FF23E67568DB
82B926D92157127DB3B4054834D0477F
@andrewssobral
andrewssobral / cracking.md
Created May 3, 2018 14:05 — forked from vertexclique/cracking.md
Cracking guide for Sublime Text 3 Build 3059 / 3065 ( Mac / Win x86_64 / Windows x86 / Linux x64 / Linux x86 )

MacOS

Build 3059

MD5: 59bab8f71f8c096cd3f72cd73851515d

Rename it to: Sublime Text

Make it executable with: chmod u+x Sublime\ Text

@andrewssobral
andrewssobral / revert-a-commit.md
Created May 29, 2018 15:28 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@andrewssobral
andrewssobral / gstreamer_view.cpp
Created June 2, 2018 22:46 — forked from peter-moran/gstreamer_view.cpp
Bare-bones C++ script for viewing gstreamer video from the CSI port of the Nvidia Jetson TX2.
/*
Example code for displaying gstreamer video from the CSI port of the Nvidia Jetson in OpenCV.
Created by Peter Moran on 7/29/17.
https://gist.github.com/peter-moran/742998d893cd013edf6d0c86cc86ff7f
*/
#include <opencv2/opencv.hpp>
std::string get_tegra_pipeline(int width, int height, int fps) {
return "nvcamerasrc ! video/x-raw(memory:NVMM), width=(int)" + std::to_string(width) + ", height=(int)" +