Skip to content

Instantly share code, notes, and snippets.

@alexlopezc
alexlopezc / retry_decorator.py
Last active June 3, 2022 03:33
Python retry decorator
# Created by https://github.com/bbelderbos
# Seen at Twitter https://twitter.com/bbelderbos/status/1532347393009668098
from functools import wraps, partial
import requests
def retry(func=None, *, times=3):
if func is None:
return partial(retry, times=times)
@alexlopezc
alexlopezc / get_pvt_from_rtklib_solution.sh
Created March 25, 2019 09:03
Converts RTKLIB Solution ans Stats file into one PVT
#!/bin/bash
##TODO Major refactor, put code into functions once I have time to do it....
usage()
{
echo "Usage: $0 SOLUTION_FILE STAT_FILE OUTPUTFILE";
exit 1;
}
@alexlopezc
alexlopezc / remote_execution.sh
Created November 27, 2018 08:49
Remote script execution with ssh
#!/bin/bash
ARG1="Hello"
ARG2="world"
ssh user@host ARG1=$ARG1 ARG2=$ARG2 'bash -s' <<'ENDSSH'
echo ${ARG1} ${ARG2}
ENDSSH
@alexlopezc
alexlopezc / README.md
Created July 25, 2018 19:06 — forked from nickbudi/README.md
Get Finder to sort like Windows Explorer a la terminal

Get Finder to sort folders first like Windows Explorer a la terminal.

Note: This hack is no longer needed in High Sierra. Just run defaults write com.apple.finder _FXSortFoldersFirst -bool true

Results

Results Two things to note:

  • Unfortunately files are sorted by kind first then alphabetically. Check the location of bootstrap.sh in the screenshot for example. This is as close as I could get it to Windows Explorer for now.
  • I've left folder dropdowns. I think I like folder dropdowns for moving files between subfolders with ease, we'll see.
volumes:
image: tianon/true
volumes:
- "./volumes/ldap/:/var/lib/ldap"
# https://github.com/osixia/docker-openldap
ldap:
image: osixia/openldap
volumes_from:
- "volumes"
@alexlopezc
alexlopezc / install_docker_centos.sh
Created February 17, 2017 12:24
Install Docker on Centos
yum install -y yum-utils
yum-config-manager \
--add-repo \
https://docs.docker.com/engine/installation/linux/repo_files/centos/docker.repo
yum makecache fast
yum -y install docker-engine
# Start docker service
# sudo systemctl start docker
@alexlopezc
alexlopezc / virtualenvwrapper-setup.sh
Last active February 16, 2017 17:08 — forked from dnerdy/virtualenvwrapper-setup.sh
Setup virtualenvwrapper environment variables
cat >> ~/.profile <<EOF
mkdir -p $HOME/.virtualenvs
export WORKON_HOME=$HOME/.virtualenvs
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source $(which virtualenvwrapper.sh)
EOF