Skip to content

Instantly share code, notes, and snippets.

Javi Polo javipolo

  • kodify
  • Barcelona, Catalunya
Block or report user

Report or block javipolo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
javipolo / eyaml.vim
Last active Nov 9, 2016
eyaml encrypt within vim
View eyaml.vim
" Write eyaml encrypted pass directly
function! Eyaml_input()
call inputsave()
let my_pass = input('Secret: ')
call inputrestore()
let encpass = system("eyaml encrypt -o string -q -s ".shellescape(my_pass)." 2>/dev/null")
call append(line('.'), split(encpass, '\v\n'))
javipolo / dockshell
Last active Nov 25, 2016
runs a shell on a docker container, searching it by name
View dockshell
# dockshell container [command] # Runs bash (or command) in container specified by name
if [ $# -gt 0 ]; then
C_ID=$(sudo docker ps | awk '{if ( $2 == "'$1'") print $1}')
sudo docker exec -it $C_ID $cmd
echo "ERROR. Need container name"
javipolo /
Created Dec 15, 2017
Stupid webserver that returns hostname and primary IP address
import BaseHTTPServer
import socket
import fcntl
import struct
address = ''
port = 12345
interface = 'eth0'
javipolo / set-tmux-title
Last active Mar 22, 2019 — forked from florianbeer/set-tmux-title
Set tmux pane title to short hostname on ssh connections
View set-tmux-title
# Make short hostname only if its not an IP address
local HOST="$(echo $* | rev | cut -d ' ' -f 1 | rev)"
if echo $HOST | grep -P "^([0-9]+\.){3}[0-9]+" -q; then
echo $HOST
echo $HOST| cut -d . -f 1
javipolo / ec2ssh
Last active May 28, 2018
Connect to ec2 instances using either InstanceId, Name tag or Ip address, using multiple ssh keys as identities
View ec2ssh
# Connect to ec2 instances using either InstanceId, Name tag or Ip address
# We try all the ssh keys available in a directory supplied by the env variable SSH_KEYDIR
# Usage:
# - ec2ssh i-123124123123
# - ec2ssh [-n 2] name_tag
# - ec2ssh IP
javipolo /
Created Oct 26, 2018
Decode kubernetes base64 secrets
# Print decoded kubernetes secrets
# kubectl secrets nameofsecret -o json |
cat > $tmp
keys=$(cat $tmp| jq -ra '.data | to_entries[] | .key')
for key in $keys; do
value=$(cat $tmp | jq -r '.data."'$key'"' | base64 -d)
echo "$key: $value"
You can’t perform that action at this time.