Skip to content

Instantly share code, notes, and snippets.

View deesweet's full-sized avatar

Dan L deesweet

View GitHub Profile
@andy-b-84
andy-b-84 / delete_all_object_versions.sh
Last active May 13, 2024 20:39
[AWS][S3] permanently delete every objects from a versioned bucket, typically before destroying the bucket, launching headless commands (make that CPU burn, Nero)
#!/bin/bash
bucket=$1
profile=$2
region=$3
set -e
echo "Removing all versions from $bucket"
@hervenivon
hervenivon / extend-apfs-container
Created January 29, 2021 11:28
A script to expand the APFS container on the boot volume with AWS EC2 Mac Instance
#!/bin/bash
PDISK=$(diskutil list physical external | head -n1 | cut -d' ' -f1)
APFSCONT=$(diskutil list physical external | grep Apple_APFS | tr -s ' ' | cut -d' ' -f8)
sudo diskutil repairDisk $PDISK
sudo diskutil apfs resizeContainer $APFSCONT 0
# https://derflounder.wordpress.com/2020/12/19/resizing-an-aws-macos-ec2-instances-boot-drive-to-use-all-available-disk-space/
@LauLaman
LauLaman / Mojave-nfs.md
Last active May 28, 2021 18:01
Vagrant nfs mount Mac OS X Mojave
  1. Mac OS X system settings > Security & Privacy > privacy tab

  2. Select Full Disk Access and click plus icon.

  3. Add terminal in the list ( in my case iTerm)

  4. Restart iTerm

  5. Run command in iterm: $ cd /private/etc && sudo touch ./exports

  6. Start virtual machine trough vargrant: Profit

@0xjac
0xjac / private_fork.md
Last active April 29, 2025 16:54
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@justinpawela
justinpawela / DisableGuestAccount.applescript
Created October 9, 2016 04:10
Disable macOS Guest user account script
#!/usr/bin/osascript
-- License: https://justinpawela.github.io/default-gist-license/
(*
1) Disables signing in as Guest from the login screen.
2) Disables Guest access to file shares over AFP.
3) Disables Guest access to file shares over SMB.
Commands are chained together so that the user only needs to authorize once.
*)
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# [email protected]
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@shawnsi
shawnsi / README.md
Last active March 24, 2025 10:37
Ansible Vault Environment Variable

Ansible Vault Environment Variable

Per http://docs.ansible.com/ansible/playbooks_vault.html you can set an environment variable to use a password file for vault access. We can use this to create an environment variable to hold the password.

Password Script

Copy vault-env from this project to ~/bin. Then add this to your ~/.bashrc:

export ANSIBLE_VAULT_PASSWORD_FILE=~/bin/vault-env
@sa7mon
sa7mon / scanSparkle.sh
Last active March 10, 2021 08:11
Scan your Mac for application feed URLs with the Sparkle Updater Framework. URL's that aren't HTTPS are vulnerable to MITM
find /Applications -name Sparkle.framework -exec defaults read {}/../../Info.plist SUFeedURL \;
@tahmidsadik
tahmidsadik / purgeAndroid.txt
Created September 19, 2015 18:47
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
@weavenet
weavenet / delete_all_object_versions.sh
Created May 4, 2015 05:21
Delete all versions of all files in s3 versioned bucket using AWS CLI and jq.
#!/bin/bash
bucket=$1
set -e
echo "Removing all versions from $bucket"
versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'`
markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'`