Skip to content

Instantly share code, notes, and snippets.

@jxson
jxson / README.md
Created February 10, 2012 00:18
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

@sidwarkd
sidwarkd / pi_stats.js
Last active December 22, 2023 14:23
Python and NodeJS example code for getting memory and cpu usage information on the Raspberry Pi
'use strict'
// A very simple nodeJS script that demonstrates how you can access
// memory usage information similar to how free -m works on the
// Raspberry Pi. Goes with µCast #14. http://youtu.be/EqyVlTP4R5M
// Usage: node pi_mem.js
// Example Output
//
@bzerangue
bzerangue / recursive-chmod.md
Last active November 22, 2022 23:09
Scripts for recursively chmod directories only and recursively chmod files only

Useful commands

You may find these commands useful when adjusting file and directory permissions.

To recursively chmod directories only:

find /your/site/root -type d -exec chmod 755 {} \;

To recursively chmod files only:

@tessus
tessus / teksavvy_usage.py
Created July 31, 2014 05:40
retrieve TekSavvy data usage via API key
#!/opt/local/bin/python
import httplib, json
APIKEY = "YOUR_API_KEY_HERE"
headers = {"TekSavvy-APIKey": APIKEY}
conn = httplib.HTTPSConnection("api.teksavvy.com")
conn.request('GET', '/web/Usage/UsageSummaryRecords?$filter=IsCurrent%20eq%20true', '', headers)
response = conn.getresponse()
@bcantoni
bcantoni / Vagrantfile
Created September 15, 2014 22:20
Example of passing a host environment variable through to a guest, using Vagrant script provisioner
# -*- mode: ruby -*-
# vi: set ft=ruby :
# test setting a guest environment variable based on a host environment variable
# if FOO_BAR is set locally, create command to add it to .profile in the guest
env_var_cmd = ""
if ENV['FOO_BAR']
value = ENV['FOO_BAR']
env_var_cmd = <<CMD
@Artanis
Artanis / passwordsafe-sync.md
Last active April 18, 2019 10:43
Build a syncronized password store using PasswordSafe and Google Drive, Dropbox, or Box.
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active May 19, 2024 11:02
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@hhcordero
hhcordero / 1_Dockerised_JMeter.md
Last active March 30, 2022 13:44
Dockerized JMeter - A Distributed Load Testing Workflow
@maxcnunes
maxcnunes / alias-docker-compose.sh
Last active August 27, 2023 15:11
Aliases for docker-compose
alias c='docker-compose'
alias cb='docker-compose build'
alias cup='docker-compose up'
alias cr='docker-compose run --service-ports --rm'
alias crl='docker-compose run --service-ports --rm local'
alias crd='docker-compose run --service-ports --rm develop'
alias crt='docker-compose run --rm test'
alias crp='docker-compose run --rm provision'
alias crci='docker-compose run --rm ci'
alias crwt='docker-compose run --rm watchtest'
@guillaumewuip
guillaumewuip / gitlab_ci.yml
Created June 26, 2016 16:49
Gitlab CI to dokku
###############################################################################
# Variables #
###############################################################################
variables:
DOKKU_HOST: 'host.com'
PROJECT_NAME: 'project_name'
###############################################################################
# Cache #
###############################################################################