Skip to content

Instantly share code, notes, and snippets.

@PauloBoaventura
PauloBoaventura / nginx.conf
Created June 30, 2022 19:46 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@PauloBoaventura
PauloBoaventura / .htaccess
Created May 25, 2022 20:18 — forked from jennimckinnon/.htaccess
Default .htaccess file for subdomain installations of WordPress Multisite for versions 3.5+.
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
@PauloBoaventura
PauloBoaventura / github_desktop_ubuntu.sh
Created May 27, 2021 23:18 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
#sudo wget https://github.com/shiftkey/desktop/releases/download/release-2.1.0-linux1/GitHubDesktop-linux-2.1.0-linux1.deb
#sudo gdebi GitHubDesktop-linux-2.1.0-linux1.deb
# UPDATE (2021-03-05): Thanks to PaoloRanzi81's comment, the updated code is as follows https://gist.github.com/PaoloRanzi81
sudo wget https://github.com/shiftkey/desktop/releases/download/release-2.6.3-linux1/GitHubDesktop-linux-2.6.3-linux1.deb
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-2.6.3-linux1.deb
@PauloBoaventura
PauloBoaventura / composer.php.ini
Created April 27, 2021 04:05 — forked from fprochazka/composer.php.ini
Composer with different ini or with different PHP
[php]
memory_limit = -1
max_execution_time = 0
date.timezone = "Europe/Prague"
realpath_cache_size = "4096K"
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
@PauloBoaventura
PauloBoaventura / customer-export.php
Created April 17, 2021 01:11 — forked from derak-kilgo/customer-export.php
CLI php script to export customers from magento to CSV using direct access to a magento collection.
<?php
if(php_sapi_name()!=="cli"){
echo "Must be run from the commend line.";
};
/**
* Setup a magento instance so we can run this export from the command line.
*/
require_once('app/Mage.php');
umask(0);
if (!Mage::isInstalled()) {
@PauloBoaventura
PauloBoaventura / grab-anchor-episode.sh
Created December 29, 2020 13:40 — forked from ivan/grab-anchor-episode.sh
Download a podcast episode from anchor.fm
#!/usr/bin/env bash
# Download a podcast episode from anchor.fm
#
# Usage:
# grab-anchor-episode https://anchor.fm/emerge/episodes/Robert-MacNaughton---Learnings-from-the-Life-and-Death-of-the-Integral-Center-e31val
#
# anchor.fm serves a list of m4a files that need to be concatenated with ffmpeg.
set -eu -o pipefail
@PauloBoaventura
PauloBoaventura / xampp-nginx-ubuntu-ec2.md
Created December 3, 2020 08:24 — forked from huynhsamha/xampp-nginx-ubuntu-ec2.md
Config XAMPP with NGINX on Ubuntu 16.04 AWS EC2

Install NGINX

bla bla...

Install XAMPP

# Download
wget https://www.apachefriends.org/xampp-files/7.2.2/xampp-linux-x64-7.2.2-0-installer.run

# Install
chmod +x xampp-linux-x64-5.6.33-0-installer.run
@PauloBoaventura
PauloBoaventura / setup.sh
Created November 24, 2020 23:28 — forked from clivewalkden/setup.sh
How to add swap to CentOS 7
# Check if we already have swap
swapon -s
# Second Check
free -m
# Check available space
df -h
# Generate the file (4GB)
@PauloBoaventura
PauloBoaventura / Download-Build2020.ps1
Created November 20, 2020 18:19 — forked from caseymullineaux/Download-Build2020.ps1
A simple script to download on-demand content from Microsoft Build
param (
# Verify the sessions file exists
[ValidateScript( {
if (-Not ($_ | Test-Path)) {
throw "File does not exist"
}
return $true
})]
[System.IO.FileInfo]$InputFile,