Check These Out
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
https://stackoverflow.com/questions/10768160/ip-address-converter
Normally when a site is blocked through /etc/hosts, traffic is just being redirected to a non-existent server that isn't going to respond. This helps get your point across a little more clearly than a browser timeout.
Of course you could use any number of codes: http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
Obviously, this command can be added to init-rc.d, and more sophisticated responses can be given. Seems noteworthy to mention that the information sent from the browser can be parsed using the bash READ builtin (such as 'while read -t 1 statement; do parsing'), and the connection stays open until the script exits. Take care that you must use EXEC:'bash -c foo.sh', as 'execvp' (socat's method for executing scripts) invokes 'sh', not 'bash'.
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video).
$ cat /proc/acpi/video/VGA/LCD/brightness
to discover the possible values for your display.
Note:
1) -n option of watch accepts seconds
2) -t option of notify-send accepts milliseconds
3) All quotes stated in the given example are required if notification
message is more than a word.
4) I couldn't get this to run in background (use of & at the end fails). Any
suggestions/improvements welcome.
Replace 'csv_file.csv' with your filename.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.
In case you're like me and like your commands to start on clean lines, especially when you're deep into a 10-level directory tree. This can be added to .bashrc.