Skip to content

Instantly share code, notes, and snippets.

View pacohope's full-sized avatar

Paco Hope pacohope

View GitHub Profile
@pacohope
pacohope / reuse_agent.sh
Created May 11, 2018 18:19 — forked from MarkRose/reuse_agent.sh
Reuse existing ssh-agent or start a new one
# Reuse an existing ssh-agent on login, or create a new one. Append this to your .bashrc
# This version also handles the case where the agent exists but has no keys.
function agent() {
GOT_AGENT=0
DEFTEMP="/tmp"
for FILE in $(find "${TMPDIR:-$DEFTEMP}/ssh-"* -type s -user ${LOGNAME} -name "agent.[0-9]*" 2>/dev/null)
do
@pacohope
pacohope / fix-freebsd-update.sh
Created March 6, 2018 15:00 — forked from thefloweringash/fix-freebsd-update.sh
There I "fixed" freebsd-update.
#!/bin/sh
# Fork of https://gist.github.com/thefloweringash/8729473
#
# freebsd-update is a clever script that downloads a lot of bsdiff
# patches and whole files when patches are not suitable. The result of
# this process is a collection of files in
# /var/db/freebsd-update/files. If the files already exist, it will
# not fetch them again.
#
# -*- coding: utf-8 -*-
import click
import os
import pandas as pd
def file_split(file):
s = file.split('.')
name = '.'.join(s[:-1]) # get directory name