Skip to content
Archive of posts filed under the tips category.

Remove duplicates, but keeping only the last occurrence

Again on IRC, somebody asked how to remove duplicates from a file, but keeping only the last occurrence of each item. The classic awk idiom awk '!a[$0]++' prints only the first instance of every line. So if the input is, for example foo bar baz foo xxx yyy bar the "normal" output (ie using the [...]

Some tips on RPM conditional macros

You may have been bitten by this.

Running local script remotely (with arguments)

Some ways to remotely run a local script.

Poor man’s HTTP VPN

Send IP traffic over HTTP.

“In-place” editing of files

Temporary files don't bite, so just use them.