Skip to content

Instantly share code, notes, and snippets.

View hose1021's full-sized avatar

Michael Hose hose1021

View GitHub Profile
@hose1021
hose1021 / mysql-docker.sh
Created September 8, 2024 13:02 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@hose1021
hose1021 / hyper-v.cmd
Created March 23, 2023 13:59 — forked from bengarrett/hyper-v.cmd
Changes the status of Windows Hyper-V to enable you to use other Virtualization software such as VirtualBox and VMware.
::File: c:\terminal\cmd-scripts\hyper-v.cmd
@echo off
echo.
if [%1] == [] goto help1
if "%1" == "/?" goto help1
goto check_Permissions
:check_Arguments
@hose1021
hose1021 / .bashrc
Last active October 10, 2022 08:58
.bashrc
###################################################################################################
# wget https://go.momar.de/bashrc -O ~/.bashrc
###################################################################################################
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@hose1021
hose1021 / api.yaml
Last active October 28, 2021 10:13
openapi: 3.1.0
info:
title: api
version: '1.0'
servers:
- url: 'http://localhost:3000'
paths:
'/users/{userId}':
parameters:
- schema:
@hose1021
hose1021 / DisableForeignKeys.php
Created October 17, 2021 21:25
DisableForeignKeys
<?php
namespace Shopper\Framework\Traits\Database;
use Illuminate\Support\Facades\DB;
trait DisableForeignKeys
{
/**
* Command to disable foreign key for each database management.
@hose1021
hose1021 / HasSlug.php
Created October 17, 2021 20:55
Slug HasSlug
<?php
namespace Shopper\Framework\Models\Traits;
use Illuminate\Support\Str;
trait HasSlug
{
public function slug(): string
{
@hose1021
hose1021 / nginx-tuning.md
Created March 16, 2021 12:50 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@hose1021
hose1021 / .htaccess
Created December 6, 2020 16:00
.htaccess
#
# Sources:
# http://stackoverflow.com/questions/7704624/how-can-i-use-gzip-compression-for-css-and-js-files-on-my-websites
# http://codex.wordpress.org/Output_Compression
# http://www.perun.net/2009/06/06/wordpress-websites-beschleuinigen-4-ein-zwischenergebnis/#comment-61086
# http://www.smashingmagazine.com/smashing-book-1/performance-optimization-for-websites-part-2-of-2/
# http://gtmetrix.com/configure-entity-tags-etags.html
# http://de.slideshare.net/walterebert/die-htaccessrichtignutzenwchh2014
# http://de.slideshare.net/walterebert/mehr-performance-fr-wordpress
# https://andreashecht-blog.de/4183/