Skip to content

Instantly share code, notes, and snippets.

View leonj1's full-sized avatar
💭
Coding on the brain

Jose M Leon leonj1

💭
Coding on the brain
View GitHub Profile
@leonj1
leonj1 / kernel_task_cpu_fix
Created July 17, 2018 17:41
Fix kernel_task high CPU usage on OS X
# Boot to recovery mode and disable system integrity protection
csrutil disable
# Reboot to regular mode and purge these motherfuckin plists
sudo rm -f /System/Library/Extensions/IOPlatformPluginFamily.kext/Contents/PlugIns/ACPI_SMC_PlatformPlugin.kext/Contents/Resources/*.plist
# Reboot to recovery mode and enable system integrity protection
csrutil enable
# Reboot
@leonj1
leonj1 / gh-pages-deploy.md
Created July 16, 2018 15:41 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@leonj1
leonj1 / zook_grow.md
Created June 13, 2018 18:17 — forked from miketheman/zook_grow.md
Adding nodes to a ZooKeeper ensemble

Adding 2 nodes to an existing 3-node ZooKeeper ensemble without losing the Quorum

Since many deployments may start out with 3 nodes and so little is known about how to grow a cluster from 3 memebrs to 5 members without losing the existing Quorum, here is an example of how this might be achieved.

In this example, all 5 nodes will be running on the same Vagrant host for the purpose of illustration, running on distinct configurations (ports and data directories) without the actual load of clients.

YMMV. Caveat usufructuarius.

Step 1: Have a healthy 3-node ensemble

@leonj1
leonj1 / gist:05530441ed021461d787201e42602ef6
Created April 5, 2018 16:13 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote