Skip to content

Instantly share code, notes, and snippets.

View kuttumiah's full-sized avatar

Md Robaiatul Islam kuttumiah

View GitHub Profile
@kuttumiah
kuttumiah / cleanup.sh
Created November 21, 2018 13:28
Clean up temporary files in laravel project
#!/bin/bash
# clean all temporaty files of a laravel application
# place this file at the root of the project and make it executable
php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan clear-compiled
php artisan config:cache
@kuttumiah
kuttumiah / downgrade.sh
Last active October 30, 2019 16:32 — forked from reagent/downgrade.sh
Downgrade Apache + PHP on Ubuntu 18.04 LTS (Bionic Beaver)
cat <<EOF >> /etc/apt/sources.list
deb [trusted=yes] http://eu-west-2.ec2.archive.ubuntu.com/ubuntu/ precise main restricted universe
deb [trusted=yes] http://eu-west-2.ec2.archive.ubuntu.com/ubuntu/ precise-updates main restricted universe
deb [allow-insecure=yes] http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse
EOF
apt-get update
apt-get purge \
apache2 \
@kuttumiah
kuttumiah / certbot_renewal_with_logging.sh
Created August 8, 2021 00:58
Perform certbot renewal and log the output for audit/debug functionality.
#!/bin/bash
# Log the time of the job
echo $(date -I'seconds') >>/home/ec2-user/certbot-renew.log 2>&1
# Run renewal command
certbot renew --no-self-upgrade >>/home/ec2-user/certbot-renew.log 2>&1
echo >>/home/ec2-user/certbot-renew.log 2>&1
echo >>/home/ec2-user/certbot-renew.log 2>&1
@kuttumiah
kuttumiah / vdi-file-compacting.md
Created October 15, 2022 20:20
How to compact VirtualBox's VDI file size?

Source: StackOverflow

1. Run defrag in the guest (Windows only)

2. Nullify free space:

With a Linux Guest run this:

sudo dd if=/dev/zero | pv | sudo dd of=/bigemptyfile bs=4096k
sudo rm -rf /bigemptyfile