Mininet: Set Interface MTU
|
|
|
|
|
|
|
|
I was running a server that didn’t do log rotation, so when the log grew too big I had to truncate it. This left me with a sparse file with a bunch of 0s (null bytes) at the beginning.
To trim the null bytes, first find the offset of the first non-null byte. This can be done with some C:
|
|
Find the offset of the first non-null byte:
|
|
Trim the first 7981307584 bytes from the file:
|
|
Specifying the bs
as offset and skip
ping 1 is faster than doing it the other way, because it would copy 1 byte at a time — slow!
One-liner to generate a JSON object mapping syscall names to their numbers:
|
|
Optionally, minify the JSON by piping it through tr -d' \n'
:
|
|
A reverse mapping can be made by swapping the columns in the awk expression:
|
|
List all the packages installed by date:
|
|
Print just the package names (useful for installing the same packages on another system):
|
|
References:
http://askubuntu.com/a/250530
I used tcpdump
to capture some traffic, but then realized that I didn’t need any of the application layer payload, but just the headers. The problem was that I had already done the capturing, and I had these huge pcap files taking up the precious space on my machine. What I first tried was using tcpdump
to read the file and dump it, with a smaller snaplen: tcpdump -s 96 -r in.cap -w smaller.cap
. That does not seem to change the snaplen, however. The solution I found is to use editcap
, as described here:
https://www.wireshark.org/docs/man-pages/editcap.html
The second example in the manual was what I was looking for. This did the trick:
|
|
This is a minimal solution to creating a ToDo list with LaTeX that has checked and unchecked items. It requires some symbols packages, as well as enumitem.
|
|
References:
http://tex.stackexchange.com/a/167459
http://tex.stackexchange.com/a/16001
First, export an environment variable with your prefix:
|
|
Configure, make and install zlib:
|
|
Configure, make and install OpenSSL:
|
|
Configure, make and install Python:
|
|
Check that it was installed correctly:
|
|
|
|
Example:
|
|