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 / a-windows-tools-and-utils.md
Last active March 11, 2021 07:33
Useful Windows Tools & Utilities
@VirtuBox
VirtuBox / Readme.md
Last active July 9, 2023 11:38
VPS Benchmark Script using sysbench

Simple bash script to perform benchmark using sysbench

Benchmarks :

  • CPU
  • RAM
  • Disk
bash <(wget -qO - https://gist.githubusercontent.com/VirtuBox/ebdb8d30690eda6834d5b62798dc4a02/raw/e7834c5a70cba397aa161a47a6a26016d8b08825/sysbench.sh)
location ~ ^/.* {
include proxy_params;
sub_filter 'transfer.sh' 'domaine.tld';
sub_filter 'transfer.sh' 'domaine.tld';
sub_filter_once off;
proxy_pass http://127.0.0.1:8080;
}
@VirtuBox
VirtuBox / functions.php
Created August 22, 2018 15:20
[WordPress] Replace WordPress logo on the page wp-login.php
// custom admin login logo
function custom_login_logo() {
echo '<style type="text/css">
h1 a { background-image: url(' . get_stylesheet_directory_uri() . '/images/logo.png) !important; }
</style>';
}
add_action('login_head', 'custom_login_logo');
@VirtuBox
VirtuBox / Readme.md
Last active December 3, 2018 10:50
install cheat.sh

Install cht.sh

bash <(wget -qO - https://gist.githubusercontent.com/VirtuBox/af97c7076173b9b145b09882e721a9d7/raw/ccb006f36cf9101025c79696610ba51db3328db6/cheat-install.sh )
@VirtuBox
VirtuBox / backup-disk-dd-sshfs.md
Last active September 16, 2020 16:48
Backup disk on a remote storage with dd & sshfs

Install sshfs & pigz (multithreaded gzip) or zstd

sudo apt-get install sshfs pigz zstd -y

create and mount remote storage with sshfs

sudo mkdir /mnt/remote
@VirtuBox
VirtuBox / transfer.bashrc
Created July 12, 2018 09:02
transfer.vtbox.net bashrc alias
transfer() {
curl --progress-bar --upload-file $1 https://transfer.vtbox.net/$(basename $1) | tee /dev/null;
}
alias transfer=transfer
@VirtuBox
VirtuBox / wordpress.conf
Last active June 6, 2018 22:30
Nginx reverse-proxy with proxy_cache for WordPress
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:75m inactive=24h max_size=8096m;
server {
server_name cdn.yourdomain.tld yourdomain.tld www.yourdomain.tld;
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl on;
ssl_certificate //path/to/ssl/yourdomain.tld/fullchain.pem;
ssl_certificate_key //path/to/ssl/yourdomain.tld/key.pem;
@VirtuBox
VirtuBox / innodb_log_file_size.sh
Last active June 1, 2018 15:17
script to apply new innodb_log_file_size defined in /etc/mysql/my.cnf
#!/bin/bash
echo "edit the variable innodb_log_file_size in /etc/mysql/my.cnf before launching this script"
echo "do you want to launch the script ? [y/n]"
read -r start
if [ "$start" = "n" ]; then
exit 1
elif [[ "$start" = "y" ]]; then
@VirtuBox
VirtuBox / fail2ban.sh
Created May 25, 2018 13:44
update fail2ban to the 0.10 release
#!/bin/bash
git clone https://github.com/fail2ban/fail2ban.git
cd fail2ban
sudo python setup.py install
cp build/fail2ban.service /lib/systemd/system/fail2ban.service -f
systemctl daemon-reload
service fail2ban restart