Skip to content

Instantly share code, notes, and snippets.

View fubarhouse's full-sized avatar
🏠
Working from the greatest office on earth

Karl Hepworth fubarhouse

🏠
Working from the greatest office on earth
  • Canberra, Australia
View GitHub Profile
@fubarhouse
fubarhouse / download-cloudwatchlogs
Created January 9, 2024 01:19 — forked from bjorg/download-cloudwatchlogs
Download all CloudWatch logs
log_group_name="/aws/log-group-name"
log_stream_names=$(aws logs describe-log-streams \
--log-group-name "$log_group_name" \
--order-by LastEventTime \
--descending \
--max-items 50 \
--output text \
--query 'logStreams[*].logStreamName')
@fubarhouse
fubarhouse / .gitignore
Created October 23, 2023 04:28 — forked from simesy/.gitignore
Drop-in govcms PaaS settings.local.php and lando/ddev support
# Add to .gitignore.
.lando.yml
.ddev
.vscode
# Drush aliases can be used by anyone, but you might not want to add to repo.
# drush/sites/self.sites.yml
From: http://web.archive.org/web/20160904174444/http://andreafrancia.it/2010/03/understanding-the-output-of-rsync-itemize-changes.html
As you may know the rsync's --delete options if misused could make severe damage.
To prevent this you can use the --itemize-change and the --dry-run options to figure out how the command will behave before launching the real one.
The output will be something like that:
.d..t..g... ./
.f...p.g... Something.pdf
@fubarhouse
fubarhouse / StreamToString.go
Created October 24, 2019 08:34 — forked from tejainece/StreamToString.go
Golang: io.Reader stream to string or byte slice
import "bytes"
func StreamToByte(stream io.Reader) []byte {
buf := new(bytes.Buffer)
buf.ReadFrom(stream)
return buf.Bytes()
}
func StreamToString(stream io.Reader) string {
buf := new(bytes.Buffer)
@fubarhouse
fubarhouse / mbp2011-disable-amd-gpu.md
Created September 17, 2018 21:26 — forked from blackgate/mbp2011-disable-amd-gpu.md
Macbook Pro 2011 - Disable AMD GPU
@fubarhouse
fubarhouse / test-ansible-role.sh
Created May 28, 2018 20:21 — forked from samdoran/test-ansible-role.sh
Script for testing an Ansible role in containers
#!/bin/bash
# Test Ansile role inside container
#
# Inspired by the wonderful work of Jeff Geerling (@geerlingguy)
# https://gist.github.com/geerlingguy/73ef1e5ee45d8694570f334be385e181
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NEUTRAL='\033[0m'
@fubarhouse
fubarhouse / addmore.module
Last active February 20, 2018 03:34 — forked from AlexSkrypnyk/mymodule.css
Multiple field API example including add/remove submit and callback functions.
<?php
/**
* @file
* Module file for add_more_example.
*/
/**
* Implements hook_menu().
*
@fubarhouse
fubarhouse / loop_files_folders_recursively.go
Last active January 2, 2023 10:31 — forked from francoishill/loop_files_folders_recursively.go
Loop through files and folders recursively in golang
package main
import (
"fmt"
"os"
"path/filepath"
)
func run() ([]string, error) {
searchDir := "c:/path/to/dir"