Skip to content

Instantly share code, notes, and snippets.

View VirtuBox's full-sized avatar
🏠
Working from home

VirtuBox VirtuBox

🏠
Working from home
View GitHub Profile
@VirtuBox
VirtuBox / backup.php
Last active May 19, 2023 19:18
A simple php script to backup a database and getting db parameters from wp-config.php if available
<?php
/** Define ABSPATH as this file's directory */
if (! defined('ABSPATH')) {
define('ABSPATH', __DIR__ . '/');
}
/* If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
* doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
* of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
@VirtuBox
VirtuBox / ssl-ee-acme.sh
Last active February 28, 2018 17:46
.bashrc functions to use acme.sh with EasyEngine
ssl-ee-domain ()
{
read -p "Enter your domain name: " domain_name
~/.acme.sh/acme.sh --issue -d $domain_name -d www.$domain_name --keylength ec-384 --dns dns_cf --dnssleep 60
# create folder to store certificate
mkdir -p /etc/nginx/acme.sh/$domain_name
@VirtuBox
VirtuBox / sshd_config
Created March 1, 2018 12:35
default sshd config ubuntu
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
@VirtuBox
VirtuBox / sources.list
Last active March 1, 2018 14:41
debian 8 Jessie - apt sources.list
#------------------------------------------------------------------------------#
# OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#
###### Debian Main Repos
deb http://ftp.fr.debian.org/debian/ oldstable main contrib non-free
deb http://ftp.fr.debian.org/debian/ oldstable-updates main contrib non-free
deb http://security.debian.org/ oldstable/updates main
@VirtuBox
VirtuBox / sources.list
Created March 1, 2018 13:21
Ubuntu 16.04 sources.list
#------------------------------------------------------------------------------#
# OFFICIAL UBUNTU REPOS #
#------------------------------------------------------------------------------#
###### Ubuntu Main Repos
deb http://fr.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
###### Ubuntu Update Repos
deb http://fr.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
@VirtuBox
VirtuBox / config.json
Last active March 25, 2018 00:24
xmrigCC configuration example for install script
{
"algo": "cryptonight",
"av": null,
"aesni": 0,
"threads": 0,
"multihash-factor": 0,
"multihash-thread-mask": null,
"background": false,
"colors": true,
"cpu-affinity": null,
@VirtuBox
VirtuBox / docker-compose.yml
Last active April 6, 2018 22:30
Gitlab-ce Docker Compose
postgresql:
restart: always
image: sameersbn/postgresql:9.6-2
environment:
- DB_USER=gitlab
- DB_PASS=password
- DB_NAME=gitlabhq_production
volumes:
- /home/gitlab/postgresql:/var/lib/postgresql
gitlab:
@VirtuBox
VirtuBox / wp-config.php
Last active May 14, 2018 16:18
Custom end of wp-config.php
/* Specify maximum number of Revisions. */
define( 'WP_POST_REVISIONS', '10' );
/* Trash Days. */
define( 'EMPTY_TRASH_DAYS', '15' );
/* PHP Memory */
define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );
define('WP_DEBUG', false);
@VirtuBox
VirtuBox / rewrite-route.conf
Created May 13, 2018 00:30
nginx rewrite rules for custom seo friendly url php script
location /
{
try_files $uri @url;
}
location ~ \.php$
{
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php7;
}
@VirtuBox
VirtuBox / speedtest.sh
Created May 24, 2018 00:41
speedtest.sh
#!/bin/bash
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli
./speedtest-cli --share