Skip to content

Instantly share code, notes, and snippets.

View pramoso's full-sized avatar
🏠
Working from home

proc pramoso

🏠
Working from home
View GitHub Profile
@pramoso
pramoso / single-site.com
Created June 29, 2023 20:46
Logrotate config
/var/www/single-site.com/logs/*.log {
# daily: perform the rotation every day
daily
# rotate 14: remove the log files after 14 days
rotate 14
# size 1M: only rotate logs that are a minimum of 1MB
size 1M
# compress: all rotated logs will also be compressed
compress
# compress: all rotated logs will also be compressed
@pramoso
pramoso / cloudflare-nginx-ip-updater.sh
Created June 29, 2023 00:48
Bash script to download the latest list of CloudFlare IP address
#!/bin/bash
#
# A bash script to download the latest list of CloudFlare IP address
# ranges to be used with Nginx for the purpose of displaying a
# visitor's real IP address
#
# Author: Eric Mathison - https://ericmathison.com
#
@pramoso
pramoso / cloudflare-token.conf
Last active June 28, 2023 23:22
Config Fail2ban to use Wordpress using Cloudflare Firewall API token V4
#
# Author: Logic-32
#
# IMPORTANT
#
# Please set jail.local's permission to 640 because it contains your CF API token.
#
# This action depends on curl.
#
# To get your Cloudflare API token: https://developers.cloudflare.com/api/tokens/create/
@pramoso
pramoso / cloudflare-token.conf
Last active June 28, 2023 23:19
Fail2ban Cloudflare Firewall API token V4
#
# Author: Logic-32
#
# IMPORTANT
#
# Please set jail.local's permission to 640 because it contains your CF API token.
#
# This action depends on curl.
#
# To get your Cloudflare API token: https://developers.cloudflare.com/api/tokens/create/
@pramoso
pramoso / Deploy Ruby
Last active May 10, 2016 22:28
Ubuntu enviroment
#Since Ruby will run in the console you may want to use screen to keep the app running in the background once you disconnect.
#To do this first install screen
apt-get install screen
#Then start a new screen session
screen -S "My App"
#and run your app within the session
ruby myapp.rb
@pramoso
pramoso / Ubuntu and mySQL timezone
Last active May 9, 2016 22:34
Linux and mySQL enviroment
-- Configure Timezones
sudo dpkg-reconfigure tzdata
--Configure NTP Synchronization
sudo apt-get update
sudo apt-get install ntp
--Load TimeZones
mysql_tzinfo_to_sql /usr/share/zoneinfo/|mysql -u root mysql -p
@pramoso
pramoso / ruby.bash
Last active May 2, 2016 20:08 — forked from briansalvattore/ruby.bash
Ruby environment
#Ruby
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile