Skip to content

Instantly share code, notes, and snippets.

View jorgerance's full-sized avatar
💭
I may be slow to respond.

Jorge Rancé Cardet jorgerance

💭
I may be slow to respond.
View GitHub Profile
@jorgerance
jorgerance / install-opencv-2.4.13-ubuntu-16.04.sh
Created March 9, 2017 17:01
install-opencv-2.4.13-ubuntu-16.04.sh
# opencv dependencies
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y build-essential cmake libgtk2.0-dev pkg-config python-numpy python-dev libavcodec-dev libavformat-dev libswscale-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev unzip
sudo apt-get -qq install libopencv-dev build-essential checkinstall cmake pkg-config yasm libjpeg-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev libxine2 libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils
# download opencv-2.4.13
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.13/opencv-2.4.13.zip
unzip opencv-2.4.13.zip
cd opencv-2.4.13 && mkdir release && cd release
@jorgerance
jorgerance / get.py
Last active January 7, 2018 13:59
get.py - esp32 (SSL: CERTIFICATE_VERIFY_FAILED solved)
#!/usr/bin/env python
# This script will download and extract required tools into the current directory.
# Tools list is obtained from package/package_esp8266com_index.template.json file.
# Written by Ivan Grokhotkov, 2015.
#
from __future__ import print_function
import os
import shutil
import errno
import os.path
@jorgerance
jorgerance / keybase.md
Last active January 17, 2020 20:03
keybase.md #keybase #pgp #proof #20200117

Keybase proof

I hereby claim:

  • I am jorgerance on github.
  • I am jrance (https://keybase.io/jrance) on keybase.
  • I have a public key ASBC4ABfG_060sx14qyiazSXorCgzOwWz6GcxiV6Qbjv4Qo

To claim this, I am signing this object:

@jorgerance
jorgerance / docker-compose-backup.sh
Created September 20, 2019 12:33 — forked from pirate/docker-compose-backup.sh
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
# Fully backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
project_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
cd "$project_dir"
project_name=$(basename "$project_dir")
backup_time=$(date +"%Y-%m-%d_%H-%M")
backup_dir="$project_dir/data/backups/$backup_time"
@jorgerance
jorgerance / github_clone-all.sh
Last active December 18, 2019 14:49
github_clone-all.sh
#!/bin/bash
USERNAME=<USERNAME>
curl "https://api.github.com/users/$USERNAME/repos?page=1&per_page=1000" |
grep -e 'git_url*' |
cut -d \" -f 4 |
xargs -L1 git clone
@jorgerance
jorgerance / github_delete-list.sh
Created December 18, 2019 14:57
github_delete-list.sh
#!/bin/bash
TOKEN=<YOUR_GITHUB_OAUTH_TOKEN>
# Remember to enable de "delete_repo" OAuth scope on the token you just defined
# Delete a set o repositories defined on a plain text file
# i.e.:
# user@host ~/ $ cat repositories_to_delete.txt
# username/reponame1
# username/reponame2
@jorgerance
jorgerance / tor-install-service-isolate-macos.md
Created December 24, 2019 07:20
[tor isolation - macOS] tor as a service on multiple ports #homebrew #tor #privacy

Install tor on macOS

0 ✓ user@macos ~ $ brew install tor
==> Downloading https://homebrew.bintray.com/bottles/tor-0.4.2.5.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/82/8231f0d4bf6e158a85672f9a29a8bccb50152cf039cbc996b29f45031dc65e29?__gda__=exp=1577172051~hmac=89164770fc6a2d95795cf220c52b76e9f809a781307557930ddce7f6c1a6
######################################################################## 100.0%
==> Pouring tor-0.4.2.5.mojave.bottle.tar.gz
==> Caveats
To restart tor after an upgrade:
@jorgerance
jorgerance / accessing_sqlite3_encrypted_db.md
Created December 30, 2019 12:14
[Accesing SQLite encrypted DB] - Using sqlcipher and sqlite3
0 ✓ steve@hal9000 ~ $ sqlcipher jeanscollection.db
# insert password for decryption
PRAGMA key = '<PASSWORD>';
> ok
# show databases
.databases
> main: /Users/steve/jeanscollection.db
# show tables
.tables
@jorgerance
jorgerance / brew_install_gnu_utils.md
Last active January 1, 2020 00:40
[Install GNU utils on macOS]

As of 2019 --with-default-name is deprecaded. Updated packages to install below:

GNU Core Utilities:

brew install coreutils

Common utilities:

brew install binutils
@jorgerance
jorgerance / macos_system_defaults.md
Last active March 5, 2024 10:37
[macOS system defaults]

Drag Dashboard Widgets onto the Desktop

defaults write com.apple.dashboard devmode YES

Disable Auto-window-restore annoying feature

This is actually a pain in the as since has to be done for each application.