Skip to content

Instantly share code, notes, and snippets.

@nitogel
nitogel / nginx-forbidden-filter.conf
Created March 28, 2019 11:20
fail2ban nginx forbidden filter & jail
[Definition]
failregex = ^ \[error\] \d+#\d+: .* forbidden .*, client: <HOST>, .*$
ignoreregex =
@nitogel
nitogel / gist:3b356bb8565af28d7e89c6f3d0409ec7
Created October 17, 2018 12:34 — forked from smali-kazmi/gist:b0042d3dbfde64baf665
Install rabbitMQ server on vagrant ubuntu
# To Install rabbitMQ server
echo "deb http://www.rabbitmq.com/debian/ testing main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list > /dev/null
sudo wget http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc
sudo apt-get update
sudo apt-get install rabbitmq-server -y
sudo service rabbitmq-server start
sudo rabbitmq-plugins enable rabbitmq_management
sudo rabbitmqctl add_user admin password
sudo rabbitmqctl set_user_tags admin administrator
# -f force
unzip -p dbdump.sql.zip | mysql -u root -p -f dbname
@nitogel
nitogel / gist:f954d40b02356e8cfceb4952115c0cb1
Last active January 29, 2018 12:44 — forked from adamstac/gist:7462202
Install and configure Sendmail on Ubuntu

Install and configure Sendmail on Ubuntu

This should help you get Sendmail installed with basic configuration on Ubuntu.

  1. If sendmail isn't installed, install it: sudo apt-get install sendmail
  2. Configure /etc/hosts file: nano /etc/hosts
  3. Make sure the line looks like this: 127.0.0.1 localhost yourhostname
  4. Run Sendmail's config and answer 'Y' to everything: sudo sendmailconfig
  5. Restart apache
@nitogel
nitogel / Common-Currency.json
Created January 24, 2018 14:18 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},
@nitogel
nitogel / gravatar.php
Created January 19, 2018 11:42
gravatar helper
<?php
/**
* Get either a Gravatar URL or complete image tag for a specified email address.
*
* @param string $email The email address
* @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ]
* @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ]
* @param string $r Maximum rating (inclusive) [ g | pg | r | x ]
* @param boole $img True to return a complete IMG tag False for just the URL
@nitogel
nitogel / facebook_leads.md
Created October 10, 2017 21:39 — forked from tixastronauta/facebook_leads.md
Receiving Facebook Leads on a Webhook

Receiving Facebook Leads on a Webhook

1 - Create an App

Head over to developer.facebook.com and create an App

2 - Setup the webhook

On your server, create a facebook webhook that will handle facebook calls. Then create a "leadgen" webhook on you App: https://developers.facebook.com/docs/graph-api/webhooks/v2.5

sudo apt-get install mcrypt php7.0-mcrypt php7.0-mbstring php7.0-ldap php7.0-pgsql php7.0-dev php-curl php7.0-zip php7.0-gd