Below code will allow you to use C-y (yank) in ansi-term. Does not support M-y (yank-pop).

(add-hook 'term-mode-hook
          (lambda ()
            (define-key term-raw-map


For systemd

A modification of the script from the Securing Debian Manual.

Place firewall-systemd somewhere in your executable path. This allows you to setup, stop and clear firewall rules.

Modify the "ExecStart=/path/firewall-systemd start" line of the systemd unit file to point to where you put firewall-systemd, and place it in etc/systemd/system. This is the systemd unit file, and configures how systemd calls firewall-systemd.

Place the iptables rules file in etc, modifying as you see fit (see "man iptables" or netfilter documentation). This stores the rules you want loaded into the firewall. It was generated by running:

iptables-save > outputfile

firewall-systemd more-or-less does:

iptables-restore < /etc/iptables.rules


systemctl enable firewall.service

so that it will run everytime the computer is started.

For System V init

Here is the firewall script I use on all my computers. It is the one found on Securing Debian Manual but with LSB Init Headers added (see here and here for more information) and one bug fixed (information here).

Include in the REMOTE_TCP_SERVICES and REMOTE_UDP_SERVICES variables all the TCP and UDP ports (respectively) you want access to (for instance HTTP port 80). If you host services you want others to access modify TCP_SERVICES and UDP_SERVICES similarly.

Put the file into etc/init.d and call

insserv firewall

which will put it into the various etc/rc*.d directories so that the firewall will start each time you boot your system. I have configured it to bring the firewall up before the network is started, and bring it down after the network is stopped. You can change this behaviour by modifying the header between "### BEGIN INIT INFO" and "### END INIT INFO".


[FSF Associate Member] [FSFE Associate Member]