Skip to content

Instantly share code, notes, and snippets.

@hotsaucejake
hotsaucejake / FasterRefreshDatabase.php
Created June 17, 2023 12:05
Checksum Faster Refresh Database Trait for Laravel Tests
<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\RefreshDatabaseState;
use Symfony\Component\Finder\Finder;
/**
@hotsaucejake
hotsaucejake / mysql-size.md
Last active February 7, 2019 17:41
Size of mysql database
SELECT table_schema "DB Name",
        ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" 
FROM information_schema.tables 
GROUP BY table_schema; 
@hotsaucejake
hotsaucejake / swap.md
Last active October 29, 2018 20:25
Enable Swap Space for Moss Servers

Check System Swap

Before working make sure that system has already swap enabled. If there is no swap, you will get output header only.

sudo swapon -s

Create Swap File

Lets create a file to use for swap in system of required size. Before making file make sure you have enough free space on disk. Generally, it recommends that swap should be equal to double of installed physical memory.

@hotsaucejake
hotsaucejake / gitcommit.template
Created April 17, 2017 20:02
Commit template for git
# This commit will...
- Reason(s):
- Change(s):
- Reference(s):
@hotsaucejake
hotsaucejake / find-remove-by-extension.md
Created February 14, 2017 20:58
remove files with specific extension
find . -name "*.DS_Store" -type f -delete
@hotsaucejake
hotsaucejake / etc-hosts.md
Created February 14, 2017 20:35
override local DNS (OS X)

open the hosts file

sudo nano /private/etc/hosts

edit and save

flush cache to update

@hotsaucejake
hotsaucejake / wget-mirror.md
Last active February 14, 2017 19:54
How to mirror a site via wget
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent --backup-converted --no-host-directories --timestamping --force-html <URL>