Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Jose Marcos Rodríguez Fernández jmrf

🏠
Working from home
View GitHub Profile
@jmrf
jmrf / toggle-gnome-themes.sh
Last active Jul 13, 2020
Bash script to change Gnome and Shell themes and Terminal profiles between dark and light modes
View toggle-gnome-themes.sh
#!/usr/bin/env bash
set -e
set -o pipefail
# Some useful commands to figure out what to tweak:
# https://askubuntu.com/questions/971067/how-can-i-script-the-settings-made-by-gnome-tweak-tool#971577
# * watch dconf changes being made:
# 'dconf watch /'
@jmrf
jmrf / decrypt_dbeaver.py
Created Jun 26, 2020 — forked from felipou/decrypt_dbeaver.py
DBeaver password decryption script - for newer versions of DBeaver
View decrypt_dbeaver.py
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection
# requires pycrypto lib (pip install pycrypto)
import sys
import base64
import os
import json
from Crypto.Cipher import AES
@jmrf
jmrf / .tmux.conf
Created Jun 18, 2020
Tmux configuration
View .tmux.conf
# increase history limit to 90K lines
set-option -g history-limit 90000
# Enable mouse mode
set -g mouse on
# remap keys for copy-mode
bind -t vi-copy y copy-pipe "xclip -sel clip -i"
setw -g mode-keys vi
@jmrf
jmrf / jupyter_kernels.md
Created Jun 7, 2020
Jupyter Kernel with virtual env or conda envs
View jupyter_kernels.md

For jupyter notebooks to identify your virtual env kernels:

  1. Activate your env and install ipykernel:
pip install --user ipykernel
  1. Add your virtual environment to Jupyter:
python -m ipykernel install --user --name=myenv
@jmrf
jmrf / install_postman.sh
Created May 30, 2020
Install postman (not the snap version)
View install_postman.sh
# Download postman (instead of the snap from the Ubuntu Software Store)
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
rm postman.tar.gz
sudo ln -s /opt/Postman/Postman /usr/bin/postman
# Create a desktop entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
@jmrf
jmrf / python-deps.md
Created May 22, 2020
Utilities to analyse python dependencies
View python-deps.md

Draw a graph of dependencies

pydeps: Python module dependency visualization

# Draw a graph for <package> with max depth of 3 and cluster expernal deps. Produces an .svg file
pydeps <my-package> 
  --noshow \
  --max-bacon 3 \
  --cluster \
@jmrf
jmrf / install_cuda_ubuntu-1804.sh
Last active May 21, 2020
Install NVIDIA drivers and CUDA for Ubuntu 18.04 LTS
View install_cuda_ubuntu-1804.sh
# https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html
# https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/
# ========================== FROM FILES ==========================
# DOwnload NVIDIA drivers (installing from run file to avoid openGL libraries: https://www.geforce.com/drivers)
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/440.82/NVIDIA-Linux-x86_64-440.82.run
sudo chmod +x NVIDIA-Linux-x86_64-440.82.run
@jmrf
jmrf / py_wrappers.py
Created Apr 29, 2020
A collection of useful python wrapper functions
View py_wrappers.py
import time
from functools import wraps
from typing import List
from typing import Union
import numpy as np
import psutil
from sklearn import preprocessing
@jmrf
jmrf / local_vscode_settings.jsonc
Last active May 21, 2020
VSCode custom color settings collection to differentiate between multiple opened instances
View local_vscode_settings.jsonc
{
// https://www.schemecolor.com/dysfunctional.php
"workbench.colorCustomizations": {
// activity bar
"activityBar.background": "#CE3C63",
"activityBar.inactiveForeground": "#c5c4c4",
"activityBar.activeBackground": "#FBE9B7",
"activityBar.activeBorder": "#04B9B0",
// badge
"activityBarBadge.background": "#04B9B0",
@jmrf
jmrf / ToggleColorSchemeCommand.py
Last active Mar 22, 2020 — forked from rbf/Default (OSX).sublime-keymap
A simple way to toggle between dark and light themes in Sublime Text 2, also for open files in the .workspace settings file.
View ToggleColorSchemeCommand.py
# From https://gist.github.com/rbf/195acdfe8f51b65e5ecd
# Forked from https://gist.github.com/jasonlong/5395357
# // Copy this to your keybindings (Preferences > Key Bindings - User)
# // Change the keybinding, color schemes, and themes to your preferences
#
# {
# "keys": ["ctrl+shift+s"], "command": "toggle_color_scheme",
# "args": {
# "light_color_scheme": "Packages/User/Soda Light - Espresso.tmTheme",
You can’t perform that action at this time.