Skip to content

Instantly share code, notes, and snippets.

View inactivist's full-sized avatar
💭
fixing things

Michael Curry inactivist

💭
fixing things
View GitHub Profile
@pirate
pirate / docker-compose-backup.sh
Last active June 25, 2025 17:55
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@kaz3w
kaz3w / resolve_meta_release_lts_check_error.sh
Created May 12, 2019 08:46
Ubuntu 18. Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
sudo rm /var/lib/ubuntu-release-upgrader/release-upgrade-available
sudo /usr/lib/ubuntu-release-upgrader/release-upgrade-motd
@kasunbg
kasunbg / run-gui-apps-from-a-different-user.md
Created April 23, 2019 13:37
How to run a GUI application as a different user?

How to run a GUI application as a different user:

Suppose you are logged into your Linux box as user1 using some X window system already (with GNOME/Unity/..). Now you want to run some gui app as another user, user2.

Run:

  1. xhost + - Run as the user1. This enables access to user1's X window system from other users. You should see following output: 'access control disabled, clients can connect from any host'
  2. sudo su - user2 - Using your favorite terminal, log-in to second user.
  3. export DISPLAY=:0.0 - optional for some apps.
@aallan
aallan / throttled.sh
Last active May 11, 2025 18:07
Script to parse the output of the 'vcgencmd get_throttled' command on a Raspberry Pi
#!/bin/bash
# https://retropie.org.uk/forum/topic/2295/runcommand-warning-if-voltage-temperature-throttling
#Flag Bits
UNDERVOLTED=0x1
CAPPED=0x2
THROTTLED=0x4
HAS_UNDERVOLTED=0x10000
HAS_CAPPED=0x20000
@glenacota
glenacota / 1master-2datanodes_hot_warm-1kibana.yml
Created February 2, 2019 17:16
Docker-compose file to build up an ElasticSearch cluster with 1 master node, 2 datanodes supporting a hot/warm architecture, and a Kibana instance. (v6.5.4)
version: '3'
services:
master:
image: docker.elastic.co/elasticsearch/elasticsearch:6.5.4
container_name: master
environment:
- cluster.name=elastic-cluster
- node.name=master
- node.master=true
- node.data=false
@busybus
busybus / mapbox.py
Created January 16, 2019 04:29
Download a rendered map from Mapbox based on a bounding box
# RA, 2019-01-16
# Download a rendered map from Mapbox based on a bounding box
# License: CC0 -- no rights reserved
import io
import urllib.request
from PIL import Image
from math import pi, log, tan, exp, atan, log2, floor
# Convert geographical coordinates to pixels
@inactivist
inactivist / enable-hmr-in-react-360.md
Last active July 17, 2020 18:46
Enable Hot Module Reload (HMR) in React-360

Didn't see this mentioned in docs, so:

To enable HMR:

Append ?hotreload=true to the page URL (assuming this only works in dev mode)

Example:

http://localhost:8081/index.html?hotreload=true
// // https://twitter.com/settings/your_twitter_data/twitter_interests
// Lots of discussion and improvement of the original script in the comments
// Here's the best version that works well
// Because Twitter stops the script working after unchecking 50 interests, so you will almost certainly have to run the script multiple times
function sleep(milliseconds) {
return new Promise(function (resolve) {
return setTimeout(resolve, milliseconds);
});
@jj1bdx
jj1bdx / remove-cloud-init-from-ubuntu.md
Created July 8, 2018 05:11
Remove cloud-init from Ubuntu
@minj
minj / classic.xml.patch
Created June 28, 2018 18:05
gitg syntax highlighting in dark themes
--- /dev/null 2018-06-21 06:33:33.714769919 +0200
+++ ~/.local/share/gtksourceview-2.0/styles/classic.xml 2018-05-13 23:35:51.412676863 +0200
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright (C) 2011 Campbell Barton
+ Author: Campbell Barton <[email protected]>
+
+ This library is free software; you can redistribute it and/or