Block Countries from your server easily with CSF

If you don’t have a need for certain international visitors to your Linux server, its easy to block them out!  First, you’ll need to make sure that CSF is installed.  You can follow our guide on installing csf to get this accomplished.  Once that’s done, read on to block access from Russia, China, etc..

Now that CSF is installed, open up your config file (/etc/csf/csf.conf) and search for the country codes section.  It starts on line 570 in the current (v6.15) version.

You’ll see the following:

Here, you’ll want to enter country codes for countries that you would like to block..  here’s an example blocking Russian Federation and China:

Then, just restart CSF!

Boom – you’re done.

You can get country codes from various sites throughout the Internet.  I normally go here: https://www.countryipblocks.net/allocation-of-ip-addresses-by-country.php

Good luck – and let us know how it goes!

How to switch to a different PHP version with htaccess

To switch to PHP 7.1

To switch to PHP 7.0

To switch to PHP 5.6

To switch to PHP 5.5

To switch to PHP 5.4

To switch to PHP 5.3

 

This setting will apply recursively to all of the subdirectories. In case you’d like to have a different version of PHP in a subdirectory, create a new .htaccess file in it with the directive for the desired PHP version in it.

5 Thank You Messages To Use On Your Web Forms

To help you find the best way to say Thank You to your customers, we gathered five message suggestions for your web form’s Thank You page. Feel free to copy & paste! Don’t forget to add your own customization to the message, in order to make it more personal for your business

  1. Thank you for getting in touch!
    We appreciate you contacting us about [Contact Reason]. We try to respond as soon as possible, so one of our Customer Service colleagues will get back to you within a few hours.
    Have a great day ahead!

  1. Thanks for being our awesome customer!
    We have received your message and would like to thank you for writing to us. If your inquiry is urgent, please use the telephone number listed below, to talk to one of our staff members. Otherwise, we will reply by email shortly.
    Talk to you soon,
    [Your Company]

  1. Thank you for filling out your information!
    We’ve sent you an email with the coupon code/your file download link/your voucher at the email address you provided. Please enjoy, and let us know if you have any questions we can help you with.
    The [Your Company] Team

  1. Dear [Your Company] customer, thanks for reaching out!
    We always love to hear from you. Our inbox can’t wait to get your messages, so talk to us any time you like!
    Cheers!

  1. Thanks for filling out our form!
    We will look over your message and get back to you by tomorrow. In the meantime, you can check the FAQ section, look over our new product collection or browse through our latest blog posts [link to another page — will be displayed as Please click here to continue].
    Your friends at [Your Company]

Play around with the messages and make them sound just as you wish. You can also add images to the Thank You page, which your respondent will see after completing the form. Besides adding a message or an image to the Thank You page, you can redirect customers to another page. For example, you can invite them to browse your product gallery or the read the latest blog posts. One more option is to redirect your customers to a form report

– See more at: http://www.123contactform.com/blog/2014/09/5-thank-you-messages-to-use-on-your-web-forms/#sthash.eCfDFZIg.dpuf

w To Use Cheap Chinese Arduinos That Come With With CH340G / CH341G Serial/USB Chip (Windows & Mac OS-X)

Recent versions of cheap Chinese clones of Arduino boards have been coming with a different USB/Serial chip, which replaces the usual FTDI. I read somewhere that licensing costs of FTDI make it prohibitive to companies selling boards for as little as $3, so I assume this is the main motivation. To be honest, as long as I can talk to my Arduino and buy it for $3 a piece, who cares? 🙂

Below you’ll find links to drivers for both Windows and Mac to make these work. Please leave a comment, if it worked or didn’t work for you, especially if you had to do anything special or hacky to make it work 🙂

Windows

A fully signed drivers for Windows can be found below:

Mac OS-X

Mac OS-X El Capitan

(Added: Nov 22, 2015)

Many instructions down below were written for the old driver, which was not signed, and therefore was not working out of the box on OS-X Yosemite and El Capitan. The latest driver appears to be signed, and should work out the box. The new driver is here: CH34x_Install.zip (111Kb).

Acknowledgements: thanks to Björn’s Techblog for posting the driver.

Inside the driver is a brief README with the following instructions:

Driver README

CH34X USB-SERIAL DRIVER INSTALLATION INSTRUCTIONS Version: V1.0 Copyright (C) Jiangsu Qinheng Co., Ltd. Support System: OSX 10.9 and above

Installation Process: * Extract the contents of the zip file to a local installation directory * Double-click CH34x_Install.pkg * Install according to the installation on procedure * Restart after finishing installing

After the installation is completed, you will find serial device in the device list(/dev/tty.wchusbserial*), and you can access it by serial tools.

If you can’t find the serial port then you can follow the steps below:

  1. Open terminal and type ‘ls /dev/tty*’ ande see is there device like tty.wchusbserial;
  2. Open ‘System Report’->Hardware->USB, on the right side “USB Device Tree” there will be device named “Vendor-Specific Device” and check if the Current is normal. If the steps upper don’t work at all, please try to install the package again.

Note: Please enter System Preferences ➜ Security & Privacy ➜ General, below the title “Allow apps downloaded from:” you should choose the choice 2 ➜ “Mac App Store and identified developers” so that our driver will work normally.


Older Driver

This older version requires some hacking in order to get it to work. I am leaving instructions just in case someone needs it, or the new driver does not work for someone.

Download The Driver

There are two main sites that people mention in the discussions about the driver:

  • Chinese company that developed it: http://www.wch.cn/downloads.php?name=pro&proid=178
    • This driver appears newer than on the second link, and is from Dec 2013.
    • Note: for me that site took a long long time to load, and then it took forever to download this tiny driver, so I put up a copy hereCH341SER_MAC.ZIP (256Kb), so that you don’t have to wait. Hopefully they won’t go after me for mirroring their driver 🙂
  • Second site is the Russian company that sells the USB programmer based on this chip: http://www.5v.ru/ch340g.htm but this site only has an older version of the driver, from 2012, so I do not recommend downloading it.

Pre-Installation

Note: the following pre-installation steps are only required on the two most recent versions of OS-X Yosemite and El Capitan. It is because the driver is not signed properly from Apple’s perspective. We are waiting on the developer to update the driver so that these pre-installation steps are no longer needed.

OS-X El Capitan Steps (Only For The Older Driver!)

These are not needed for the newer driver above.

  • Reboot and press ⌘-R immediately after the chime to enter Recovery Mode
  • Open Terminal from the recovery mode
  • run the command csrutil enable --without kext
  • Reboot.
Acknowledgements: thanks to this post for these instructions.

OS-X Yosemite Steps

  • Open Terminal Application (it’s located in /Application/Utilities) and type this command once you see a prompt:
  • sudo nvram boot-args="kext-dev-mode=1"
  • Reboot.
Acknowledgements: see this post if you wish to know more details.

Installation

  • Download the driver from here: CH341SER_MAC.ZIP (256Kb)
  • Double click the ZIP file do unzip it
  • Open the folder ~/Downloads/CH341SER_MAC
  • Run installer found in that folder
  • Restart when asked.

Usage

If the driver properly loaded, you should see the device in you /dev folder (this is for advanced command-line users of OSX only). On my machine it was called /dev/cu.wchusbserial1441140

This port is showing up correctly in Arduino 1.0.6 and Arduino 1.5.8.

However, if you are using the Eclipse Plugin, it is not smart enough to list this port in the list of available serial ports (either in project properties, or in the serial monitor). You will have to type the entire thing yourself: /dev/cu.wchusbserial1441140 and then Eclipse can upload your sketch.

That’s it! You should be ready to use the drivers and the board.

How to disable IPv6 for postfix service node?

Symptoms

How to disable IPv6 on a Postfix Service Node?

Resolution

Enforcing Postfix to use IPv4 an be done by specifying inet_protocols parameter in main.cf configuration file:

  1. Open /etc/postfix/main.cf with text editor (for example, vi) on the Postfix service node.
  2. Change inet_protocols value from inet_protocols = all to inet_protocols = ipv4.
  3. Restart Postfix service:
    # /etc/init.d/postfix restart
    

It defines what protocols Postfix will use, when it makes or accepts network connections, and also controls what DNS lookups Postfix will use, when it makes network connections.