Skip to content

Instantly share code, notes, and snippets.

View olen2006's full-sized avatar
🐙
https://youtu.be/TulBh6klMuU

General Zod olen2006

🐙
https://youtu.be/TulBh6klMuU
  • Solar System, Earth
View GitHub Profile
@shadiakiki1986
shadiakiki1986 / example_1.txt
Last active October 4, 2023 08:53
aws cli cloudtrail + jq examples
# list latest 10 event names and the next token
aws cloudtrail lookup-events \
--max-items 10 \
--lookup-attributes AttributeKey=EventSource,AttributeValue=ec2.amazonaws.com \
--lookup-attributes AttributeKey=ReadOnly,AttributeValue=false \
--starting-token "eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0=" | \
jq '.Events[].EventName,.NextToken'
"ModifyInstanceAttribute"
@epicserve
epicserve / example.com.import.txt
Last active March 11, 2023 14:04
Example Terraform file for importing DNS Records from DigitalOcean
digitalocean_domain.example example.com
digitalocean_record.example example.com,<DO ID>
digitalocean_record.fd-gmail-txt example.com,<DO ID>
digitalocean_record.fd-mx["alt1.aspmx.l.google.com."] example.com,<DO ID>
digitalocean_record.fd-mx["alt2.aspmx.l.google.com."] example.com,<DO ID>
digitalocean_record.fd-mx["aspmx.l.google.com."] example.com,<DO ID>
digitalocean_record.fd-mx["aspmx2.googlemail.com."] example.com,<DO ID>
digitalocean_record.fd-mx["aspmx3.googlemail.com."] example.com,<DO ID>
digitalocean_record.fd-ns["1"] example.com,<DO ID>
digitalocean_record.fd-ns["2"] example.com,<DO ID>
@dansmith65
dansmith65 / Install-AWSCLI.ps1
Last active December 9, 2022 12:28
Install version 1 of AWS CLI via PowerShell
# https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-windows.html
$dlurl = "https://s3.amazonaws.com/aws-cli/AWSCLI64PY3.msi"
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath msiexec -Args "/i $installerPath /passive" -Verb RunAs -Wait
Remove-Item $installerPath
$env:Path += ";C:\Program Files\Amazon\AWSCLI\bin"
@shapeshed
shapeshed / aws-cf-logs
Last active September 12, 2022 09:10
Fetch AWS Cloudfront Logs, decompress, combine into a single file and remove comments
#!/usr/bin/env bash
BUCKET=$1
CWD=$(pwd)
if [[ -n $1 ]]; then
aws s3 sync s3://$BUCKET/cf-logs .
cat *.gz > combined.log.gz
find $CWD ! -name 'combined.log.gz' -name '*.gz' -type f -exec rm -f {} +
gzip -d combined.log.gz
@alastairtree
alastairtree / gist:6777218c2c7facc17282
Created July 28, 2014 14:45
grant read execute permissions to a folder via powershell
$path = "C:\Sites\Website123"
$user = "domain\user"
$acl = Get-Acl $path
$arguments = $user, "ReadAndExecute", "ContainerInherit, ObjectInherit", "None", "Allow"
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $arguments
$acl.SetAccessRule($accessRule)
@velotiotech
velotiotech / download-consul-linux-64bit
Created June 11, 2020 08:53
Velotio - HashiCorp Consul Part 1 - Download Consul
$ wget https://releases.hashicorp.com/consul/1.4.3/consul_1.4.3_linux_amd64.zip -O consul.zip
--2019-03-10 00:14:07-- https://releases.hashicorp.com/consul/1.4.3/consul_1.4.3_linux_amd64.zip
Resolving releases.hashicorp.com (releases.hashicorp.com)... 151.101.37.183, 2a04:4e42:9::439
Connecting to releases.hashicorp.com (releases.hashicorp.com)|151.101.37.183|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 34777003 (33M) [application/zip]
Saving to: ‘consul.zip’
consul.zip 100%[============================>] 33.17M 4.46MB/s in 9.2s
@arcanosam
arcanosam / install_Python381.sh
Last active October 29, 2020 05:56
my Python 3.8.1 build script on CentOS 7
#!/bin/bash
# original source/tip: https://www.workaround.cz/howto-compile-install-latest-python-37-38-centos-7-8/
wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz -P /tmp/
tar xzfv /tmp/Python-3.8.1.tgz -C /tmp
cd /tmp/Python-3.8.1
@joshuaaguilar20
joshuaaguilar20 / my.cnf
Last active June 29, 2020 06:54
MariaDB 10:2 Server Config file
root@c836246fc87c:/etc/mysql# cat my.cnf
# MariaDB database server configuration file.
#
# You can copy this file to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
@sebdah
sebdah / template.json
Created June 24, 2014 12:38
EC2 Windows - Joining a domain via cfn-init
"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
"<powershell>\n",
"pip install -U cumulus-bundle-handler\n",
"# Join the AD domain\n",
"$password = \"MyPassW0rd\" | ConvertTo-SecureString -asPlainText -Force\n",
"$username = \"example.com\\username\"\n",
"$credential = New-Object System.Management.Automation.PSCredential($username,$password)\n",
"Add-Computer -domainname example.com -OUPath \"OU=Servers,OU=Resources,OU=ORGANIZATION,DC=example,DC=com\" -Credential $credential -passthru \n",
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "simple template",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the web server",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[-_ a-zA-Z0-9]*",