Linux utilities

Fill USB Flash with Zeroes on Linux

When formatting usb flash, it always only creates new partition table at the start sectors and remain all the rest as it was. So, it is possible to read the rest data, analyze and get old data if your flash will be in hacker's hands. If your data must be totally removed from flash, it needs to fill entire drive with zeroes.


Fill USB flash with zeroes with dd if=/dev/zero of=/dev/flash

Simplest way is to use 'dd', but it takes much time and reduces lifetime of usb flash:

dd if=/dev/zero of=/dev/FLASH


Add Date and Time to Each Line in ffmpeg Log with awk

When transcode video or catch bugs in live stream, sometimes it is necessary to log ffmpeg messages with also date and time. This is possible with awk.


Insert date and time to ffmpeg log messages using awk

Here we use test stream link from [3]. We run ffplay for check its work:

ffplay 2>&1 | awk 'NF {print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush()}'