Skip to content

Instantly share code, notes, and snippets.

View MacsInSpace's full-sized avatar

Craig Hair MacsInSpace

  • Department of Education
  • Melbourne
  • 16:33 (UTC +10:00)
View GitHub Profile
@eisenreich
eisenreich / wait_for_http_200.sh
Last active February 6, 2024 19:03 — forked from rgl/wait_for_http_200.sh
Wait for HTTP endpoints to return 200 OK with bash, curl and timeout
#!/bin/bash
##############################################################################################
# Wait for URLs until return HTTP 200
#
# - Just pass as many urls as required to the script - the script will wait for each, one by one
#
# Example: ./wait_for_urls.sh "${MY_VARIABLE}" "http://192.168.56.101:8080"
##############################################################################################
@echo off
:======================================================================================================================================================
:Thanks to abbodi1406 for SppExtComObjPatcher-kms\2-Activate-Local.cmd, which used as base in this script
:Thanks to rpo for the Great and Continued help in improving this script.
:Thanks to AR_Alex for the ideas and suggestions.
:======================================================================================================================================================
::===========================================================================
fsutil dirty query %systemdrive% >nul 2>&1 || (
@zbalkan
zbalkan / Start-WindowsActivation.ps1
Last active December 16, 2023 17:22
It's a drop-in replacement for slmgr.vbs script
#Requires -RunAsAdministrator
#Requires -Version 5
<#
.Synopsis
Activates Windows via KMS
.DESCRIPTION
It's a drop in replacement for slmgr scripts
.EXAMPLE
Start-WindowsActivation -Verbose # Activates the local computer
.EXAMPLE
@bonomali
bonomali / gist:cb440122bcac485ae56b29d09c7e863d
Created March 11, 2020 03:22 — forked from rtrouton/gist:a01073797a6d7e1fff9a
Disable Apple iCloud and Diagnostic Pop-Ups
#!/bin/bash
# Determine OS version
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
sw_vers=$(sw_vers -productVersion)
# Determine OS build number
sw_build=$(sw_vers -buildVersion)
@aslamanver
aslamanver / adb-url-install.sh
Last active July 20, 2022 07:20
Install application APK from URL using ADB (Android Developer Bridge)
#!/bin/bash
BASEDIR=$(dirname "$0")
FILE=$(basename "$1")
EXTENSION="${FILE##*.}"
if [[ $EXTENSION == "apk" ]]; then
@palevell
palevell / utils.py
Created December 28, 2019 21:06
Plugging Tweepy into the Django-Allauth package was easier than I thought.
# utils.py - Saturday, December 28, 2019
# -*- coding: utf-8 -*-
""" I have been experimenting to see which web framework would make the better
wrapper for Tweepy. I decided on Django, with the Allauth package.
Afer going through the Django-Allauth Tutorial at
https://wsvincent.com/django-allauth-tutorial/ and playing with the DjangoTweepy repository at
https://github.com/martinjc/DjangoTweepy/blob/master/src/twitter_auth/utils.py,
this is what I contrived.
@niw
niw / mkmobileconfig.sh
Created November 10, 2019 08:25
Create a blank configuration profile.
#!/usr/bin/env bash
set -e
readonly PLIST_BUDDY=/usr/libexec/PlistBuddy
while getopts "i:h" opts; do
case $opts in
i)
IDENTIFIER=$OPTARG
@brenorb
brenorb / tweet_dumper.py
Last active March 11, 2023 18:17 — forked from yanofsky/LICENSE
A Python 3.+ script to download all of a user's tweets into a csv.
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
@PandaWhoCodes
PandaWhoCodes / get_all_followers.py
Last active May 3, 2022 05:48
best way get all twitter followers of a user using tweepy
import time
import tweepy
import csv
auth = tweepy.OAuthHandler("", "")
auth.set_access_token("",
"")
def get_followers(user_name):
@jgillman
jgillman / 1-Info.md
Created January 3, 2019 23:01
Automated certbot renew for Mac with launchd (launchctl)

Automatic certbot renew on a Mac

It seems like everyone is using cron for setting up certbot renew on Macs but I couldn't find anyone doing it with launchd. The other file in this Gist is the service file.

The documentation on the Let's Encrypt site actually recommends having it run twice a day (12 hours apart) but I've found that once a day is more than sufficient since if it fails it still has another 29 days to succeed.