Skip to content

Instantly share code, notes, and snippets.

View donkeysharp's full-sized avatar
💭
Breaking it... Fixing it... Dreaming it... Coding it...

Sergio Guillen donkeysharp

💭
Breaking it... Fixing it... Dreaming it... Coding it...
View GitHub Profile
@donkeysharp
donkeysharp / package.json
Created January 14, 2016 21:17
package.json to use npm as a build tool for react applications using sass and ES2015
{
"name": "my-npm-boilerplate",
"version": "1.0.0",
"description": "Example structure for using npm as a build tool",
"main": "index.js",
"scripts": {
"clean": "rm -rf dist; mkdir -p dist/css dist/js",
"build": "parallelshell 'npm run clean' 'npm run build:js' 'npm run build:css'",
"build:js": "browserify js/index.js -t [ babelify --presets [es2015 react] ] | uglifyjs -mc -o dist/js/main.min.js",
"build:css": "sass scss/main.scss:dist/css/main.min.css --style compressed --sourcemap=none",
@donkeysharp
donkeysharp / 0-auto-manged-chef-repo.md
Created May 12, 2016 17:53 — forked from gmr/0-auto-manged-chef-repo.md
This gist has files that are used to automate chef repository submodules used for roles, data bags, cookbooks and environments, ultimately uploading the maintained chef repository to chef via knife using Jenkins and Github.

The files in this gist are for having Jenkins automatically manage a chef repository using git submodules. This allows for clean, clutter free management of individual cookbooks, and individual respositories for roles, environments and data bags in our chef-repo.

The process relies on using Github (we use Github Enterprise) and Jenkins in combination with the Jenkins Github plugin to notify Jenkins when a repository has changed.

Our chef-repo directory looks something like:

chef-repo
    - cookbooks
          - Each cookbook is a git submodule managed by Jenkins
    - data_bags (git submodule managed by Jenkins)
Using "lsof" in the Real World
==============================
by Chris Harrison, October 2008
lsof ("LiSt Open Files") is a tool to list open file handles on a server. Being able to filter these handles using the range of options and switches for lsof allows the Solaris administrator to diagnose a number of problems.
This guide explains a couple of the command-line options to lsof, and then shows several examples of how lsof can be used in the "real world". (Note: This should work on all Solaris versions from 8 onwards; it might work on earlier versions, but I've not tried it.)
Obtaining "lsof"
@donkeysharp
donkeysharp / build_artifact.py
Created June 26, 2016 22:42 — forked from grncdr/build_artifact.py
script to pack up a python project and all of it's dependencies in a tarfile using virtualenv
import subprocess
import shutil
import os
import sys
import tarfile
def get_version(project_root):
process = subprocess.Popen(
['git', 'describe'],
stdout=subprocess.PIPE,
@donkeysharp
donkeysharp / shared_folder_centos_virtualbox.txt
Created September 1, 2016 21:20 — forked from larsar/shared_folder_centos_virtualbox.txt
Mount shared folder on CentOS in VirtualBox
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot
@donkeysharp
donkeysharp / latency.txt
Created January 31, 2017 17:37 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
diff --git a/cmd/drone-docker-ecr/main.go b/cmd/drone-docker-ecr/main.go
index d27bd00..6907ee2 100644
--- a/cmd/drone-docker-ecr/main.go
+++ b/cmd/drone-docker-ecr/main.go
@@ -19,8 +19,8 @@ func main() {
var registryIds []*string
var (
ecrRegion = getenv("ECR_REGION", "PLUGIN_REGION")
- accessKey = getenv("ECR_ACCESS_KEY", "PLUGIN_ACCESS_KEY")
- secretKey = getenv("ECR_SECRET_KEY", "PLUGIN_SECRET_KEY")

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

Common step after enter run the patch command:

  • After run the commands, start new Sublime Text app, go to Main Menu > Help > Enter License. On the popup type in any text (example "a") and click Use Licence .

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

Common step after enter run the patch command:

  • After run the commands, start new Sublime Text app, go to Main Menu > Help > Enter License. On the popup type in any text (example "a") and click Use Licence .