This guide will cover the basics on how to integrate emacs with protonmail-bridge using
- mu4e
- mbsync
- smtpmail
- protonmail-bridge
This guide will cover the basics on how to integrate emacs with protonmail-bridge using
| def levenshtein(seq1, seq2): | |
| size_x = len(seq1) + 1 | |
| size_y = len(seq2) + 1 | |
| matrix = np.zeros ((size_x, size_y)) | |
| for x in range(size_x): | |
| matrix [x, 0] = x | |
| for y in range(size_y): | |
| matrix [0, y] = y | |
| for x in range(1, size_x): |
| # https://github.com/hadiasghari/pyasn | |
| # pyasn_util_download.py --latest | |
| # pyasn_util_convert.py --single <Downloaded RIB File> <ipasn_db_file_name> | |
| # load database | |
| asndb = pyasn.pyasn('ipasn.dat') | |
| # convert one ip to asn | |
| def pyasn(ip,asndb): | |
| asn, prefix = asndb.lookup(ip) |
| #!/usr/bin/env python3.6 | |
| ''' | |
| Pihole is great, but the admin interface only displays device details | |
| by IP address which can be confusing. This script changes the display | |
| from IP address to a more recognizable hostname. And as a bonus, attaches | |
| the profile (from fingerbank.org) of the device to the hostname as well - | |
| so instead of something like 192.168.1.101, you see galaxys6-samsung. | |
| Shweet. | |
| Usage notes |
| tshark -r input_file.pcap -2R "< Wireshark Filter >" -T fields -e < Wireshark Field > -e <Wireshark Field> | |
| ## By using combination of "-T fields" and "-e" options, tshark will only print the fields you're interested in. | |
| ip.src | |
| ip.dst | |
| tcp.srcport (udp.srcport) | |
| tcp.dstport (udp.dstport) | |
| ## I want to check the number of TCP streams in the packet. |
apt-get install libpcap-dev
apt-get install automake
apt-get install automake-1.15
| df_flows.dst_ip.replace({r'(\d+)\.(\d+)\.(\d+)\.(\d+)': r'\1.X.X.\4'}, regex=True) |
| !apt install proj-bin libproj-dev libgeos-dev | |
| !pip install --upgrade plotly | |
| !pip install --upgrade geopandas | |
| !pip install --upgrade pyshp | |
| !pip install --upgrade shapely | |
| !pip install --upgrade geoplot | |
| !pip3 install maxminddb-geolite2 --user |
| # create database | |
| mongo admin --host localhost -u admin -p admin --eval "db.getSiblingDB('mydb');" | |
| use mydb | |
| db.createUser( { user: "user1", pwd: "pass", roles: [ "readWrite", "dbAdmin" ], passwordDigestor:"server" } ) | |
| db.createCollection("log", { capped : true, size : 5242880, max : 5000 } ) |