Tuesday, December 23, 2014

Mod Rewrite Generator

Mod Rewrite generator

Trés pratique pour générer des regex

http://www.generateit.net/mod-rewrite/index.php
http://www.regexr.com/

Monday, December 8, 2014

Find Out Which Process Is Listening Upon a Port

How To Create an SSL Certificate on Apache for CentOS 7

Install MailCatcher On CentOS 7

Introduction

MailCatcher is a tool that provides an easy way for developers to inspect emails that their applications send out without having to wait for an email provider. It catches all emails that it receives, and stores them for display. Both HTML and plain text messages are supported.

Installation

First update yum's repository list, then install the gcc and g++ compilers, and MailCatcher's dependencies (Ruby and SQLite).
sudo yum update
sudo yum -y install gcc gcc-c++
sudo yum -y install sqlite-devel ruby-devel
Install MailCatcher.
sudo gem install mailcatcher

Running MailCatcher

Once installed, you can run mailcatcher --help to see what options are available.
Start MailCatcher by running mailcatcher --ip [your-vultr-ip-address] on your terminal. Your output should look similar to the following:
root@install:~# mailcatcher --ip [your-vultr-ip-address]
Starting MailCatcher
==> smtp://[your-vultr-ip-address]:1025
==> http://[your-vultr-ip-address]:1080
*** MailCatcher runs as a daemon by default. Go to the web interface to quit.
Browse to http://[your-vultr-ip-address]:1080 and you'll see MailCatcher's web interface. Configure your application to use an SMTP host of your Vultr IP Address and port 1025 and send out some test emails. These emails will appear on MailCatcher's web interface.
NOTE: If you don't see MailCatcher's web interface, then you may have to open port 1080 and enable "http service" on CentOS firewall. Run the commands below, then try accessing http://[your-vultr-ip-address]:1080 from your web browser again.
sudo firewall-cmd --zone=public --add-port=1080/tcp --permanent
sudo firewall-cmd --zone=public --add-service=http --permanent
sudo firewall-cmd --reload

Conclusion

MailCatcher can really ease up the development and testing workflow, as it takes out the need for a mail provider to catch and view emails. Consider trying it for your next application.

Friday, December 5, 2014

[CentOS 7] Add permanent rules to FirewallD

Someone at work wanted to know how to add rules permanently to FirewallD, CentOS 7’s dynamic firewall (iptables), so I’m posting it in case it’s useful to someone else.
Get the default zone, this is usually “public”:
firewall-cmd --get-active-zones
List services on that zone:
firewall-cmd --zone=public --list-all
Add required TCP ports (let’s do port 80):
firewall-cmd --permanent --zone=public --add-port=80/tcp
If you need a UDP port:
firewall-cmd --permanent --zone=public --add-port=123/udp
You could restart the firewall for them to take affect, or set the rules again withoutthe –permanent option to add them dynamically.
Restart firewall:
systemctl restart firewalld.service
You can also specify services, rather than ports if you like.
sudo firewall-cmd --permanent --zone=public --add-service=http
Source :