Whitelist an IP in Amazon AWS security group from command line

To white list an IP in Amazon AWS security group using aws command line tool, run

Example

Gitlab find version

To find version of hosted Gitlab installation, run

Example

wordpress

WordPress use CDN with out plugin

Content Devlivery Network (CDN) allow your web site to serve images from another domain or a sub domain. This speed up web site as your web server don’t need to serve images. Also browsers have a limit on number of parallel downloads from same domain. Having images on a differnt domain bypass this limitation of web browser.

If you use a pull type CDN or a CDN that you manually upload using some sync tool, you need to rewrite all image url to CDN url. There are several plugins available to do this. But you can easily do this with out any plugins.

Edit file

Add following code to end of the file.

This will replace image urls with CDN url.

Docker delete container after running

When you run a docker image, it create a container and run it. After docker container stop, container stays, so you can use it again if required.

Some times, you need to delete docker container after it is run. This is useful if your docker container is just a command line executable. In my case, docker container have ffmpeg in it, i don’t want container left over after i executed ffmpeg command.

To auto delete container after execution, use –rm option.

Example

apt force IPv4

One of my internet provider only provide IPv4 connection. When i run apt install command, it failed with error as it try to connect using IPv6.

To force apt to use IPv4 only, edit

Add

If you want to force IPv6, add

CentOS 7 resolv.conf make changes permanent

On rebooting CentOS 7 server, changes made to resolv.conf is lost. This is becaise one of the network interface is configured to use DNS server.

To fix, edit

Remove the line

Now NetworkManager will not modify /etc/resolv.conf file on boot.

Or you can set valid DNS servers in network config file like

If your network configuration use DHCP, set set PEERDNS=no.

Another solution is to make file immutable with

Related Posts

Domain Resolver

Install Pure-FTPd on CentOS with Virtual Users

To install Pure-FTPd on CentOS, run

Edit configuration file

To disable anonymous FTP, find

Replace with

To enable Virtual Users, find

Uncomment the line.

To Allow Apache user to login via FTP, find

Replace with

I set MinUID value to 47, as apache user have UID/GID of 48. By setting MinUID below that apache user should be able to login.

Set pureftpd to start on Boot

Restart pure-ftpd

Create a Virual User

To create a virtual user, run

It will ask you to enter password two times.

Now run

Change Password of an existing Virual User

It will ask you to enter new password.

Rebuild password database and restart pure-ftpd with

Related Posts

Install pureftpd on Ubuntu

pureftpd

Install vim from source on CentOS

To install vim from source on CentOS server, run

This will install latest version of vim. You can start it with command

To get it work with “vi” command, i removed preinstalled vim editor with command

Now create a symlink with