Sockets and WebSockets

A socket, or endpoint, is the combination of an IP address and a port. Two sockets define a connection. There are 2 main types of sockets: Stream and Datagram. Stream sockets are guaranteed error-free and packets sent using stream sockets arrive in the order they are sent, FIFO. They are error-free because they are layered on top of TCP. Telnet uses stream sockets, as well as HTTP.

Read More

Send mail the hard way - SMTP

SMTP, or Simple Mail Transfer Protocol, is a text-based protocol for sending email. We will need to use openssl, which is a tool that implements SSL and TLS protocols. Unlike Telnet, openssl will enable the encrypted connection required for sending mail through the gmail server.

Read More

Using ping and traceroute

The ping command is a simple way to test whether a destination server is reachable. Ping uses the ICMP, or Internet Control Message Protocol, which is always coupled with the IP protocol. The two operation codes of ICMP used for ping are echo request and echo response.

Read More

The 'How It Works' Series

With an understanding of web development using very high level languages and little hardware knowledge, I thought it was about time to dive in and really learn how the web works, from the bottom up. This plan is not intended to be static, rather continuously edited and updated with additional content that makes sense as I move along.

Read More

  • r

Getting RSelenium to work on a Mac

Using RSelenium is more flexible than rvest for web scraping, because rvest can’t grab elements loaded with javascript. The default browser is Firefox, though other drivers can be installed to work with more browsers, including headless.

Read More

  • r

Using SQL in R: sqldf

Use sqldf! Data must be in a data frame first before using sqldf. Sqldf does not accept “.” in column names, because the “.” is used to join data frames, so be sure to rename columns to get around this. In addition to joining data frames, sqldf can select columns, rename columns, add columns, and update columns. Will be adding more to this as I continue using sqldf.

Read More

  • r

Merging using reduce

Use the reduce function to merge together multiple files. I’ve got email marketing data in 6 separate files, one for each email campaign. I need to merge these together to find general stats.

Read More

  • r

Extracting IP addresses from traffic logs

I’ve got multiple zip files, each containing daily logs of traffic info to a website. Each line is one entry, containing ip address, date, and many other things about the visitor. What I need is an output of 1 csv file, with date and ip address as columns.

Read More