Skip to content

Instantly share code, notes, and snippets.

View rloomans's full-sized avatar

Robert Loomans rloomans

View GitHub Profile
@pudquick
pudquick / brew.md
Last active April 6, 2024 21:42
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@schl3ck
schl3ck / AppWatcher.js
Last active February 29, 2024 07:28
iOS Scriptable script to track the price and in-app purchases of your favourite apps
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: blue; icon-glyph: laptop-code;
// share-sheet-inputs: url;
/*******************************************
* *
* /\ *
* / \ _ __ _ __ *
* / /\ \ | '_ \| '_ \ *
* / ____ \| |_) | |_) | *

systemd-nspawn container architecture

This short document will show how to turn systemd-nspawn into a usable containeration system.

Those instructions here should work under Arch Linux and Debian 10 (Buster)

Host requirements

  • systemd-nspawn and machinectl (systemd-container package under Debian)
  • dnsmasq
  • debootstrap
@apiri
apiri / alias_dns.py
Created October 28, 2017 16:50 — forked from patrickfuller/alias_dns.py
Enables local DNS resolution of Unifi aliases
"""
When run in cron, automatically adds compliant alias names to local DNS.
Use at your own risk.
Patrick Fuller, 25 June 17
"""
import re
import paramiko
import pymongo
@patrickfuller
patrickfuller / alias_dns.py
Last active January 29, 2024 16:29
Enables local DNS resolution of Unifi aliases
"""
When run in cron, automatically adds compliant alias names to local DNS.
Use at your own risk.
Patrick Fuller, 25 June 17
"""
import re
import paramiko
import pymongo
@Bazze
Bazze / Input.jsx
Last active January 25, 2017 13:57
I use this class as drop-in replacement for the "Input" class after it got deprecated in react-bootstrap version 0.29.0.
import React, { PropTypes } from 'react';
import ReactDOM from 'react-dom';
import { FormGroup, ControlLabel, FormControl, HelpBlock } from 'react-bootstrap';
class Input extends React.Component {
static propTypes = {
children: PropTypes.any,
help: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
id: PropTypes.string,
label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
@rudelm
rudelm / autofs.md
Last active April 29, 2024 02:26
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file /etc/auto_master and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

@kfatehi
kfatehi / README.md
Last active September 24, 2021 16:51
Compiling libimobiledevice on Raspberry Pi

iPhone Tethering on Raspberry Pi

The instructions here are useful although the current packages in Arch and Debian repositories do not work with iOS 7 (Trust Loop Bug) but it is still a good starting point to understand how this works.

https://wiki.archlinux.org/index.php/IPhone_Tethering

iOS 7 Support

Install libimobiledevice from latest source