import matplotlib.pyplot as plt
import numpy as np
def plot_hist(file, bins=256):
plt.hist(np.fromfile(file, np.uint8), bins=bins)
plt.show()
plot_hist('test100M.bin')
plot_hist('Koran.txt')
plot_hist('xor_vs_aes.html')
plot_hist('/bin/sh')
!file '/bin/sh'
/bin/sh: symbolic link to bash
plot_hist('/bin/grep')
plot_hist('/home/deadeye/Dokumente/UserManual_ST200.pdf')
# sieht so nach kompression aus...
import requests
from IPython.display import display, HTML
req = requests.get('http://heise.de')
display(HTML(req.text))
print(req.text[:200])
<!DOCTYPE html> <html lang="de" data-responsive> <head> <title> heise online - IT-News, Nachrichten und Hintergründe heise online </title> <meta charset="utf-8"> <meta n
heise_data = np.frombuffer(bytearray(req.text.encode()), np.uint8)
plt.hist(heise_data, bins=256)
plt.show()
plot_hist('../Pictures/Screenshot_20170924_212201.png')