Skip to content

Instantly share code, notes, and snippets.

@pv8
pv8 / list_randomizer.py
Created January 11, 2022 18:57
List randomizer
import random
items = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
for position, idx in enumerate(random.sample(range(0, len(items)), len(items))):
print(position, items[idx])
@pv8
pv8 / README.md
Last active December 15, 2017 17:17
IOTA Seed Generator

Generating seed via command line

$ curl -s https://gist.githubusercontent.com/pv8/9c509a8ebcb3de1e7ceb8ea5d02e6f23/raw/152a24f470c96643180e6faded4c77b1c737e1d7/iota_seed_gen.py | python3
@pv8
pv8 / init.coffee
Last active July 23, 2017 20:54
atom.io sync-settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
@pv8
pv8 / bash_completion.ssh_includes.patch
Last active March 16, 2017 13:06
Simple patch to apply on Homebrew bash-completion in order to locate ssh included files in configs (based on https://github.com/scop/bash-completion/releases/tag/2.5)
--- bash_completion 2017-02-09 18:29:54.000000000 -0200
+++ bash_completion_new 2017-02-09 18:20:19.000000000 -0200
@@ -1205,6 +1205,39 @@
_known_hosts_real $options "$(_get_cword :)"
} # _known_hosts()
+# Helper function to locate ssh included files in configs
+# This function look for the "Include" keyword in ssh config files and include
+# them recursively adding each result to the config variable
+_included_ssh_config_files()
@pv8
pv8 / zsh.md
Created December 4, 2016 18:22 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu

Keybase proof

I hereby claim:

  • I am pv8 on github.
  • I am pv8 (https://keybase.io/pv8) on keybase.
  • I have a public key whose fingerprint is 38EB FF7D 03DA E2D5 4D39 5007 3155 7CED BBAD 4FA3

To claim this, I am signing this object:

@pv8
pv8 / start-ssh-agent.sh
Last active July 12, 2016 17:43
Meant to be added to .bash_profile (from: http://stackoverflow.com/a/18915067)
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add ~/.ssh/id_rsa;
}
@pv8
pv8 / maven-centos.sh
Last active September 23, 2016 21:02 — forked from sebsto/gist:19b99f1fa1f32cae5d00
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
@pv8
pv8 / git-config-setup.sh
Last active June 21, 2016 15:18
Handy script to setup git local config for several git projects
#!/usr/bin/env bash
set -e
prompt_user() {
read -p "$1 [hit <enter> to abort]: " user_input
if [[ -z "$user_input" ]]; then
echo "Aborting git local config setup."
exit 1
fi
@pv8
pv8 / fix-venv.sh
Last active September 1, 2022 03:33
Fix virtualenv symlinks after upgrading python with Homebrew and running brew cleanup
#!/usr/bin/env bash
#
# Fix virtualenv symlinks after upgrading python with Homebrew and then running
# `cleanup`.
#
# After upgrading Python using Homebrew and then running `brew cleanup` one can
# get this message while trying to run python:
# dyld: Library not loaded: @executable_path/../.Python
# Referenced from: /Users/pablo/.venv/my-app/bin/python
# Reason: image not found