Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
@bonelifer
bonelifer / pushover.sh
Created July 22, 2020 01:48 — forked from henri/pushover.sh
PushOver
#! /bin/bash
#
# RELEASED UNDER MIT LICENCE : https://mit-license.org
# Copyright Allrights Reserved 2020, Henri Shustak
# This Script Works With the PushOver <http://pushover.net> service and is capable of sending notifcations to your phone.
#
# Usage: ./pushover.bash message title url url_title priority device'
#
# Example: ./pushover.sh "this is a test" "test title" "http://mylink.com" "my url title" 0 "iPhone"'
# Note: All parameters except message are optional'
@bonelifer
bonelifer / create-unattended-iso.sh
Created August 20, 2020 22:15 — forked from mkjaer/create-unattended-iso.sh
Create unattended Ubuntu ISO
#!/bin/bash
cd $(dirname "${0}")
UBUNTU_VERSION=${UBUNTU_VERSION:=16.04.3}
INSTALL_HOSTNAME=${INSTALL_HOSTNAME:=ubuntu}
USERNAME=${USERNAME:=username}
PASSWORD=${PASSWORD:=password}
SEED_FILE=${SEED_FILE:=lvm.seed}
TIMEZONE=${TIMEZONE:=$(cat /etc/timezone)}
@bonelifer
bonelifer / maintenance.sh
Created September 3, 2020 18:52
Script that update, upgrade and clean ubuntu packages in one linux cmd.
#! / bin / sh
# @link https://gist.github.com/Junscuzzy/e7cd13973bd06b0927b959fe77283c10
# To make the script executable: chmod + x [filename]
# Then for the run: sh [filename]
echo "1. Make updates"
sudo apt-fast update # Get updates
@bonelifer
bonelifer / repo-labels.sh
Created September 3, 2020 19:11 — forked from camilleriluke/repo-labels.sh
Github repository labels standard
#!/usr/bin/env bash
# You can craete a token from https://github.com/settings/tokens and give the
# "repo" persmission to the token
AUTH_TOKEN=$1
OWNERREPO=$2
if [[ "$#" -ne 2 ]]; then
echo "Usage: $0 AUTH_TOKEN OWNER/REPO\n"
exit 1
@bonelifer
bonelifer / github_sync.sh
Created September 3, 2020 19:35 — forked from Zolmeister/github_sync.sh
Clone all github repos
curl -s https://api.github.com/users/<USERNAME>/repos\?per_page\=200 | grep ssh_url | cut -d \" -f 4 | xargs -n 1 git clone
@bonelifer
bonelifer / github-backup.sh
Created September 3, 2020 19:42 — forked from toddlucas/github-backup.sh
Back up GitHub repos
#!/bin/bash
USERNAME='xyz'
# https://news.ycombinator.com/item?id=22210681
for i in `seq 1 20`;
do
curl --fail -s https://api.github.com/users/$USERNAME/repos?page=$i | jq '.[] | .clone_url' | xargs -t -n1 git clone
sleep 1
done
@bonelifer
bonelifer / createRepo.sh
Created September 3, 2020 19:45 — forked from Krishna829/createRepo.sh
create github repo
#!/bin/sh
reponame="$1"
if [ "$reponame" = "" ]; then
read -p "Enter Github Repository Name: " reponame
fi
mkdir ./$reponame
cd $reponame
curl -u USERNAME https://api.github.com/user/repos -d "{\"name\":\"$reponame\"}"
git init
echo "ADD README CONTENT" > README.md
@bonelifer
bonelifer / github_repo_create.sh
Created September 3, 2020 19:46 — forked from igk1972/github_repo_create.sh
Github repo create
#!/bin/sh
# [ -z "$1" ] || ACCESS_TOKEN="$1"
[ -z "$1" ] || ACCESS_AUTH="$1"
[ -z "$2" ] || REPO_NAME="$2"
# [ -z "$ACCESS_TOKEN" ] && { echo "Token not set" ; exit 1; }
[ -z "$ACCESS_AUTH" ] && { echo "Username[:Password] not set" ; exit 1; }
[ -z "$REPO_NAME" ] && { echo "Repo not set" ; exit 1; }
@bonelifer
bonelifer / backup_github.sh
Last active September 3, 2020 19:48 — forked from dskarataev/backup_github.sh
Backup GitHub repositories
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"tterp"} # the GitHub organization whose repos will be backed up
GHBU_UNAME=${GHBU_UNAME-"dskarataev"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"xc4cv0q0"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
GHBU_PRUNE_AFTER_N_DAYS=${GHBU_PRUNE_AFTER_N_DAYS-3} # the min age (in days) of backup files to delete
@bonelifer
bonelifer / dump.sh
Created September 3, 2020 19:49 — forked from bashkirtsevich/dump.sh
Dump github user
username=$1
repos=$(curl -s https://api.github.com/users/$username/repos?per_page=1000 | jq -r '.[] | .name + "|" + .clone_url')
for repo in $(echo $repos | tr " " "\n")
do
name=$(echo $repo | cut -d"|" -f1)
clone_url=$(echo $repo | cut -d"|" -f2)
git clone --mirror $clone_url ./$username/$name.git && tar -czvf ./$username/$name.tgz -C ./$username/$name.git .
rm -rf ./$username/$name.git