Skip to content

Instantly share code, notes, and snippets.

View ClaudioVarandas's full-sized avatar

Cláudio Varandas ClaudioVarandas

  • Lisbon Portugal
  • 16:33 (UTC +01:00)
View GitHub Profile
@ClaudioVarandas
ClaudioVarandas / create_selfsigned_fedora.sh
Created May 4, 2017 09:26
Create a Self-Signed Certificate Fedora
#Issue the following command to generate your self-signed certificate.
#Change example.com to reflect the fully qualified domain name (FQDN) of the site you intend to use with SSL:
#1
openssl req -new -x509 -sha256 -days 365 -nodes -out /etc/pki/tls/certs/example.com.crt -keyout /etc/pki/tls/private/example.com.key
#This command creates a .crt file under the /etc/pki/tls/certs directory, and a .key file under /etc/pki/tls/private using these options:
#-nodes instructs OpenSSL to create a certificate that does not require a passphrase. If this option is excluded, you will be required to enter the the passphrase in the console each time the application using it is restarted.
#-days determines the length of time in days that the certificate is being issued for. For a self-signed certificate, this value can be increased as necessary.
#-sha256 ensures that the certificate request is generated using 265-bit SHA (Secure Hash Algorithm).
@ClaudioVarandas
ClaudioVarandas / laravel_perm.sh
Created May 30, 2017 14:02
Laravel permissions
sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
@ClaudioVarandas
ClaudioVarandas / vag_centos_lamp.sh
Created May 30, 2017 14:04
Vagrant centos lamp
#!/usr/bin/env bash
sudo yum -y update
sudo yum -y install epel-release
sudo yum -y install wget vim
setenforce 0
sed -i 's/SELINUX=\(enforcing\|permissive\)/SELINUX=disabled/g' /etc/selinux/config
@ClaudioVarandas
ClaudioVarandas / vag_centos_lamp.sh
Created May 30, 2017 14:04
Vagrant centos lamp
#!/usr/bin/env bash
sudo yum -y update
sudo yum -y install epel-release
sudo yum -y install wget vim
setenforce 0
sed -i 's/SELINUX=\(enforcing\|permissive\)/SELINUX=disabled/g' /etc/selinux/config
@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)
kill $(ps aux | grep '[p]hp' | awk '{print $2}')
@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"
@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 / 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
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