Skip to content

Instantly share code, notes, and snippets.

View rafaelfelini's full-sized avatar
🏠
Working from home

Rafael Felini rafaelfelini

🏠
Working from home
View GitHub Profile
@lbbedendo
lbbedendo / kubedf.sh
Created January 24, 2022 14:49 — forked from redmcg/kubedf
Bash script to show k8s PVC usage
#!/usr/bin/env bash
function getNodes() {
kubectl get --raw=/api/v1/nodes | jq -r '.items[].metadata.name'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
'{name: .pvcRef.name, capacityBytes, usedBytes, availableBytes, '\
'percentageUsed: (.usedBytes / .capacityBytes * 100)}] | sort_by(.name)'
@cdelaitre
cdelaitre / docker-compose-tick.yml
Last active March 22, 2021 20:01
Monitor Docker Swarm with the InfluxData TICK Stack
version: '3'
services:
# FRONT
chronograf:
# Full tag list: https://hub.docker.com/r/library/chronograf/tags/
image: chronograf
deploy:
replicas: 1
placement:
constraints:
@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active June 30, 2024 04:50
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
;;all the available sizes as a map with indexes.
;; ex {:pp 0, :p 1}
(def sizes
(apply hash-map
(flatten
(map-indexed
(fn [i s] (list (keyword s) i))
'(pp, p, m, mm, g, gg, a, aa)))))
;; the comparator itself. takes s (the map of available sizes as argument)
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@solnic
solnic / osx_rails_env_setup_in_6_steps.md
Created March 29, 2012 12:33
6 steps to get up'n'running with Rails on OS X

6 steps to set up a rails development environment on OS X:

  • install Apple Command Line Tools
  • install homebrew[1]: /usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
  • install rvm: bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
  • install ruby rvm install 1.9.3
  • install rails
(ns expimp.core
(:use [korma.core]
[korma.db]))
(defdb src (mysql
{:db "xx"
:user "xx" :password "xx"
:host "myrds.us-east-1.rds.amazonaws.com"}))
(defdb target (postgres {:db "xx" :user "xx" :password "xx"}))
@rafaelfelini
rafaelfelini / remove_file_from_git.sh
Created November 4, 2011 01:01
Remove files in .gitignore from version control
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"