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 / .pygmy.yml
Last active February 18, 2020 01:41
Fubarhouse's PygmyFile
---
defaults: false
services:
amazeeio-dnsmasq:
Config:
Labels:
- pygmy.defaults: true
@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 / lagoon.go
Last active April 2, 2019 11:44
Magefile for Lagoon
// +build mage
// An abstraction layer for Amazeeio's Lagoon Make process.
// Made to suit compatibility with v0.22.1
package main
import (
"fmt"
"io/ioutil"
"os"
@fubarhouse
fubarhouse / lagoon.go
Created April 1, 2019 22:32
Magefile for Lagoon
// +build mage
// An abstraction layer for Amazeeio's Lagoon Make process.
// Made to suit compatibility with v0.22.1
package main
import (
"fmt"
"io/ioutil"
"os"
@fubarhouse
fubarhouse / useful-snippets-bash.txt
Created March 21, 2019 05:38
Useful thingies...
get-content .\db.sql | docker-compose exec -T test bash -c 'drush sql-cli'
#!/bin/bash
# Database importer.
#
# Used with the govCMS scaffolding projects by Department of Finance.
# Created independently of the Department of Finance by Karl Hepworth.
# @fubarhouse / karl.hepworth@gmail.com
#
# Pass one argument to this script to provide the path or drush alias
# for either syncing or importing from a sql file. This should ideally
@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