Random Stuff

From WTFwiki
Jump to navigation Jump to search

To convert asterisk gsm files to wav files it can still play:

 sox tt-weasels.gsm -r 8000 -b -c 1 -u -2 tt-weasels.wav

Upgrading pkgsrc bootstrapped packages (bmake install-sh nawk nbsed pax tnftp bootstrap-mk-files):

bmake USE_DESTDIR=full package
rm /var/db/pkg/<pkgname>-<pkgversion>/+PRESERVE
pkg_delete "<pkgname>*"
pkg_add /usr/pkgsrc/packages/All/<pkgname>-<pkgversion>.tgz
touch /var/db/pkg/<pkgname>-<pkgversion>/+PRESERVE

How to list the architecture specific preprocessor defines in gcc:

 echo | gcc -E -dM -

Taken from here.

OpenBSD key life times in ipsec.conf

Use the undocumented 'life' keyword for quick and main mode see here. NOTE: This has been found to not exactly work as (not) advertised.. ymmv.

Subnet calculations

I always forget how to do these.

The Broadcast Address is obtained doing a binary OR between an address in the subnet and the inverted Subnet Mask. You can invert the subnet mask by XORing it with the decimal representation of

The Subnet Address is obtained by doing a binary AND between an address in the subnet and its Subnet mask.

A handy tool to convert address to/from decimal can be found here

See Also: Wikipedia IPv4 subnetting reference