Skip to content

Instantly share code, notes, and snippets.

@MrTrustor
MrTrustor / clean-docker-for-mac.sh
Last active November 21, 2023 11:38
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
@dreikanter
dreikanter / encrypt_openssl.md
Last active April 20, 2024 13:45 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@justinpawela
justinpawela / config
Created August 3, 2016 01:39
AWS CodeCommit Multiple Account Config
# This file is: ~/.ssh/config
# You may have other (non-CodeCommit) SSH credentials stored in this
# config file – in addition to the CodeCommit settings shown below.
# NOTE: Make sure to run [ chmod 600 ~/.ssh/config ] after creating this file!
# Credentials for Account1
Host awscc-account1 # 'awscc-account1' is a name you pick
Hostname git-codecommit.us-east-1.amazonaws.com # This points to CodeCommit in the 'US East' region
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@ejangi
ejangi / nginx-custom-error-pages.conf
Created June 7, 2015 01:09
NGINX Custom Error Pages
http {
...
server {
...
error_page 401 @401;
location @401 {
root /srv/www/error-documents/public;
try_files /401.html =401;
}
@gusennan
gusennan / crypt_unlock.sh
Created March 7, 2015 17:57
initramfs-hook for unlocking LUKS-encrypted LVM partition
#!/bin/sh
PREREQ="dropbear"
prereqs() {
echo "$PREREQ"
}
case "$1" in
prereqs)
@dedy-purwanto
dedy-purwanto / gist:11312110
Created April 26, 2014 05:00
Bulk remove iTerm2 color schemes.
# There was a day where I have too many color schemes in iTerm2 and I want to remove them all.
# iTerm2 doesn't have "bulk remove" and it was literally painful to delete them one-by-one.
# iTerm2 save it's preference in ~/Library/Preferences/com.googlecode.iterm2.plist in a binary format
# What you need to do is basically copy that somewhere, convert to xml and remove color schemes in the xml files.
$ cd /tmp/
$ cp ~/Library/Preferences/com.googlecode.iterm2.plist .
$ plutil -convert xml1 com.googlecode.iterm2.plist
$ vi com.googlecode.iterm2.plist
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active April 22, 2024 01:47
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@mntmn
mntmn / mbp_retina_trackpad.md
Created November 10, 2013 19:02
Good setup for MacBook Pro Retina 13" trackpad in Linux/Xorg/X11 (Debian jessie for me). Handles resting thumb and thumb-click-indefinger-drag correctly. Also fixes jerk/jump on very small movements that ought to be precise.
  1. Use xf86-input-mtrack

Debian Jessie (w/ gnome3) uses the "synaptics" xf86 input module as a default. It is very precise but doesn't support "resting thumb" behaviour that you're used to from OSX.

xf86-input-mtrack is an enhancement of xf86-input-multitouch which is configurable. I built it from source from here: https://github.com/BlueDragonX/xf86-input-mtrack But i see that it's also in the debian package repo. So you probably only need to do:

sudo aptitude install xserver-xorg-input-mtrack

I created an override config in /etc/X11/xorg.conf.d/50-synaptics.conf (create the directory if it doesn't exist) which looks like this:

@trinitronx
trinitronx / Install_XCode.applescript
Created August 15, 2013 00:03
Script to automate XCode installation. Tested on OSX 10.8.4 Mountain Lion. I feel like using the UI element hierarchy is quite disgusting, but it works for now...
-- Function to select a menu item
-- We will use this to trigger the search box for the App Store
on do_menu(app_name, menu_name, menu_item)
try
-- bring the target application to the front
tell application app_name
activate
end tell
tell application "System Events"
tell process app_name