Skip to content

Instantly share code, notes, and snippets.

View ppflrs's full-sized avatar

Pepe Flores ppflrs

View GitHub Profile

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"
@ppflrs
ppflrs / Parallel download of blast databases using rsync and GNU Parallel.md
Last active February 21, 2023 17:23
Parallel download of blast databases using rsync+GNU Parallel
  1. Select which database you want to download, here I will use the nucleotide database: nt.

  2. Using rsync we will retrieve the name of the files composing the database from the NCBI server

rsync --list-only rsync://ftp.ncbi.nlm.nih.gov/blast/db/nt*.gz

  1. Using grep we filter the Warning/Welcome message and retain only the compressed files

rsync --list-only rsync://ftp.ncbi.nlm.nih.gov/blast/db/nt*.gz | grep '.tar.gz'

@ppflrs
ppflrs / Convert "application octet-stream; charset=binary" to ASCII Raw
Last active February 23, 2024 22:55
Convert "application/octet-stream; charset=binary" to ASCII
cat $BIN_FILE | tr -d '\0' > $NEW_FILE
@ppflrs
ppflrs / Mac SSH Autocomplete
Last active September 8, 2016 08:57 — forked from aliang/Mac SSH Autocomplete
Add auto complete to your ssh, scp, and rsync. Put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@ppflrs
ppflrs / .bash_profile
Created March 7, 2016 12:23 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@ppflrs
ppflrs / osx-brew-gnu-coreutils-man.sh
Created October 20, 2015 08:14 — forked from quickshiftin/osx-brew-gnu-coreutils-man.sh
Running GNU coreutils via Homebrew on your Mac? Here's a one-liner to get the manpages working!
# Short of learning how to actually configure OSX, here's a hacky way to use
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise
alias man='_() { echo $1; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1; else man $1; fi }; _'
@ppflrs
ppflrs / Documentation.md
Last active September 2, 2015 05:08 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs