Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| #!/usr/bin/env python | |
| """ | |
| Copyright (c) 2011, Daniel Bugl | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| 1. Redistributions of source code must retain the above copyright | |
| notice, this list of conditions and the following disclaimer. | |
| 2. Redistributions in binary form must reproduce the above copyright |
| #!/usr/bin/env python | |
| # | |
| # Copyright 2012 Patrick Hetu <patrick.hetu@gmail.com> | |
| # | |
| # This program is free software: you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation, either version 3 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| geo $limited { | |
| default 1; | |
| # Wordpress Jetpack ranges: | |
| 192.0.0.0/16 0; | |
| 66.135.0.0/16 0; | |
| 66.155.0.0/16 0; | |
| 76.74.0.0/16 0; | |
| } |
| # Changed to use content-type flag instead of header: -H 'Content-Type: application/json' | |
| siege -c50 -t60S --content-type "application/json" 'http://domain.com/path/to/json.php POST {"ids": ["1","2","3"]}' |
| #!/bin/bash | |
| #### Default Configuration | |
| CONCURRENCY=4 | |
| REQUESTS=100 | |
| ADDRESS="http://localhost:8080/" | |
| show_help() { | |
| cat << EOF |
| # This is just a cheat sheet: | |
| # On production | |
| sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
| # On local | |
| scp -C production:~/database.sql.gz | |
| dropdb database && createdb database | |
| gunzip < database.sql.gz | psql database |
| # === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) === | |
| # | |
| # by Fotis Evangelou, developer of Engintron (engintron.com) | |
| # | |
| # ~ Updated September 2024 ~ | |
| # | |
| # | |
| # The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores. | |
| # If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage. | |
| # |
| <?php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| use Illuminate\Http\Response; | |
| use Illuminate\Cache\RateLimiter; | |
| class ThrottleRequests | |
| { |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm