Skip to content

Instantly share code, notes, and snippets.

View josemarcosrf's full-sized avatar
🏔️
Working from a mountain top

Jose Marcos RF josemarcosrf

🏔️
Working from a mountain top
View GitHub Profile
#!/usr/bin/env python3
"""
quicky script that compares two conda environments
can be handy for debugging differences between two environments
This could be made much cleaner and more flexible -- but it does the job.
Please let me know if you extend or improve it.
@josemarcosrf
josemarcosrf / private_fork.md
Last active September 14, 2020 11:31 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The correct way of creating a private frok by duplicating the repo is documented here.

We assume the following:

For this, the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)
@josemarcosrf
josemarcosrf / README.md
Last active January 27, 2019 12:27 — forked from Lazza/README.md
VPNGate Python script

vpngate.py

This is a port of the original gist to python 3.

This script allows to use the free VPN service provided by VPNGate in an easy way. The user just needs to provide the desidered output country, and the script automatically chooses the best server.

After this step, OpenVPN is launched with the proper configuration. The VPN can be terminated by pressing Ctrl+C.

Usage

@josemarcosrf
josemarcosrf / index.js
Created January 4, 2019 19:09 — forked from miguelmota/index.js
Node.js Winston logger wrapper to display filename
var log = require('./lib/logger')(module);
log.info('foo');
@josemarcosrf
josemarcosrf / install_cuda_ubuntu-1604.sh
Last active May 21, 2020 12:03 — forked from 8enmann/reinstall.sh
Reinstall NVIDIA drivers without opengl Ubuntu 16.04 GTX 1080ti
# Download installers
mkdir ~/Downloads/nvidia
cd ~/Downloads/nvidia
wget https://developer.nvidia.com/compute/cuda/8.0/Prod2/local_installers/cuda_8.0.61_375.26_linux-run
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/384.59/NVIDIA-Linux-x86_64-384.59.run
sudo chmod +x NVIDIA-Linux-x86_64-384.59.run
sudo chmod +x cuda_8.0.61_375.26_linux-run
./cuda_8.0.61_375.26_linux-run -extract=~/Downloads/nvidia/
# Uninstall old stuff
sudo apt-get --purge remove nvidia-*
@josemarcosrf
josemarcosrf / wav-mp3
Created December 28, 2018 21:07 — forked from championofblocks/wav-mp3
Command line bash to convert all wav to mp3
for i in *.wav; do lame -b 320 -h "${i}" "${i%.wav}.mp3"; done
@josemarcosrf
josemarcosrf / docker-install-rpi3.md
Created November 21, 2018 13:05 — forked from tyrell/docker-install-rpi3.md
Installing latest Docker on a Raspberry Pi 3

Introduction

I wrote this gist to record the steps I followed to get docker running in my Raspberry Pi 3. The ARM ported debian version (Jessie) comes with an old version of docker. It is so old that the docker hub it tries to interact with doesn't work anymore :)

Hopefully this gist will help someone else to get docker running in their Raspberry Pi 3.

Installation

From original instructions at http://blog.hypriot.com/post/run-docker-rpi3-with-wifi/

@josemarcosrf
josemarcosrf / switch-local-git-repo-to-fork.md
Created November 19, 2018 20:58 — forked from jpierson/switch-local-git-repo-to-fork.md
How to move to a fork after cloning

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

@josemarcosrf
josemarcosrf / EnvDefault.py
Created October 25, 2018 14:34 — forked from orls/EnvDefault.py
Using env vars in argparse
"""Provides a utility to inject environment variables into argparse definitions.
Currently requires explicit naming of env vars to check for"""
import argparse
import os
# Courtesy of http://stackoverflow.com/a/10551190 with env-var retrieval fixed
class EnvDefault(argparse.Action):
"""An argparse action class that auto-sets missing default values from env
vars. Defaults to requiring the argument."""
@josemarcosrf
josemarcosrf / testApiKeyAndGoogleAuthLibrary.js
Created October 24, 2018 15:40 — forked from phsultan/testApiKeyAndGoogleAuthLibrary.js
Google Speech Recognition with API key + google-auth-library
const fs = require('fs');
const { auth } = require('google-auth-library');
const API_KEY = 'ADD YOUR API KEY HERE';
const fileName = './audio.raw';
// Reads a local audio file and converts it to base64
const file = fs.readFileSync(fileName);
const audioBytes = file.toString('base64');