Skip to content

Instantly share code, notes, and snippets.

@MikeRogers0
MikeRogers0 / backup-to-s3.sh
Last active May 19, 2020 15:33
A method of backing up your website to Amazon S3.
#!/bin/bash
## Email Variables
EMAILDATE=`date --date="today" +%y-%m-%d`
EMAIL="[email protected]"
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE
EMAILMESSAGE="/tmp/emailmessage1.txt"
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
@denji
denji / nginx-tuning.md
Last active November 5, 2024 10:10
NGINX tuning for best performance

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.

@SBejga
SBejga / ssmtp_mail_alias
Last active December 15, 2021 05:05
Bash Script as alias of "mail" using "ssmtp" in ubuntu. Main purpose is sending mails via munin by ssmtp instead of postfix.
#!/bin/bash
# mail syntax: mail -s "any mail subject string" [email protected]
# or: mail "any mail subject string" [email protected]
if [ $1 == "-s" ]
then
subject=$2
recip=$3
else
subject=$1
recip=$2
@gitsebs
gitsebs / backup-to-s3.sh
Created March 22, 2018 03:53 — forked from MikeRogers0/backup-to-s3.sh
A method of backing up your website to Amazon S3.
#!/bin/bash
## Email Variables
EMAILDATE=`date --date="today" +%y-%m-%d`
EMAIL="[email protected]"
SUBJECT="[servername] Backup Script Started! - "$EMAILDATE
EMAILMESSAGE="/tmp/emailmessage1.txt"
echo "Just to let you know that the backup script has started."> $EMAILMESSAGE
/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE
@doomedraven
doomedraven / kvm-qemu.sh
Last active May 28, 2020 07:19
Linux - KVM + QEMU installer from sources :)
Moved to https://github.com/doomedraven/Tools/blob/master/Virtualization/kvm-qemu.sh
@isair
isair / 99-network-tuning.conf
Last active January 20, 2022 10:51
Better network configuration for Linux servers. Place under /etc/sysctl.d/
# http://www.nateware.com/linux-network-tuning-for-2013.html
# Increase Linux autotuning TCP buffer limits
# Set max to 16MB for 1GE and 32M (33554432) or 54M (56623104) for 10GE
# Don't set tcp_mem itself! Let the kernel scale it based on RAM.
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 16777216
net.core.wmem_default = 16777216
net.core.optmem_max = 40960
@witmin
witmin / ffmpeg-mp4-to-animated-webp.md
Last active November 5, 2024 20:50
Convert MP4 file to animated WebP in ffmpeg

Convert MP4 file to animated WEBP file in ffmpeg CLI

1. Install ffmpeg CLI through homebrew

In terminal.app, install ffmpeg through homebrew

brew install ffmpeg

Validate the installation:

@rrottmann
rrottmann / dist-upgrade-buster-to-bookworm.sh
Last active November 10, 2024 17:33
Dist-Upgrade Debian 10 Buster to Debian 12 Bookworm
# Debian 10
apt-get -y update
apt-get -y upgrade --without-new-pkgs
apt-get -y full-upgrade
cat > /etc/apt/sources.list <<"EOF"
deb http://deb.debian.org/debian/ bullseye main
deb-src http://deb.debian.org/debian/ bullseye main
deb http://security.debian.org/bullseye-security bullseye-security/updates main
deb-src http://security.debian.org/bullseye-security bullseye-security/updates main