How to forcibly close a socket in TIME_WAIT?

Actually there is a way to kill a connection – killcx. They claim it works in any state of the connection (which I have not verified). You need to know the interface where communication happens though, it seems to assume eth0 by default. UPDATE: another solution is cutter which comes in some linux distros’ repositories.

How can I port forward with iptables?

First of all – you should check if forwarding is allowed at all: cat /proc/sys/net/ipv4/conf/ppp0/forwarding cat /proc/sys/net/ipv4/conf/eth0/forwarding If both returns 1 it’s ok. If not do the following: echo ‘1’ | sudo tee /proc/sys/net/ipv4/conf/ppp0/forwarding echo ‘1’ | sudo tee /proc/sys/net/ipv4/conf/eth0/forwarding Second thing – DNAT could be applied on nat table only. So, your rule should … Read more

best way to clear all iptables rules

To answer your question succinctly, no: there would not be any “leftover” rules after flushing every table. In the interest of being thorough however, you may want to set the policy for the built-in INPUT and FORWARD chains to ACCEPT, as well: iptables -P INPUT ACCEPT iptables -P FORWARD ACCEPT iptables -P OUTPUT ACCEPT iptables … Read more

How to add a timestamp to bash script log?

You can pipe the script’s output through a loop that prefixes the current date and time: ./script.sh | while IFS= read -r line; do printf ‘%s %s\n’ “$(date)” “$line”; done >>/var/log/logfile If you’ll be using this a lot, it’s easy to make a bash function to handle the loop: adddate() { while IFS= read -r … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)