Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# THE BEER-WARE LICENSE:
# <leokewitz@gmail.com> wrote this file. As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return.
# Leonardo Kewitz
# Color codes
red='\033[0;31m'
yellow='\033[0;33m'
@PG2000
PG2000 / cfg-init
Last active November 8, 2019 19:07
git clone --bare https://github.com/PG2000/dotfiles.git $HOME/.dotfiles
function config {
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@
}
mkdir -p .dotfiles-backup
config checkout
if [ $? = 0 ]; then
echo "Checked out config.";
else
echo "Backing up pre-existing dot files.";
uaac target --skip-ssl-validation https://uaa.dev.cfdev.sh
uaac token client get admin -s admin-client-secret
uaac client add uaa-credentials-broker \
--name uaa-credentials-broker \
--authorized_grant_types client_credentials \
--authorities scim.write,uaa.admin,cloud_controller.admin \
--scope uaa.none
git clone https://github.com/cloudfoundry-community/uaa-credentials-broker.git
@PG2000
PG2000 / clean_code.md
Created June 3, 2019 09:22 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

https://gist.github.com/plentz/6737338
https://www.owasp.org/index.php/SCG_WS_nginx#SSL_Module
https://scotthelme.co.uk/a-new-security-header-referrer-policy/
@PG2000
PG2000 / docker-cleanup-resources.md
Created July 8, 2017 07:56 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@PG2000
PG2000 / SassMeister-input.scss
Created January 12, 2016 20:15
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
$gray1: rgba(10, 10, 10, 1);
$gray2: rgba(10, 10, 10, 1);
$myColors:(
gray1: (
color: $gray1