wget force IPv4/6 download

If your server support both IPv4 and IPv6 and you need to force download a file using IPv4, you can use

To force IPv6 connection, use

Example

from wget help, here are the options See wget […]

Read More…

Set vim as default cronjob editor

Method 1

Find

Replace with

Method 2 edit .bash_profile

Add

Once added, .bash_profile will look like

Method 3 If you need it done one time only, run following commands on command prompt.

[…]

Read More…

xdotool

xdotool lets you programmatically simulate keyboard input and mouse activity, move and resize windows, etc. To search for an application with title name, run

This will return ID of the windows. You can use xwininfo command to view information about the application window. Example

[…]

Read More…

brctl

brctl show

brctl showmacs br0

brctl showstp br0

[…]

Read More…

Block Country in CSF firewall

CSF firewall can block all traffic from a country or list of counrty using GeoIP database. To block a country, edit file

Find

Replace with

Here is an example to block all traffic from China

If you want to block another counrt, you can add it like

Now restart csf […]

Read More…