This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# This script downloads an asset from latest or specific Github release of a | |
# public or private repo. | |
# | |
# PREREQUISITES: | |
# | |
# curl, wget, jq | |
# | |
set -eE -o functrace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function bake_fg_color { | |
BLACK="\033[0;30m" | |
BLACK_BOLD="\033[1;30m" | |
WHITE="\033[0;37m" | |
WHITE_BOLD="\033[1;37m" | |
RED="\033[0;31m" | |
RED_BOLD="\033[1;31m" | |
GREEN="\033[0;32m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Kenneth Reitz's GitHub Syncer | |
This script uses the GitHub API to get a list of all forked, mirrored, public, and | |
private repos in your GitHub account. If the repo already exists locally, it will | |
update it via git-pull. Otherwise, it will properly clone the repo. | |
It will organize your repos into the following directory structure: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -euo pipefail | |
# See https://blastedbio.blogspot.co.uk/2016/05/sync-github-mirror-with-cron.html and | |
# https://gist.github.com/peterjc/eccac1942a9709993040425d33680352 for mirroring script | |
# | |
# Usage: | |
# | |
# 1. Fork upstream repo under HuttonICS, disable wiki, projects, issues etc. Protect master branch. | |
# 2. Run: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copyright 2021-2024 by Peter Cock, The James Hutton Institute. | |
# All rights reserved. | |
# This file is released under the "MIT License Agreement". | |
"""Python script to keep GitHub mirrors in sync with upstream. | |
Mirror mirror on the wall, who's the newest of them all? | |
Usage: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"errors" | |
"fmt" | |
"log" | |
"os" | |
"os/exec" | |
"syscall" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
usage() { | |
echo "Usage: $0 USERNAME" 2>&1 | |
exit 1 | |
} | |
username="$1" | |
[ -z "$username" ] && usage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
""" Print all of the (git/ssh or http) urls for all repos (public or | |
private+public with personal_token) in a GitHub account (user or organization). | |
Usage example:: | |
[HTTP_URLS=1] python2.7 list-all-repos.py account_name [personal_token] | |
It requires the pygithub3 module, which you can install on macos (Mac OSX) like this:: | |
# get pip if you don't have it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# all logging settins are here on top | |
$logFile = "log-$(gc env:computername).log" | |
$logLevel = "DEBUG" # ("DEBUG","INFO","WARN","ERROR","FATAL") | |
$logSize = 1mb # 30kb | |
$logCount = 10 | |
# end of settings | |
function Write-Log-Line ($line) { | |
Add-Content $logFile -Value $Line | |
Write-Host $Line |
NewerOlder