Skip to content

Instantly share code, notes, and snippets.

View Pablo1107's full-sized avatar

Pablo Andres Dealbera Pablo1107

View GitHub Profile
@robertodr
robertodr / flake.nix
Last active December 14, 2023 12:36
Sample Nix flake using mach-nix
{
description = "veloxchem-hpc";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
pypi-deps-db = {
url = "github:DavHau/pypi-deps-db/a8ea7f774b76d3b61237c0bc20c97629a2248462";
flake = false;
};
mach-nix = {
@aaronNGi
aaronNGi / newscript.sh
Created April 28, 2020 20:38
Boilerplate for new POSIX shell scripts
#!/bin/sh
prog_name=${0##*/}
version=1.0
version_text="Boilerplate for new scripts v$version"
options="h o: q v V"
help_text="Usage: $prog_name [-o <text>] [-hqvV] [<file>]...
Boilerplate for new scripts
@pablordoricaw
pablordoricaw / getopts-ba.sh
Created May 10, 2018 14:23
Code example using getopts in bash with short options and a subcommand with it's own short options
#!/bin/bash
###
# This is a code example showing how to use getops to parse short options and a
# subcommand with short options of it's own. Based on Kevin Sookocheff's post:
# https://sookocheff.com/post/bash/parsing-bash-script-arguments-with-shopts/
#
# Please feel free to use it and modify it as you see fit. Any questions and/or
# recommendations are more than welcome.
###
@petersellars
petersellars / autokey-github.sh
Last active March 4, 2024 21:23
Automate SSH Key generation on a machine for use with GitHub
#!/bin/bash
# Requirements
# You will need to have created a GitHub Access Token with admin:public_key permissions
# Usage
# chmod +x autokey-github.sh
# ./autokey-github.sh <YOUR-GITHUB-ACCESS-TOKEN>
# Reference
@travisbhartwell
travisbhartwell / nix-shell-shebang.md
Last active March 29, 2024 19:55
nix-shell and Shebang Lines

NOTE: a more up-to-date version of this can be found on my blog

nix-shell and Shebang Lines

A few days ago, version 1.9 of the Nix package manager was released. From the release notes:

nix-shell can now be used as a #!-interpreter. This allows you to write scripts that dynamically fetch their own dependencies.

@jorilallo
jorilallo / gist:0cd603b691acb551b2e0
Created January 29, 2015 21:16
Coinbase Exchange signing with Python
# Requires python-requests. Install with pip:
#
# pip install requests
#
# or, with easy-install:
#
# easy_install requests
import json, hmac, hashlib, time, requests, base64
from requests.auth import AuthBase