Skip to content

Instantly share code, notes, and snippets.

@josh-padnick
josh-padnick / crontab file
Last active June 15, 2022 04:48
Create EC2 AMI from Bash Script; Good for cron jobs
PATH=/bin:/usr/local/bin
# Put this in your crontab file to run the script every day at 01:30 (1:30am). Note the PATH variable above; required for this script.
# m h dom mon dow command
30 01 * * * /bin/bash /home/ubuntu/scripts/ec2-create-image.sh i-8a915682 >> /home/ubuntu/logs/crontab.log 2>&1
@mandiwise
mandiwise / Update remote repo
Last active April 17, 2024 07:41
Transfer repo from Bitbucket to Github
// Reference: http://www.blackdogfoundry.com/blog/moving-repository-from-bitbucket-to-github/
// See also: http://www.paulund.co.uk/change-url-of-git-repository
$ cd $HOME/Code/repo-directory
$ git remote rename origin bitbucket
$ git remote add origin https://github.com/mandiwise/awesome-new-repo.git
$ git push origin master
$ git remote rm bitbucket
function parse(fullString) {
let strArray = fullString.split(" ");
let pos = 0;
function checkPos() {
return strArray[pos];
}
function isNumber(e) {
return e !== undefined && e.match(/^-?([1-9][0-9]*|([0]))$/) !== null;