Skip to content

Instantly share code, notes, and snippets.

@ohshhh
ohshhh / clean-docker-for-mac.sh
Created August 30, 2017 18:58 — forked from MrTrustor/clean-docker-for-mac.sh
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
@ohshhh
ohshhh / kubernetes_on_macOS.md
Created January 21, 2017 07:19 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@ohshhh
ohshhh / pedantically_commented_playbook.yml
Created January 21, 2017 04:33 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@ohshhh
ohshhh / logrotate.markdown
Created February 16, 2016 23:58 — forked from mattyoho/logrotate.markdown
Logrotate

Install

brew install logrotate

add to .bash_profile

export PATH=${PATH}:/usr/local/sbin

restart terminal just to check the logrotate command returns something

logrotate -?

make logrotate.d directory inside of /etc/ and add new config file

@ohshhh
ohshhh / osx-for-hackers.sh
Created February 5, 2016 21:10 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@ohshhh
ohshhh / osx_ramdisk.sh
Last active November 9, 2016 13:10 — forked from jnschulze/osx_ramdisk.sh
RamDisk Usage OSX
#!/bin/bash
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
#DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://1572864`
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://2097152`
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK
CACHEDIR="/Volumes/RamDiskCache/$USER"
@ohshhh
ohshhh / multiple_ssh_setting.md
Created December 19, 2015 01:39 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@ohshhh
ohshhh / graphite.md
Last active January 15, 2016 00:41 — forked from relaxdiego/graphite.md
Install graphite on OS X Mavericks

Follow these steps to install graphite on OS X Mavericks.

Prerequisites

  • Homebrew
  • Python 2.7
  • Git

Install dependencies

Install Cairo and friends

Resize a Hard Disk for a Virtual Machine

Our Virtual Machines are provisioned using Vagrant from a Linux base box to run using VirutalBox. If the Hard Disk space runs out and you cannot remove files to free-up space, you can resize the Hard Disk using some VirtualBox and Linux commands.

Some assumptions

The following steps assume you've got a set-up like mine, where:

@ohshhh
ohshhh / uninstall_homebrew.sh
Last active January 15, 2016 12:37 — forked from mxcl/uninstall_homebrew.sh
Brew uninstall
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e