Skip to content

Instantly share code, notes, and snippets.

View ClaudioVarandas's full-sized avatar

Cláudio Varandas ClaudioVarandas

  • Lisbon Portugal
  • 01:23 (UTC +01:00)
View GitHub Profile
FWC 4
FWC 6
FWC 12
FWC 16
QAT 1
QAT 6
QAT 8
QAT 10
QAT 12
QAT 14
@ClaudioVarandas
ClaudioVarandas / rabbitmq.txt
Created March 9, 2020 16:21 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@ClaudioVarandas
ClaudioVarandas / full_url.php
Created December 5, 2019 12:18
PHP Full url
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
@ClaudioVarandas
ClaudioVarandas / dns_probe.sh
Last active October 15, 2019 14:12
ASUS RT-AC87U DNS PROBE disable
xxx@RT-AC87U-C698:/tmp/home/root# nvram show | grep dns_probe
dns_probe=0
size: 55132 bytes (10404 left)
dns_probe_host=dns.msftncsi.com
dns_probe_content=131.107.255.255 fd3e:4f5a:5b81::1
xxx@RT-AC87U-C698:/tmp/home/root# nvram set dns_probe_content=0.0.0.0
xxx@RT-AC87U-C698:/tmp/home/root# nvram set dns_probe_host=""
xxx@RT-AC87U-C698:/tmp/home/root# nvram commit
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
git fetch --prune
@ClaudioVarandas
ClaudioVarandas / datetime.php
Created February 26, 2019 14:29 — forked from graste/datetime.php
PHP DateTime class – parsing and formatting ISO8601 dates with or w/o fractions of a second
<?php
echo 'default locale: ' . \Locale::getDefault();
echo PHP_EOL;
echo 'default timezone: ' . \date_default_timezone_get();
echo PHP_EOL;
// see http://tools.ietf.org/html/rfc3339#section-5.8 for example datetimes
// bug report on missing fractions support: https://bugs.php.net/bug.php?id=51950
// feature request for fractions support in constructor: https://bugs.php.net/bug.php?id=49779
@ClaudioVarandas
ClaudioVarandas / docker-compose.yml
Created February 20, 2019 06:50
Docker compose - postgres+pgadmin4
version: '3.5'
services:
postgres:
container_name: be_postgres
image: postgres
environment:
POSTGRES_USER: super
POSTGRES_PASSWORD: super
PGDATA: /data/postgres
@ClaudioVarandas
ClaudioVarandas / certbot.sh
Created January 2, 2019 12:42
certbot renew crontab
05 1 30 * * root /usr/bin/certbot renew --post-hook "systemctl reload httpd"
kill $(ps aux | grep '[p]hp' | awk '{print $2}')
@ClaudioVarandas
ClaudioVarandas / docker-destroy-all.sh
Created September 27, 2017 11:07 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)