Skip to content

Instantly share code, notes, and snippets.

View CajuCLC's full-sized avatar
🌎
Anacardium occidentale

Eric Cavalcanti CajuCLC

🌎
Anacardium occidentale
View GitHub Profile
@CajuCLC
CajuCLC / unifiLedControllScript.sh
Last active December 17, 2021 08:49 — forked from TimoDJatomika/unifiLedControllScript.sh
Just a simple script to controll the led color of your ubiquiti unifi AP (PRO)
#!/bin/sh
# author: Timo Stankowitz <timo.stankowitz@gmail.com>
# create date: 2016-07-10
# last change: 2016-07-10
# with this script you can change the led color of your ubiquiti unifi AP
# usage: ./script.sh colorValue
# e.g.: ./script.sh 2
#! /usr/bin/env bash
UPTIME_DAYS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 / 86400)
UPTIME_HOURS=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 / 3600)
UPTIME_MINUTES=$(expr `cat /proc/uptime | cut -d '.' -f1` % 31556926 % 86400 % 3600 / 60)
# Basic info
HOSTNAME=`uname -n`
ROOT=`df -Ph | grep -w nbd0p1 | awk '{print $4}' | tr -d '\n'`
@CajuCLC
CajuCLC / gist:90c793699ed3deaf9dbe98289b70214e
Created September 9, 2019 14:38 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@CajuCLC
CajuCLC / README.mkd
Created May 29, 2019 23:22 — forked from vrillusions/README.mkd
Generate gpg key via batch file

Introduction

This is how to create a gpg key without any user interaction or password. This can be used in cases where the primary goal is to secure the data in transit but the gpg key can/must be stored locally without a password. An example of this is the hiera-gpg plugin which doesn't support passwords.

The below genkey-batch file will use the default which currently are RSA/RSA and 2048 bit length. See the reference link to set this to something else.

References

@CajuCLC
CajuCLC / kubectl-shortcuts.sh
Created April 11, 2019 07:00 — forked from tamas-molnar/kubectl-shortcuts.sh
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@CajuCLC
CajuCLC / customer_account.xml
Created March 12, 2019 22:38 — forked from matt-bailey/customer_account.xml
Disable My Account sidebar links in Magento 2
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!-- Remove unwanted account navigation links -->
@CajuCLC
CajuCLC / customer_account.xml
Created March 12, 2019 22:38 — forked from matt-bailey/customer_account.xml
Disable My Account sidebar links in Magento 2
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!-- Remove unwanted account navigation links -->
@CajuCLC
CajuCLC / Install composer on Amazon AMI running on EC2
Created September 10, 2018 01:51 — forked from asugai/Install composer on Amazon AMI running on EC2
Install composer on Amazon AMI running on EC2
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@CajuCLC
CajuCLC / remove-all-from-docker.sh
Created August 30, 2018 18:19 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
# use a desktop user-agent string
#user-agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1"
# use a mobile user-agent string
#user-agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"
# When following a redirect, automatically set the previous URL as referer.
#referer = ";auto"
referer = "http://domain.com"