Skip to content

Instantly share code, notes, and snippets.

@jcharlier
jcharlier / gen-apple-merchant-cert.sh
Created March 22, 2018 08:03
Apple Pay Merchant Certificate process
#!/bin/bash
dir="apple-certificates-data"
if [ -d $dir ]; then
echo "**Este script sobrescreve os dados que estão no diretorio '$dir'!**"
read -r -p "Continuar? [y/N] " start
start=${start,,} # tolower
if [[ ! "$start" =~ ^(yes|y)$ ]]; then
exit 0
fi
fi
@jcharlier
jcharlier / createSwap.sh
Created March 27, 2018 19:17
Create Swapfile in Ubuntu
#!/bin/bash
regex='^[0-9]+([.][0-9]+)?$'
if [[ ! $2 =~ $regex ]]; then
echo "Usage: createSwap.sh fullPathToSwapFile swapFileSizeinGB";
echo "ex: createSwap /tmp/swapfile.swap 8"
exit 1
fi
if [[ -d $1 ]] || [[ -f $1 ]] || [[ ! $1 = /* ]]; then
echo "please supply the full path to a new swapFile"
exit 1
@jcharlier
jcharlier / postman-update.sh
Last active September 13, 2018 19:27
*DEPRECATED* - postman has a auto-update (https://app.getpostman.com/app/download/linux64) Install/Update postman or postman canary (beta) for linux. Tested in ubuntu 17.10 gnome3
#!/bin/bash
cd /tmp || exit
read -r -p "[s]table or [b]eta? [sS/bB] " choice
choice=${choice,,} # tolower
if [[ ! "$choice" =~ ^(s|b)$ ]]; then
exit
fi
if [[ "$choice" = "s" ]]; then
url=https://dl.pstmn.io/download/latest/linux64
name=Postman