Very Secure

Network Socket Notes

January 31st, 2020

While working on TheFleet I came across questions difficult to answer with my minimal understanding of the system level functions used to send messages over a network. So I read a guide on the subject1 and took notes. The aim of this article is to present those notes in a manner that gives clarity to how certain c functions allow one to communicate over a network via the abstraction of writing to and reading from a unix file.

File descriptors

Each unix process has its own file descriptor table.2 Each row in that table contains the memory address of a file. When a process calls a system level function that interacts with a file, the process must pass the file's file descriptor3 as a parameter to the function.

Sockets

int socket(int domain, int type, int protocol);4

A socket is a special type of unix file used for either local inter process communication or communication over a network. The function socket creates a socket and returns its socket descriptor.5

Making a socket available to the world

int bind(int sockfd, struct sockaddr *my_addr, int addrlen);6

Calling bind tells the kernel to tie a socket to an (ip address, port) pair.7 The pair serves as the address of the socket on the internet.

Establishing connections

int connect(int sockfd, struct sockaddr *serv_addr, int addrlen);8

connect establishes a connection to a remote socket. Just like bind, connect tells the kernel to tie the given socket to an (ip address, port) pair. This pair is used as the return address for messages sent to the remote socket. The kernel picks a random available port for this purpose. Thus when a process sends a packet over the internet, it almost always uses a port number different than the one used in the foreign address.9

A process can implement typical server behavior by passing a socket descriptor to the functions bind, listen, and accept in order to establish many connections on the same local port.

int listen(int sockfd, int backlog);10

listen tells the kernel to create a limited size queue for incoming connections. Connection attempts are rejected whenever the queue is full.

int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);

accept pops connections off of the listen queue. It returns a new socket descriptor to be used for the connection.

Established connections are uniquely determined by (source ip, source port, foreign ip, foreign port) tuples. So a machine with one ip address has a theoretical limit of 65536 * 65536 established connections per foreign ip address. Resource limitations make the maximum number of possible connections much smaller in practice.

One can see established connections with the command:

netstat -natu | grep 'ESTABLISHED'

Sending and receiving messages

Once a socket has an established connection, the functions send and recv are used to write and read from the socket.

int send(int sockfd, const void *msg, int len, int flags);
int recv(int sockfd, void *buf, int len, int flags);

send and recv do not guarantee to write or read all len bytes.

send returns the number of bytes actually sent or -1 on error.

recv returns the number of bytes actually read, 0 if the remote side closed the connection, or -1 on error.

Closing connections

int close(int sockfd);

close, the function used for closing files in general, is used to close a connection.

  1. Perhaps I should have spent more time looking for a better source of information. The author of this guide one seems to have some right ideas and occasionally is funny,

    They say absence makes the heart grow fonder, and in this case, I believe it to be true. (Or maybe it’s age.) But what I can say is that after a decade-plus of not using Microsoft OSes for my personal work, I’m much happier! As such, I can sit back and safely say, “Sure, feel free to use Windows!” …Ok yes, it does make me grit my teeth to say that.

    but despite knowing better he bows to the crowd

    At this point in the guide, historically, I’ve done a bit of bagging on Windows, simply due to the fact that I don’t like it very much. But I should really be fair and tell you that Windows has a huge install base and is obviously a perfectly fine operating system.

    The guide also includes sections on writing IPV6 compatible code. I skimmed over them. IPV6 is the network equivilant of Gavin monster blocks. []

  2. If a process forks the child process is given a copy of the parent process's table. Changes in the two tables are not shared between the child and the parent. If both parent and child try to read from the same file, the one that calls read first gets the data. []
  3. i.e. the index of the file in the process's file descriptor table []
  4. The parameters given to socket determine whether the socket will use the tcp or udp as well as whether it will be used for network or local communication. []
  5. A socket descriptor is a file descriptor that refers to a socket. Socket descriptors and file descriptors share the same table. []
  6. sockaddr is a struct of address information that includes the (ip address, port) pair. []
  7. The ip address can be a loopback address such as 127.0.0.1 if the socket is being used for local communication. []
  8. for connect, sockaddr refers to the remote address. []
  9. Previously, I had the misconception that the same port was used for each side of the client and server pair. []
  10. The parameter backlog determines the length of the queue of incoming connections. It should be <= to the system limit, which is usually around 20 []

A confession of how I waste time 2

January 29th, 2020

A confession of how I waste time 1

Last week my productivity slacked. I constantly paused work to do mindless activities. Lack of focus is an ongoing problem,1 but this past week my symptoms were more severe than usual. I figure one way to address the issue is to write an article revealing some of the embarrassing ways I waste my time.

The first is I listen to music during work and in between tasks. Before I do the dishes or some mundane chore, I put on a song. This makes all the small jobs I need to do around the house take longer. I recently knocked over a pot of hot coffee while changing a song, splattering shattered glass and liquid all over my kitchen.

I've mentioned this problem before. What I didn't mention was the exact "music" I listen to. I always put on something by Russ, a rapper who raps about being hard working and self made. So yeah, just about everyday for months I've been being lazy and listening to the same chord progressions accompanied with lyrics about how someone else's hard work led them to success.

The lyrics of Russ's song, Me You, are ohso fitting. Russ raps about the difference in work ethic between him and the listener.

...
Yeah, mm yeah, there's a difference
Oh yeah, there's a difference
Oh, yeah, there's a difference
There's a difference, yeah
Yeah, yeah, yeah

Me, got it out the mud, they respect that
Me, always spread the love when I get back
You, got your hand out, that's a bitch move
You, always complaining like a bitch do
Me, still right here with who I came with
Me, self-made, my circles on the same shit
You, got a different crew every weekend
You, don't want it that bad, keep sleeping
Yeah, you wished for it, me, I worked for it
...

2

Another way I burn the precious minutes of life is by watching surf videos on youtube.3 I've tried to prevent myself from doing this by null routing www.youtube.com by inserting "0.0.0.0 www.youtube.com" into my hosts file. But the fake resistance doesn't help, I always find some justification for commenting out the line.

These two specific avoidance behaviors are likely symptoms and not the source of my problem. But maybe analyzing the symptoms can help discover the root. The connection I see between the two aforementioned activities are they are low effort ways I use to hallucinate success. While listening to Russ, I am imagining myself as having already reached success through hard work. While watching the surf videos, I am imagining myself on large perfect waves. I might as well spend the time watching videos on other sites. I'd be doing the same thing except I'd have something to show for it when I finish.

  1. As I'm sure it is in the lives of most. []
  2. Quite the poetry when you see the lyrics written out, yeah, yeah, yeah. []
  3. I also go out and surf, that is after all a major reason I live where I do now. But I've reduced the time spent surfing to a healthy 5-7 hours per week. It has been easy to not avoid work through surfing, because there has been very little swell the past few months. Am I going to be able to forgo getting in the water when I see glassy barrels out my window? []

Fleetbot Pseudocode, Bugs and Fixes, and the New Next Steps

January 26th, 2020

Below is an overview of how TheFleet works on a per network basis. The article also touches on a bug I found in cl-irc, enumerates the hurdles I have to overcome related to orchestrating the fleet of fleetbots, and lists my next steps forward.

Table of Contents:

I. Fleetbot class template
II. Connecting basics
III. How fleetbot handles various irc messages
IV. Reconnecting
V. Notes on logging
VI. A bug in cl-irc
VII. Problems with orchestration
VIII. Next steps

I. Fleetbot class template

Below is the fleetbot class template. Some of the fields are inherited from its superclass, ircbot.

Field Name Datatype Description
db list a list of four strings (db_name, db_user, db_user_password, db_ip_addr) used for connecting to the postgres db.
sunk-p boolean set to true if the bot has disconnected, false otherwise
resurface-attempts integer the number of consecutive failed attempts to connect to a network. gets reset to 0 upon a successful connection. a connection is deemed successful when we receive our join message from the server1 for any channel in our lists of channels.
connection cl-irc class an object representing the connection to the network. ~all cl-irc commands take this object as the first parameter.2
channels list a list of strings that are the names of channels the bot will attempt to connect to.
active-channels list a list of strings that are the names of channels we are currently connected to. upon being kicked from a channel, we remove the channel from active-channels. upon being disconnected, we remove all channels by setting active-channels to nil. we add the corresponding channel to active-channels when we receive back our join message from the network.
networkname string the name of the irc network the bot connects to
server string the hostname of the network
port int the port number of the network (usually 6667)
nick string the nick we use for the network
current-nick string the nick that we are using for our current connection. this is the same as nick, unless the server told us we could not use nick (most likely because nick is already being used.) in this case we append "-???" to nick where each ? is a random digit 0-9.
password string the password for the nick. since we do not use registered nicks for fleetbot, this field is always nil.
connection-security :ssl or :none the connection security for the network. currently we do not connect to networks via ssl, so this is always set to :none
run-thread sb-thread the thread that is used for communicating with the server
ping-thread sb-thread the thread that is used for sending pings to the server
lag int the difference between the last time we sent the server a ping and the time we received the server's corresponding pong.
lag-track list everytime we send the server a ping we store a reference to the ping in the lag-track. when we receive the corresponding pong from the server we delete the ping from the lag-track. if we have not received a pong in response to a ping for > *max-lag* (default = 60) seconds we determine we have disconnected, and the ping-thread will attempt to reconnect our bot to the network.

II. Connecting basics

The fleetbot constructor takes as parameters: the server information (networkname, server, and port), a nick, a list of channels, and the db used for logging.

We then connect fleetbot via the overwritten method ircbot-connect-thread. ircbot-connect-thread creates a new thread, assigns that thread to the bot's run-thread field, and within the new thread calls ircbot-connect.

ircbot-connect is surrounded in a handler-case.3

First, ircbot-connect calls cl-irc's function connect, which takes a nickname, server, port, and connection-security and returns a connection object. The connection object provides an interface to send and receive messages from the irc server via cl-irc's api. Next, we use cl-irc's api to add a list of hooks to the connection object. A hook is a mapping of an irc message type to a function. When we receive a message via the socket stored in the connection object, cl-irc searches for hooks that are assigned to the message's message type and calls the hook's function with the message passed as the sole parameter.

If at any point an error is thrown, then we mark the bot as "sunk" and attempt to reconnect the bot. If we cannot reconnect after +MAX-RESURFACE-ATTEMPTS+ (default = 5) attempts then we determine the bot has sunk for good and stop trying to reconnect.

III. How fleetbot handles various irc messages

We have the following hooks setup:

IRC Message Type Function Description
irc-err_nicknameinuse-message We change our nick by appending a random suffix. (i.e. jenny -> jenny-482)
irc-kick-message The intended behavior is to log that we are kicked and then remove the channel from our active-channels.

Currently upon being kicked from a channel, we have a bug where we immediately try to rejoin all channels in fleetbot's channels field.4

irc-notice-message A notice message is an arbitrary message from the server. Different networks send different notice messages. For our purposes, we parse the message to see if the server is telling us that the nickname we're trying to use is registered. If so, then we pick a new randomize nick, just like we do when we receive irc-err_nicknameinuse-message. Afaik this is only useful for freenode.
irc-pong-message When we receive a pong message we calculate our lag with the server and mark that the server has received our ping.
irc-rpl_welcome-message Upon receiving the welcome message from the server, we start the ping-thread and connect our bot to its channels via cl-irc's join method.
irc-privmsg-message A privmsg is any normal user message sent to a target.5 We log privmsg's to the irclog table in our postgres db.
irc-part-message A part message gets sent when a user leaves a channel. We log these to our irclog along with privmsg's.
irc-join-message A join message gets sent when a user joins a channel. We log joins to our irclog along with part and privmsg's. If the join message is saying that ~we~ joined the channel, then: we add the channel to our list of active channels, we log to fleetlog that we joined a channel, and we set our consecutive-resurface-attempts back to 0.

After we set all the above hooks, we enter an infinite loop reading messages from the server. If we have a hook for the message type of a message we received, we dispatch to the corresponding function. If we receive a message type that we don't have a hook for, the default-hook from cl-irc gets called, which usually just prints the message to STDOUT. If at anypoint during our infiniteloop the server sends us an EOF or we throw any error, we attempt to reconnect.

IV. Reconnecting

Reconnecting is a bit tricky because there are two different threads that can call reconnect: the bot's run-thread and the bot's ping-thread. The run-thread would be reconnecting because the run-thread received an EOF from the server or hit an error during its operation. The ping-thread would be reconnecting because it hasn't received a pong to one of our pings from the server in *max-lag* seconds.

The reconnect flow is as follows:

First, we call ircbot-disconnect. ircbot-disconnect sets sunk-p to true6 and then logs an internal DISCONNECTED message to fleetlog for all the active-channels the bot was connected to. Then we set active-channels to nil. If we have an active connection to the network, we close that connection. Then we set the ircbot's lag-track and ircbot-connection to nil. Then, if we are calling disconnect from the run-thread, we kill the ping-thread. If we are calling disconnect from the ping-thread, we kill the run-thread.7 We then set the ping-thread to nil.

Once we've disconnected cleanly, we attempt to connect. If we are the run-thread we call ircbot-connect. If we are the ping-thread, we make a new thread with ircbot-connect-thread, and then call sb-thread:abort-thread to end the current thread.8 Then we set sunk-p to false.

V. Notes on logging

Our schema has two tables - irclog and fleetlog. We insert into irclog the types of messages one would normally see in their irc client: privmsg, join, part, and kick messages. Fleetlog, on the other hand, keeps a record of our bot's events that we choose to store. For each event we log: a custom message describing the event, the channel (if applicable), the nick (if applicable), the networkname, and the time the event occurred. The custom messages currently logged are:

Message Description
JOINED logged for a channel+nick when we receive a join message from the server where we were the ones who joined
KICKED logged for a channel+nick when we get kicked from a channel
DISCONNECTED logged for every active-channel when we call ircbot-disconnect
COULD-NOT-RECONNECT logged for every channel we failed to connect to when we have failed a consecutive series of attempts to reconnect
ARMADA-ALL-DEAD logged for a network when all bots (within a process) connected to a network have crashed
PROCESS-TERMINATED logged for a network when we end the process running fleetbot (either because all ships have sunk or because the process received a kill signal)

The schema for the postgres db is pasted below. Noticably missing is the indexing for fleetlog.


set search_path = public;

create table irclog (
    id serial primary key,
    target text not null,
    message text not null,
    host text,
    source text not null,
    "user" text,
    networkname text not null,
    irc_message_type text not null,
    received_at timestamp without time zone not null default (now() at time zone 'utc')
);

create index irclog_received_at on irclog (received_at);
create index irclog_target on irclog (target);
create index irclog_source on irclog (source);
create index irclog_networkname on irclog (networkname);

create table fleetlog (
    id serial primary key,
    channel text,
    message text not null,
    nick text,
    networkname text not null,
    received_at timestamp without time zone not null default (now() at time zone 'utc')
);

Also, when I run fleetbot, I redirect standard out to a log file. The log file contains prints of unhandled irc messages and debugging print statements I put inside fleetbot.

VI. A bug in cl-irc

I gave the cl-irc source a pass and noticed a bug that affects fleetbot. cl-irc has a global variable *unknown-reply-hook* that can be assigned a function. That function is supposed to be called anytime an irc network sends a message of unknown type. However, the code that throws the no-such-reply error in cl-irc is malformatted.

This9

(error "Ignore unknown reply." 'no-such-reply :reply-number reply-number)

should be:

(error 'no-such-reply :reply-number reply-number)

The bug in cl-irc made the no-such-reply error bypass cl-irc's own handler-case10, throwing the error upstream to fleetbot. Fleetbot handles all errors by reconnecting. So upon receiving an unknown reply, fleetbot would reconnect and then usually receive the same unknown reply, causing fleetbot to reconnect again ad infinitum. I will patch cl-irc with the above fix and then set *unknown-reply-hook* to a function that logs unknown replies to fleetlog.

VII. Problems with orchestration

I need to rewrite how I orchestrate the fleet of fleetbots. Here are the constraints I am dealing with:

1. An irc network typically only allows 3 connections per IP.

2. A VM with 1GB of RAM costs me $5 / month.

3. A unix process running sbcl and asdf consumes 30MB of RAM at minimum. Currently a running fleetbot consumes closer to 100 MB.

4. A unix sbcl process has a maximum number of threads that it can have running concurrently.11

5. A unix sbcl process has a maximum number of sockets it can have open.

6. A unix process has a maximum number of filedescriptors it can use. (adjustable with ulimit)

VIII. Next steps12

1. Publish vpatch addressing ircbot's reconnect bug

2. Fix reconnect on kick bug

3. Increase delay before reconnecting to a network

4. Patch cl-irc + create way to distribute fix to VMs (after I patch I can no longer load cl-irc via quicklisp)

5. Set *unknown-reply-hook* to a function that logs unknown replies to fleetlog

6. Fix fleetbot's db schema

7. Write article planning how to address orchestration of bots

  1. To join a channel, we send the server a join message. If the join is successful, we receive the same join mesage we sent back from the server. []
  2. Under the hood, connection uses usocket:socket-connect to create a socket connected to the irc network. Then the socket is passed to usocket:socket-stream to get the network-stream. cl-irc creates an output-stream (used for sending messages to the network) by passing the network-stream to flexi-streams:make-flexi-stream. I haven't explored the usocket nor flexi-streams library at this time. []
  3. A handler-case is Common Lisp's version of a try/catch block. []
  4. I discovered this only now and it is the cause of problems I've run into.. The weird part of the bug is that we rejoin all channels when we are kicked from only one channel. This may explain why I saw "ERR_TOOMANYCHANNELS" messages despite limiting the length of channel-list to the max number of channels alllowed per nick on the network. []
  5. A target is either a nick or a channel. []
  6. I realized that ircbot-reconnect was setting sunk-p to false, ~before~ we call ircbot-disconnect. So all of our bots that reconnected once were being incorrectly marked as sunk. This has been fixed. []
  7. This is handled incorrectly in the current version of ircbot. In ircbot, the ping-thread kills the ping-thread (itself) when trying to reconnect, thus crashing the bot. Since there is a few pieces of republican infrastructure sitting ontop of ircbot, it is a top priority to create a vpatch that fixes this. []
  8. But I realize there is no reason for this "create new thread and then self destruct". At this point the ping-thread can stop doing its pinging job and just become the run thread. []
  9. I do not know why the author of cl-irc put the string "Ignore unknown reply." as the first parameter. The first parameter instead should be the condition type. []
  10. try/catch block []
  11. 2048 iirc. There is likely a way to increase this number. []
  12. Updated from my last plan []

Holy shit, lizard hitler's scheme to scare people away from non-https sites is working

January 24th, 2020

Do you remember when Googlag and other agents of the evil empire conspired to push everyone onto their https scam? A few years ago they updated their browsers to display a "not secure" warning when connected to a non-https compliant site. I had forgotten about this myself, until recently when I shared my blog with someone at a bar. He pulled up my site on his phone and immediately commented that it was not secure. Gasps and whispers could be heard from onlookers, insecure! wasn't whaack just talking about how he was interested in cryptography?

Naively, I responded by trying to explain why one should ignore the browser's warning. But countering ignorance with a wordy rational argument is pointless at best and autistic at worst. My explanation came off defensive. I should have thrown him something out of the blue.

I left the bar wondering: could Goolag & co's scheme be driving away a substantial amount of tmsr readership? On the bright side the https warning may serve as a helpful filter. If you fall for it, God help you. But perhaps there are some confused souls with potential being led astray. The pretense that Googlag gives for requiring https may be convincing to someone who has not yet "negrated" the certificate signing authorities. Think of the children!

Whether the "not secure" warning does more harm (by blocking potential noobs) than good (by filtering out the cluess) is unclear. The problem is that tmsr has no say in the matter. There's no way around this if it's a given that the enemy controls what is displayed on their cattle's screen.1 But so long as they don't modify my site itself, I can leave a little signal on the top left corner of my page.

  1. I'm sure they would prefer to ban all sites outside of NSABook/Instaspam/Goolag/etc. Apple's walled-garden app store is most of the way there. []

Installing Software on the New Machine

January 23rd, 2020

After various delays, I have finally put together a machine running CentOS-6.9-x86_64-minimal.iso. My next task is to install necessary software. First I must clarify what I want to do with the computer.

The reasons I built the computer are:

1. To have a machine I can trust1 that allows me to be maximally productive.

2. To gain a better understanding of the hardware and software I use.

3. To rid myself of my dependency on a company that treats its customers like cattle.

Keeping these reasons in mind, I need to go forward with the goal of installing software I've read and understood. Unfortunately, fully understanding each piece of code I use is an unrealistic ideal. Computing has perhaps left the world of math and entered the world of biology. The complexity is too great, so certain items will be installed on faith.

To give direction on what I need to install, I put together a list of what I would like to do with my machine.

1. Blog

2. Program

3. Communicate through IRC

4. Play Eulora

5. (Optional) Run a bitcoin node

In order to obtain what I need to do the above, I must setup software that helps me install other software. This begins by installing a V, or even better by writing my own V. Then I need to configure a network connection.

In order to blog I must install emacs, a graphics stack, and a web browser. I will install all three with yum. These pieces of software are examples of tools I depend on that I don't have time to fully read and understand. Also, by installing via yum, I am placing confidence in signatures from keys unknown to any of my trusted peers.

In order to write programs, I will need to setup my emacs environment. At a minimum I will need to make sure I have syntax highlighting. Some other features I find useful are jump-to-function-definition and auto-complete. However I am not so sure that these tools help me. Lastly, to continue my work on TheFleet, I will need to install sbcl, quicklisp, slime, and postgres.

For communicating through IRC, I will use V to press jfw's yrc client.

I noticed that there is no guide on Eulora's website for installing the game on CentOS. So I will try to compile the client from source and of course ask for help in #o or #e.

And lastly, for installing a bitcoin node I will use V to press trb.

There are other tasks I must do to setup my computer. For example, I need to setup an SSH key and add the public key to my VMs and blogs, etc. But the above list should keep me busy for now.

  1. to a certain degree []

Spanish Pop Study - An Attempted Translation of Dollar by Becky G and Myke Towers - Part 2

January 22nd, 2020

Continued from part 1

Yo sé que hay muchos en fila
Y que te cansaron las mentiras, deja que el destino decida
Tú estás por encima, siempre por mi mente desfilas
No hay otra parecida, que tú eres única
La foto viral a la que la haces pública
Vámonos de vacaciones pa' la República
Con una como tú uno lo que quiere es turistear,
Pero ella me tumba el plan
Myke Towers, baby

I know that there are many in line
And that they tire you with lies, let fate decide1
You are on top, you always run through my mind
There's no one similar, you are unique
The viral foto is that which you make public2
Let's go on vacation to the (Dominican) Republic
With someone like you the desire is to travel3
But she owns my plan
Myke Towers, baby

Hook x1

Becky G responds

No me pongas esa cara
Con esos ojitos no me vas a convencer
Sabes que mi amor es caro
Si lo quieres, tú tienes que trabajar por el (Por fa', eh)
Si te dijo que me bajes el cielo (Ey), me lo bajas entero (¡Wuh!)
Si te dijo que vengas, me traigas hasta el mar (Rrr), cruza los 7 mares (Ah ah)
Así es que se hacen las cosas con esta muchacha
Quiero más acción y menos blah-blah

Don't put on that face
With those little eyes you're not going to convince me.
You know my love is expensive.
If you want it, you have to work for it (Please, eh)
If I tell you to lower the sky, (ey) you lower it all the way (wuh)
If I tell you to come, you carry me to the sea, (Rrr) across the 7 seas (ah ah)
That's how things are done with this girl
I want more action and less blah-blah.

Hook x2

Luian (Yeah yeah yeah)
¡Mambo Kingz! (Jajaja)
Hydro
Jowny
Myke Towers, baby

Every Spanish pop song seems to end with some promotional shoutouts.

  1. Or literally, "let destiny decide" []
  2. Another translation says, "The viral photo you make public" . I am doubting both translations. I am unsure of what Myke Towers is trying to say here. []
  3. Another translation says, "with a girl like you, what you want is to be a tourist." From my first understanding, it is ambiguous whether the subject of querer (to want) is the third person or second person formal. However upon further examination I believe that its conjugation is meant to be in the second person formal. There is no context for a third person here. []

El Toro

January 22nd, 2020

The crowd splits; the beast charges in my direction. A paralysis seizes me. Just stay still, close your eyes, it'll be okay. Now I understand the headlight effect. But I am no deer. I scramble away, unsure where to face while running. Look forward, lose site of bull. Look back, collide or trip.

I head for the fence, the way out. There are other dangers. I dodge a man. I dodge a horse. Almost free. I slide under the fence. Should have climbed it. Legs have reached safety, head and torso have not. There are spectators blocking my exit. I kick the assholes until they move. Safe.

I go for a walk, dusting off my clothes. My camera is missing, but what does that matter?

TheFleet Test Run Results and Next Steps

January 22nd, 2020

Two weeks ago I launched 2 fleets on 2 separate VMs. Each fleet connected to 7 networks.1 I was only able to connect to 7 networks per VM because I use a separate sbcl process for each network, and quicklisp uses 70MB of memory by itself. My VMs have 1GB of RAM. At the time of writing, VM1 collected 20,203 messages and VM2 collected 43,410 messages.2 An example query of the data on VM1:

fleetbotdb=> select message, target, networkname from irclog where LOWER(message) like '%btc%';
  message                              |    target     | networkname
  -------------------------------------------------------------------+---------------+-------------
  hey MrBTC                                                         | #nostalgic    | DejaToons
  get that other retard with that btc referal                       | #VHSTAPES.ORG | DejaToons
  !btc                                                              | #VHSTAPES.ORG | DejaToons
  !btc nzd                                                          | #VHSTAPES.ORG | DejaToons
  [BTC_DUMP] (ZeaS|SaInT-DeViL): -2.07% 9042.921019276757 -> 8855.5 | #pos          | D4RCnet
  Bought 0.1847727 BTC for 1640.35 USD                              | #pos          | D4RCnet
  [BTC_DUMP] (ZeaS|SaInT-DeViL): -2.34% 8852.59497206704 -> 8645.1  | #pos          | D4RCnet
  [BTC_DUMP] (ZeaS|SaInT-DeViL): -2.04% 8642.408379888288 -> 8465.9 | #pos          | D4RCnet
  [BTC_DUMP] (ZeaS|SaInT-DeViL): -2.44% 8716.312068028039 -> 8503.9 | #pos          | D4RCnet
  (9 rows)

There were a few problems I encountered that disconnected most of my bots. On VM1 it appears the only networks I am still connected to are DejaToons and deguino.net. On VM 2, Omninet. I am never 100% sure of my connection status to various channels/networks because to get that information I need to manually dig through logs.

Here are some of the error messages I received from the networks where I am sure I disconnected:

DigitalIRC - ERR_YOUREBANNEDCREEP: shire.digitalirc.org snup97 "You are not welcome on this network. G-Lined: join/part spam. Email https://tickets.digitalirc.org for more information."

Crippler - Sent me TOOMANYCHANNELS errors and then I couldn't reconnect.

GeekSheed - ERROR: "Closing Link: snup97[167.172.17.162] (User has been banned from GeekShed (You are banned from GeekShed for 8d! Reason: Malicious bots, clones and drones are prohibited by the Network TOS. :You may appeal it at http://www.geekshed.net/bans/?setby=Coyote%60&seton=*%40167.172.17.162&time=8d&reason=Malicious bots, clones and drones are prohibited by the Network TOS.))"

P2PChat - NOTICE: spinnaker.p2pchat.net roco44 "*** You are banned from P2PChat (either stay on or off (3 days))"

AustNode - ERR_YOUREBANNEDCREEP: Koala.SG.AustNode.org roco44 "You are not welcome on this network. Z-Lined: suspicious host. Email NetAdmins@AustNode.org for more information."

BDChat - NOTICE: irc.bdchat.com roco44 "*** You are banned from BDCHAT ([CaNdy_SHop_US] [CaNdy_SHop_US]). Email admin@bdchat.com for more information."

freenode - ERROR: "Closing Link: 68.183.107.30 (Excess Flood)"

SceneP2P - ERR_YOUREBANNEDCREEP: Wintermute.SceneP2P.net roco44 "You are not welcome on this network. G-Lined: Invalid channel. Email banned@scenep2p.net for more information."

On VM1 my bots logged 19,519 channel joins 19,276 channel disconnects. On VM2 4,440 joins and 4,354 disconnects. I discovered that only a few of these disconnects were due to being kicked from a channel. So somehow I am getting into reconnect/disconnect cycles that show up as spam. This gets me banned from the network.

My next steps forward are as follows:

  1. Reduce memory overhead from using quicklisp to load cl-irc and its dependencies.
  2. Create a strategy / command for being able to see which networks/channels I am currently connected to across my VMs.
  3. Investigate why I did a reconnect/disconnect dance with certain networks.
  4. I saw in the logs that some networks said I was joining too many channels. I should investiage why, since the number of channels my nicks join are capped at the network's reported max-chans-per-nick limit.
  5. Investigate Excess Flood problem with freenode.
  6. Increase delay before reconnecting to a network. Remove cl-ircs auto reconnect on kick.
  7. Publish vpatch for ircbot's reconnect bug.
  1. VM1: DigitalIRC, DejaToons, deguino.net, D4RCnet, Crippler, GeekShed, P2PChat.
    VM2: freenode, DALnet, ircHax0r, Omninet, SceneP2P, BDCHAT, and AustNode []
  2. These were messages of type PRIVMSG, i.e. normal user/bot messages. There were about 100,000 messages total if we include join/part messages. []

Computer Build Plan

January 21st, 2020

diana_coman: that's where everything else should come from; so: what's the goal of this plan of yours?
whaack: diana_coman: The goal is to ensure I have what I need and know what to do in order to execute a timely, safe, and proper build of my computer.
whaack: safe means I don't open up the possibility of breaking something, and proper means I don't make a mistake that requires me to do undo a bunch of work to fix.

First we will ensure I have what I need to build the computer.1 Below is a list of all the tools, cables, consumables, screws, and parts I will use - with their location specified in a footnote.

Tools

  • Screwdriver set2
  • Small pliers (to grip hard to reach items)3
  • Rechargeable compressed air sprayer4
  • Flashlights5

Consumables

  • Zip ties (100x 200mm and 100x 100mm)6
  • Thermal Paste 2g (4x)7
  • Thermal Paste Cleaning Supplies
    • 90% Ethyl Alcohol (about 1/2 liter)8
    • Qtips (~200x)9
    • Coffe Filters (~100x)10

Screws

  • General Screw Package:11

    • Thumb phillips screws M6 * 6 (10x)
    • hexagon head phillips screws M6 * 6 (25x)
    • Pan head phillips screws M6 * 6 (25x)
    • Steel standoffs screws M3 * 5 + 7 (15x)
    • Brass standoffs screws M3 * 5 + 7 (15x)
    • Phillips flat head coarse thread screws M5 * 10 (15x)
    • Phillips recessed truss head screw M3 * 5 (25x)
    • Phillips recessed truss head screw M3 * 6 (25x)
    • Insulation washers (25x)
  • Extra 6-32 x 1/4" screws (100x)12
  • Internal Fan Screws (4x)13
  • Thumb screw for GPU (1x)14
  • Screws for PSU (4x)15
  • 4 Hand Screws for Tempered Glass Panel16
  • 2 Thumb Screws for Back Panel17

Cables

  • PSU Cables18

    • 24pin Mobo Cable (1x)
    • 8pin CPU Cable (2x)
    • 6pin / 2pin Split PCI-e Cable (3x cables, 2 connectors)
    • SATA Cable (3x cables, 4x connectors)
    • Molex Cable (1x cables, 4x connectors)
  • Monitor Cables19

    • Power Cable
    • HDMI Cable
    • Display Port Cable
    • USB 3.0 Upstream Cable
  • Case Cables20

    • Front Panel Audio/Mic Jack Cable
    • Front Panel USB Cable
    • Four Front Panel Button / Lights Cables (+P LED, -P LED, POWER SW, RESET SW)
    • SATA Cable for case lights
  • Fan-to-motherboard cable (attached to fan) (2x)
  • CPU Fan cable (attached to CPU heatsink) (1x)
  • SATA 6Gbs cable (3x)21
  • Ethernet Cable22

Internal Components

  • Case Fans (2x)23
  • Motherboard24
  • CPU25
  • CPU Heatsink26
  • Graphics Card27
  • Ram Stick (2x)28
  • Primary SSD29
  • Backup HDD30
  • SD Card Reader I failed to purchase the right part. I ordered a card reader with the wrong bay size for my case. I will order a simple USB one through my mailing address.

Accessory Parts

Now that we have the full list of parts and where they are located we can map out a plan for building the computer. This is what is done so far:

1. The motherboard is screwed in.
2. The fan on the front-panel side is installed.
3. The CPU is locked into its slot on the motherboard.

The heatsink is currently attached to the CPU, but this was done for storage purposes. It must be unattached to apply the thermal paste.

I will first install all the parts, minus the GPU, then attach all the cables, and then install the GPU.35

0. Preperation (30min)

1. Clean and vacuum desk, setup good lighting, and remove all food/liquids from the premace.
2. Put cups/bins on desk to place screws in.
3. Comb hair and tie it in a bun (I have noticed I have dropped hairs into the case)
4. Charge air blower (Done night before)
5. Open case.
6. Do preliminary cleaning of the case with air blower.

1. CPU Installation (Estimated time: 1hr. The reason for the long time is because I need to make sure I can place the heatsink on the thermal-pasted CPU gracefully by first practicing the process a few times.)

Parts Used: CPU, CPU Heatsink (And later: CPU Power Cable)

First, I will apply thermal paste to the CPU with the one pea sized point method as recommended by Arctic, my thermal paste supplier. Then I will carefully attach the heatsink on top of the thermal pasted CPU.

2. HDD Installation (Estimated time: 10 min)

Parts Used: HDD + 4x Pan head philips M6 * 6 screws (And later: SATA cable to motherboard and PSU SATA Power Cable)

I will take out the mount from the case, and put the HDD in the mount. I will take care to think which of the two locations is the best position for the HDD, and also to consider how the SATA power cable will attach to the PSU as well as how the SATA Data transfer cable will attach to the mobo.

3. SSD Installation (Estimated time: 10 min)

Parts Used: SSD + 4x Phillips recessed truss M3 * 6 screws (And later: SATA cable to motherboard and PSU SATA Power Cable)

I will put the SSD on the bottom slot on the opposite side of the motherboard. Then I will screw it in by inserting the screws from the other side of the case into the SSD. The entry point for the screws can be seen in this picture. (I am using the SSD slot where in the picture 2 of the 4 screw holes are covered by the fan's power cable.) Just like the HDD, I will take care to consider how the two SATA cables will connect.

4. Ram Stick Installation (Estimated time: 4 min)

Parts Used: 2x Ram Sticks

I will carefully plop the two sticks into their slots, in the same place they were when I disassembled the machine.

5. Upper Left Fan Installation (Estimated time: 6 min)

Parts Used: 4x Fan Screws, 1 Fan

I will screw in the fan as positioned in the top left of this picture.

6. Plug Shit In (Estimated time: 20min)

The following cables will be attached more or less in the order listed:

Main 24pin MOBO Power cable
CPU Power Cable
Fan Power Cables (2x)
1 SATA cable from the PSU should connect to the case lights, the SSD, and the HDD.
SATA cables from HDD/SDD to MOBO.
All front panel cables (Audio/Mic Jack, USB cable, Power/Reset Button + LEDs)
PCI-e Power Cable for GPU

6. Graphics Card Installation (Estimated time: 8 min)

Parts Used: Graphics Card + 1 Thumb Screw

I will place the graphics card in the PCIe slot and then screw it in with the thumb screw.

7. Cleanup (Estimated time: 15 min)

1. Zip tie cables together.
2. Clean with compressed air again.
3. Close front and back case.
4. Place built computer under desk.

The next steps, outside the scope of this article, are to plug in the keyboard/mouse/monitor and install Centos + all necessary drivers.

  1. One missing item is the motherboard's IO Shield. This will increase the rate at which my computer collects dust. I was not able to find any shields from a preliminary search. []
  2. Located on floor next to case []
  3. Located on floor next to case []
  4. Located on floor next to case []
  5. Located on nightstand []
  6. Located in PSU Box []
  7. Located on nightstand []
  8. Located under sink in bathroom []
  9. Located under sink in bathroom []
  10. Located in cabinet under coffee machine []
  11. Located on floor next to case []
  12. Located on floor next to case []
  13. Located in parts-box in tupperwear containing fan []
  14. Located in parts-box in tupperwear containing fan []
  15. Located in PSU box in plastic box []
  16. Attached to case []
  17. Attached to case []
  18. Located in PSU box []
  19. Located under monitor or attached to monitor []
  20. Already connected to case []
  21. Located on floor next to case []
  22. Located on desk. []
  23. One located in case another located in tupperwear in parts box []
  24. Already in case []
  25. Already in case []
  26. Already in case []
  27. Located in protective sleeve inside parts-box []
  28. Located in tupperwear in parts box []
  29. Located in box on desk []
  30. Located in box on desk []
  31. Located on desk []
  32. Located on desk under the monitor []
  33. Located on desk under the monitor []
  34. Located under the desk []
  35. GPU Is installed last because it makes it harder/impossible to plug in certain cables. []

Panamá Bien Vestido

January 20th, 2020

While packing my bags for Panama I asked dorion what the gents usually wear to their weekly Junto meeting. I was happy to hear I would finally have a use for the blazer that's been collecting dust in my closet. Dorion told me that anyways he always goes out bien vestido because, "I never know who I'll meet and in a lesser part because it trolls casual 'culture.'" Well his lesser reason seemed a great reason to me. So I arrived at the youth hostel, Selina, with a tie on. I bathed in the indignation and other reactions I got from being decently dressed.

Shortly after arriving, dorion popped in the hostel for a drink. We went to Selina's rooftop which has a great view of the bay and the city's skyline. One of the bartenders working there asked us why we were both so well dressed. She then seated us at a table that had a Reserved card on it. The table was positioned to let us enjoy the nice view, and the bartender sat with us for our first drink. Our conversation floated between Spanish and English; we discussed with her shocking topics such as why the US no es el mejor país.

Later, she took a photo of us.

panama-1

After we got drinks on the roof of Selina's, Dorion and I went for a walk around Casco Viejo. We ran into a local who had grown up in the town and worked in finance in Chicago. He knew about the various buildings and he had a back and fourth with dorion about the history of the town. I (unintentionally) got a hilarious mug of him in the corner of the picture I took of one of JP Morgan's buildings.

panama-4

Iglesia de La Merced

panama-2

American Trade Hotel & Hall

panama-3

Panama Metropolitan Cathedral

panama-5

Paseo de Las Bóvedas

panama-7

whaack

panama-8

I slept in the next morning, exhausted from the previous day of travel.1 Around noon I went on a bike ride on La Cinta Costera - a road that juts out into the bay. The view was nice, but it was hot and at times the smell made me ill.

panama-9

The city has swings setup under the bridge. Because that's exactly where a parent would want their kids to hang out.

panama-10

Panama's bay changes drastically with the tide.

panama-11
panama-12

After the bike ride I returned to the hostel and then took a cab to meet jfw. We went to the roof of his building and had coffee and beer.2 We chatted about a few topics. While we were discussing his work for tmsr-os, jfw made a statement that stuck with me. He said computing may have left the world of math3 and entered the realm of biology.4 After our chat we walked over to the networking meetup. During the event I met most of the Junto crew that I would be seeing the next day.5 After the event jfw, dorion, and I got a bite at a diner.

Conspiring pageboys

panama-13

The following morning I went to go see the Miraflores Locks at the Panama Canal. It was inspiring to see big business taking advantage of a major engineering accomplishment. What would it take to get to the serenity of mind required to see this project to completion?

I was curious about what appeared to be a leak coming out of the corner where the wall of the canal meets one of the gates. You can see what I'm talking about in the picture below. If you know/have a guess why this exists, please comment.

panama-14

The ship waits patiently.

panama-15

Gates are closed.

panama-16

The water level becomes equal in each compartment, a bell rings, and those ~600 ton gates begin to open.

panama-17

The ship is pulled by trolleys.

panama-18

The gates begin to close.

panama-19

The apparent leak from the right compartment to the left compartment continues, even when the left compartment is draining and the right compartment is filling.

panama-20

The next ship begins to enter.

panama-21

After my trip to the Miraflores Locks I took another daytime stroll through Casco Viejo and then went long boarding east along the bay.

panama-29

A daytime shot of the cathedral.

panama-22

Look at that crystal clear water.6

panama-23

For dock operating hours, please refer to the moon.

panama-24

Am I back in NYC?

panama-25
panama-26
panama-27
panama-28

On the way back from long boarding I saw two siblings I had met at the hostel in a fish market and joined them for some beer and ceviche. The market has a large food court with a decent number of little restaurant fronts. As you walk in the food court all the waiters are calling you to try to get you to sit down at their table. When our waiter went to the bathroom he told us to only speak with his friend while we waited for his return. His request suggested the tables did not belong to individual restaurants and so ostensibly another waiter could swoop by and steal a client.

panama-30

After ceviche we went to climb up Cerro Ancón, a hill that overlooks the city. I had to turn around before reaching the top so I could get back in time for Junto.

Obligatory flower picture.

panama-31

A view from ~ half way up the hill.

panama-32

The below picture is not supposed to be of the vulture. I saw some rodents7 adorably hoping around. You can see two of them in the center of the pic if you look closely.

panama-33

Some buildings near the Junto meetup. I did not get a photo of El Tornillo,8 the building where the Junto meeting was held.

panama-34

I had a great time during Junto. Chad gave a nice introduction to music theory. He kept everyone engaged by making the talk a discussion rather than a monologue lecture. He even had us work out exercises from a music theory text book.

Afterwards most of the group went to dinner together. Six of us divided into two teams of 3 to do shared orders. Each squad ordered the same - a plate of cheese fries to start off and then this large meat/rice dish that was basically delicious taco filling. Dorion made an "executive decision" to douse our squadron's pile of food with hot sauce. No complaints.

It was a pleasure to meet jfw and dorion's group. The dinner was a nice mix of laughs and discussions of life goals. Seeing how jfw and dorion make good use of a time with smart individuals serves as motivation to build a similar group of friends here in CR and anywhere else I may go in the future.

  1. My flight on Monday left at 2:30pm. But I had to wake up at 3:45am to get in a cab to Santa Cruz at 4:00am so I could catch the 5:00am bus to San Jose. For future reference: tickets for the bus to San Jose can be purchased at mibus.cr []
  2. I had a coffee and he had a beer. []
  3. Where a complete understanding is the goal. []
  4. Where complexity is too great, and some parts must accepted as black boxes. []
  5. I also made a connection with someone who has available free lance work. I sent him my resume and am currently in conversation with a recruiter. []
  6. Just kidding, it's a blue wall. []
  7. Perhaps they are bunnies, but I'm not sure. []
  8. The Screw []