Skip to content

Instantly share code, notes, and snippets.

View onecooltaco's full-sized avatar

Jeremy Leggat onecooltaco

  • Arizona State University
  • Phoenix, AZ
View GitHub Profile
@scgoeswild
scgoeswild / aws.cli
Last active July 12, 2023 13:49
AWS Backup vault cannot be deleted (contains xx recovery points).
#!/bin/bash
set -e
echo "Enter the name of the vault where all backups should be deleted."
read VAULT_NAME
for ARN in $(aws backup list-recovery-points-by-backup-vault --backup-vault-name "${VAULT_NAME}" --query 'RecoveryPoints[].RecoveryPointArn' --output text); do
echo "deleting ${ARN} ..."
aws backup delete-recovery-point --backup-vault-name "${VAULT_NAME}" --recovery-point-arn "${ARN}"
@cm-iwaki
cm-iwaki / gist:53afee67f3750bf69d78d4e941f1c7b4
Last active July 14, 2021 19:09
VPC endpoint for Amazon SES SMTP endpoint.
terraform {
required_version = ">= 0.12"
backend "s3" {
bucket = "<bucket name>"
key = "terraform.tfstate"
region = "ap-northeast-1"
encrypt = true
acl = "bucket-owner-full-control"
@grahampugh
grahampugh / Adobe CC Cleaner-postinstall.sh
Created November 18, 2019 15:06
A script to clean up properly the things that Adobe CC Cleaner fails to remove.
#!/bin/bash
## postinstall script to remove CCDA applications
# remove any existing version of the tool
echo "Moving the CC Cleaner app to Utilities in case users need it later"
rm -rf /Applications/Utilities/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app ||:
mv /Applications/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app /Applications/Utilities/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app
# run the cleaner tool to remove EVERYTHING!
echo "Running the CC Cleaner app with 'removeAll=All' option"
@talkingmoose
talkingmoose / Manage App Notifications.bash
Last active January 25, 2024 15:26
macOS Catalina will prompt users to allow Notifications from each app that makes a request. Administrators can manage these prompts using a Configuration Profile. If running Jamf Pro 10.19 or later, I suggest instead using this manifest: https://github.com/talkingmoose/jamf-manifests/blob/master/macOS%20Notifications%20(com.apple.notificationset…
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/talkingmoose/9faf50deaaefafa9a147e48ba39bb4b0
@akhileshdarjee
akhileshdarjee / how to fetch google news rss and filter with source.php
Created April 22, 2019 14:28
How to fetch Google News RSS and filter with source
The output of Google News RSS is in XML format. Here is a sample Google News RSS XML output:
<rss xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<generator>NFE/5.0</generator>
<title>"Apple" - Google News</title>
<link>
https://news.google.com/search?q=apple
</link>
<language>en-IN</language>
@bhubbard
bhubbard / gist:894040fec6421f891f1f88f2c6428ef0
Created December 23, 2018 19:15
Jetpack Sync - Delete
DELETE FROM wp_og6o50l3ph_options WHERE option_name LIKE '%jpsq_sync-%'
https://wordpress.org/support/topic/jpsq_sync-table-constantly-generated-to-the-db/
@holmberd
holmberd / php-pools.md
Last active May 17, 2024 07:21
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@butlerblog
butlerblog / functions.php
Last active March 28, 2024 02:09
SMTP using wp-config.php for settings #smtp #wp_mail
<?php // Don't use this line.
/*
* Add the script below to wherever you store custom code snippets
* in your site, whether that's your child theme's functions.php,
* a custom plugin file, or through a code snippet plugin.
*/
/**
* This function will connect wp_mail to your authenticated
@adamkudrna
adamkudrna / settings.php
Created January 25, 2017 13:37
Drupal 7 disable cache in settings.php
$conf['cache'] = 0; // Page cache
$conf['page_cache_maximum_age'] = 0; // External cache TTL
$conf['preprocess_css'] = FALSE; // Optimize css
$conf['preprocess_js'] = FALSE; // Optimize javascript
$conf['views_skip_cache'] = TRUE; // Views caching
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 2, 2024 01:27
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r