Skip to content

Instantly share code, notes, and snippets.

@allenaven
allenaven / fb50_ip.md
Created October 2, 2018 03:11
Top 50 FB IPv4 addresses ranked by number of hosted domain names

Top 50 FB IPv4 addresses ranked by number of hosted domain names. Data retrieved from dnslytics.com for AS32934 on 2018-07-23

IPv4 addr Number of domains hosted on this IP addr. Random example of a domain name hosted @ this IP addr.
31.13.90.2 865 messenger.com
31.13.77.36 475 z-blog.net
157.240.1.18 301 fbinnovation.com
69.171.242.11 296 xinhua005.com
69.171.229.11 275 6701h.com
69.171.224.11 219 facebook.cz
@allenaven
allenaven / fb50.md
Created October 2, 2018 02:48
Top 50 domains under FB's ASN

Here's a list of the top 50 FB domains, pulled from dnslytics.com for AS32934 on 2018-07-23.

Domain IPv4
facebook.com 157.240.20.35
internet.org 31.13.90.37
fbcdn.net 31.13.90.36
messenger.com 31.13.90.2
fb.com 157.240.1.35
facebookmarketingpartners.com 31.13.90.2
@allenaven
allenaven / gist:d61d7a513c8c7dcd417c09f87b01aca4
Created March 8, 2018 04:12 — forked from atcuno/gist:3425484ac5cce5298932
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@allenaven
allenaven / tracer.py
Created November 9, 2017 07:24
Python function decorators are great at retaining state information for use during the function call
#!/usr/bin/env python
# Function decorators are great at retaining state information for use
# during the function call
class tracer:
def __init__(self, func):
self.calls = 0
self.func = func
def __call__(self, *args, **kwargs):
@allenaven
allenaven / inductive-pw.conf
Created October 3, 2017 09:33
Nginx config files to serve RStudio Server behind a subdomain and proxy. Oh and TLS too. Ubuntu Xenial, LetsEncrypt
## Default server configuration
## /etc/nginx/sites-available/inductive-pw.conf
## simlink this to /etc/nginx/sites-enabled
server {
listen 80 default_server;
listen 443 ssl; # managed by Certbot
server_name inductive.pw www.inductive.pw;
@allenaven
allenaven / miscellaneous_tasks.sh
Created August 13, 2017 03:05
Linux/Bash shell commands and snippets to make command line life easier
# Get kernel version
uname -a
# Get distro version: Ubuntu
lsb_release -a
# Most releases store distro version in a file:
cat /etc/fedora-release
cat /etc/debian_version
cat /etc/centos-release # Or something similar, look in /etc for your distro name
@allenaven
allenaven / MyModule.scala
Last active August 3, 2017 08:37
Exercises in Ch.2 in "Functional Programming in Scala" book. Introduces some of the Scala syntax and general FP concepts
// Ch 2 in book "Functional Programming in Scala"
// In Scala, code has to be in an object ("module") or a class
// The following code snippet declares a "singleton" object: simultaneous
// class declaration and instantiation of its only instance
// The object defines three methods
object MyModule {
// The following is a "pure function": no side effects
@allenaven
allenaven / hr-stdin.R
Created July 7, 2017 06:52
Hackerrank templates demonstrating how to appropriately handle the Stdin and Stdout in their code exercises
# There are a few ways in R to read Stdin. The one that works
# with Hackerrank problems is to open it as a file--
f <- file("stdin")
on.exit(close(f))
# Calling readLines(f) returns a vector of strings, one element
# per line of input. You'll have to explicitely convert to int
# if you're expecting an integer on that line,
# or possibly use readr::parse_integer() ?
in_strings <- readLines(f)
@allenaven
allenaven / detect_file_dupes.go
Created July 7, 2017 02:59
Golang snippet to detect file duplicates in a directory by comparing MD5 checksums.
// Tool to check for duplicates in a directory by calculating and comparing
// md5 checksums on the directory contents
package main
import (
"crypto/md5"
"encoding/hex"
"fmt"
"io/ioutil"
@allenaven
allenaven / db_connect_postgres.R
Created June 28, 2017 09:01
Example R dplyr connection to a Postgres database, since I have to look it up every time I code it...
## Connect to a local Postgres database running in a Docker container
## although the Docker part isn't of any importance here.
## Working with dplyr 0.7, DBI 0.7, dbplyr 1.1.0
library(DBI)
library(dplyr)
library(dbplyr)
con <- DBI::dbConnect(RPostgreSQL::PostgreSQL(), host = 'localhost', port = 8990,
dbname = <name of db>, user = <user>, password = <pass>)