Where to get iostream.h

The correct name of this standard header is just iostream without an extension. If your compiler still cannot find it, try the following: find /usr/include -name iostream -type f -print …and add it to your include path, following your compiler’s documentation.

equivalent date from GNU to solaris

Tcl has a good free-form date scanner, if you have Tcl installed (try which tclsh). A shell function: tcldate() { d=${1:-now} # the date string f=${2:-%c} # the output format echo “puts [clock format [clock scan {$d}] -format {$f}]” | tclsh } In action on an ancient Solaris 8 box with bash 2.03 and tcl … Read more

GROUP BY/SUM from shell

Edit: The modern (GNU/Linux) solution, as mentioned in comments years ago 😉 . awk ‘{ arr[$1]+=$2 } END { for (key in arr) printf(“%s\t%s\n”, key, arr[key]) }’ file \ | sort -k1,1 The originally posted solution, based on old Unix sort options: awk ‘{ arr[$1]+=$2 } END { for (key in arr) printf(“%s\t%s\n”, key, arr[key]) … Read more

UDP-Broadcast on all interfaces

First of all, you should consider broadcast obsolete, specially INADDR_BROADCAST (255.255.255.255). Your question highlights exactly one of the reasons that broadcast is unsuitable. It should die along with IPv4 (hopefully). Note that IPv6 doesn’t even have a concept of broadcast (multicast is used, instead). INADDR_BROADCAST is limited to the local link. Nowadays, it’s only visible … Read more

Add a bash script to path

Try this: Save the script as apt-proxy (without the .sh extension) in some directory, like ~/bin. Add ~/bin to your PATH, typing export PATH=$PATH:~/bin If you need it permanently, add that last line in your ~/.bashrc. If you’re using zsh, then add it to ~/.zshrc instead. Then you can just run apt-proxy with your arguments … Read more