Tag Archives: mac os

Test Jumbo Frames / MTU 9000

Linux:

ping -M do -s 8972 xxx.xxx.xxx.xxx

OSX/BSD:

ping -D -s 8184 xxx.xxx.xxx.xxx

Windows:

ping -f -l 9000 xxx.xxx.xxx.xxx

Example results on Linux

If you’ve forgotten to enable jumbo frames/9k MTU on your client device you’re sending the ping from:

PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx): 8184 data bytes
ping: sendto: Message too long

If you have enabled jumbo frames on your client but not the destination (or a switch in between):

PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx): 8184 data bytes
Request timeout for icmp_seq 0

If you’ve done everything righ:

PING xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx): 8184 data bytes
8192 bytes from xxx.xxx.xxx.xxx: icmp_seq=0 ttl=128 time=0.714 ms

WebDAV with cURL

Assuming the following Data:

  • Webdav URL: http://example.com/webdav
  • Username: user
  • Password: pass

Actions

Reading Files/Folders

curl 'http://example.com/webdav'

Creating new Folder

curl -X MKCOL 'http://example.com/webdav/new_folder'

Uploading File

curl -T '/path/to/local/file.txt' 'http://example.com/webdav/test/new_name.txt'

Renaming File

curl -X MOVE --header 'Destination:http://example.org/webdav/new.txt' 'http://example.com/webdav/old.txt'

Deleting Files/Folders

File:

curl -X DELETE 'http://example.com/webdav/test.txt'

Folder:

curl -X DELETE 'http://example.com/webdav/test'

List Files in a Folder

curl -i -X PROPFIND http://example.com/webdav/ --upload-file - -H "Depth: 1" <<end
<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
<a:prop><a:resourcetype/></a:prop>
</a:propfind>
end

Continue reading WebDAV with cURL

Mount disk image partition

View partition table of disk.img:

fdisk -lu disk.img
Disk disk.img: 1.3 GiB, 1361051648 bytes, 2658304 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x6f92008e

Device    Boot  Start     End Sectors  Size Id Type
disk.img1        8192  131071  122880   60M  c W95 FAT32 (LBA)
disk.img2      131072 2658303 2527232  1.2G 83 Linux

Mount partition by using start multiplied by sector size as offset

mount -o loop,offset=$((131072 * 512)) disk.img /mnt

DNS Fun

calc

A calculator supporting addition, substraction, multiplication and division (respectively : ADD, SUB ,MUL, and DIV operations). More information here.

dig 2.8.add.calc.postel.org @dns.postel.org +short
0.10.0.0
dig 8.2.sub.calc.postel.org @dns.postel.org +short
0.6.0.0
dig 2.8.mul.calc.postel.org @dns.postel.org +short
0.16.0.0
dig 8.2.div.calc.postel.org @dns.postel.org +short
0.4.0.0

IP to ASN Mapping

A service providing a way to map IPv4 and IPv6 addresses or prefixs to ASNs, get information about ASNs, and even find possible peers. More details here.

Mapping an IP address or prefix to a corresponding BGP Origin ASN:

dig 4.4.8.8.origin.asn.cymru.com TXT +short
"15169 | 8.8.4.0/24 | US | arin |"
dig 4.8.8.origin.asn.cymru.com TXT +short
"15169 | 8.8.4.0/24 | US | arin |"
dig 4.4.8.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.8.4.0.6.8.4.1.0.0.2.origin6.asn.cymru.com TXT +short
"15169 | 2001:4860::/32 | US | arin | 2005-03-14"

Getting information about a given ASN:

dig AS15169.asn.cymru.com TXT +short
"15169 | US | arin | 2000-03-30 | GOOGLE - Google Inc.,US"

fun

dig any google-public-dns-a.google.com +noall +answer
; <<>> DiG 9.8.3-P1 <<>> any google-public-dns-a.google.com +noall +answer
;; global options: +cmd
google-public-dns-a.google.com.	38271 IN TXT	"http://xkcd.com/1361/"
google-public-dns-a.google.com.	38271 IN AAAA	2001:4860:4860::8888
google-public-dns-a.google.com.	38271 IN A	8.8.8.8

more stuff at http://www.cambus.net/interesting-dns-hacks/

Get public IP using DNS

show public IP

Google:

dig o-o.myaddr.l.google.com txt @ns1.google.com +short
nslookup -type=txt o-o.myaddr.l.google.com ns1.google.com
"10.11.12.13"

OpenDNS:

dig myip.opendns.com @resolver1.opendns.com +short
nslookup myip.opendns.com resolver1.opendns.com
10.11.12.13

Akamai:

dig whoami.akamai.net. @ns1-1.akamaitech.net. +short
nslookup whoami.akamai.net. ns1-1.akamaitech.net.
10.11.12.13

other usage

dig o-o.myaddr.l.google.com txt
nslookup -type=txt o-o.myaddr.l.google.com

returns txt record of DNS request to authoritative source address
edns0-client-subnet if available, showing original DNS request source address

dig o-o.myaddr.l.google.com txt @8.8.8.8 +short
nslookup -type=txt o-o.myaddr.l.google.com 8.8.8.8
"198.51.100.1"
"edns0-client-subnet 203.0.113.0/24"