My Guide to Killing a Broken Pipe

When I start a server using node, I sometimes get this error: “Error: listen EADDRINUSE :::8092”

To be able to still use the 8092 port, or any other number, without changing my code, I need to kill or stop the process on that specific port, and restart the server:

Type in terminal $ ps -ef | grep node

A list appears. For each line, the first number listed is the process ID

Then type in terminal $kill # (# is the ID number)

Now type in $ node server.js

Artists in the Archive – Excavator

I have a couple ideas in mind. I couldn’t get the code to work but I’ll have more time to attend to it this coming week.

Subject Headings

I tried to run the code just looking at what’s returned in the SubjectHeadings.xml file. I might want to create a project that looks at the first time a subject heading was created, and the first object entered into the collection under that subject heading. Maybe I could bring in news headlines from that same time period. My question is – How does real life get into the collections?

This seems like a big project. I’m not sure how it would turn out! I’d have to interview a librarian about Subject Headings to get a better sense of how they work.

I was inspired by this LOC page, which lists all Subject Headings. The filter on the left seems to suggest LOC knows the general date for some, because I can look at only those made in the 2010s, for example.

While I did inspect the contents of .xml Subject Heading files, I am not sure whether I am seeing records of Subject Headings, or records of objects in the collection? I’m pretty sure it’s the first thing, but it’s not clear.

Either way, I want to know if LOC stores the year Subject Headings are created, and if not, how I might look for the earliest item in the collection for each subject heading.

I struggled to get the code to work, see my error below. It must be something fairly simple that’s not connected in my code.

People’s Biographies

I’m also curious how many people are in the LOC’s collections, but not in Wikipedia? It might be interesting to compare the two and see if there is any difference. I could limit it to a certain period of time, occupation, or gender. At the end, I might share the list with groups who get together to add entries to Wikipedia.

I’d need to keep in mind that this idea is more about critiquing Wikipedia than the LOC.

I could flip it, and see how many people on Wikipedia are not in the LOC.

Examining the LOC with a Critical Eye

Along the lines of the last idea, I find it hard to critique the LOC’s holdings without comparing it to something outside it, which means bringing together two data sets. I’m interested in trying it but want to talk through what this looks like.

My Guide to Javascript Objects with Functions in Them

In the open source code I’m using, there are lots of functions declared like this:

onNewParticipant: function(numberOfViewers) {
document.title = ‘Viewers: ‘ + numberOfViewers;
},

In larger projects where you want to scope as much as possible to prevent overusing variable and function names, you want to create objects that have functions inside of them.

People on StackOverflow informally explain here that writing loose functions willy nilly is “90s”.

More formally, Mozilla explains the many ways you can write objects and functions here. They say that a method is a function associated with an object. Said another way, methods are properties of objects. These special types of functions are defined the same ways as normal functions, except they have to be assigned as the property of an object.

Below this example starts with the object’s name, the method name I want, and the function name I use for the method name.

objectName.methodname = functionName;

var myObj = {
  myMethod: function(params) {
    // ...do something
  }

  // OR THIS WORKS TOO

  myOtherMethod(params) {
    // ...do something else
  }
};

You can then call the method in the context of the object as follows:

object.methodname(params);

My Guide to Adding Node.JS to My Project

My Challenge

To remind myself for all eternity how to add node.js to a project that will live remotely on a server, and not able to access the version of node.js that’s on my local computer.

What is node.js?

Node allows JavaScript, originally a client-side programming language processed in the browser, to be used as a server-side language.

Why do I need it for my project?

I want to run a little server to handle visitors’ requests to my website, and I want to write it in Javascript. Node.js will allow my javascript server to perform this “server-side” functionality.

I also need node.js inside my local project because it’s going to live on a remote server, without access to my globally installed node.js on my computer.

How do I add Node.js to a local project?

I’ll use npm (or “node packaged models”) as a tool to install node.js into my local project. npm can install the node.js packages I need in local or global mode. In local mode it will install packages in a node_modules folder in my project’s parent working directory.

Use this npm webpage to find the latest commands.

But generally all I need to do is inside my project’s working directory in terminal, use $ npm install node.js ($ npm install <package_name>).

One extra step

Then put the created package.json file and node_modules folder onto my remote server, so that my html and javascript files have access to them. I do this by opening up the application Fetch, and dropping in the files.

How do I check for updates?

Check NPM’s webpage here for the latest commands. Generally, first check that I have node and npm installed. To check if you have Node.js installed, run this command in your terminal.

Note: This command checks whether node.js exists globally on your machine, not whether a copy is saved in your project folder that will exist on a remote server. I need both.

node -v

To confirm that you have npm installed you can run this command in your terminal:

npm -v

npm is a separate project and updates more regularly, so update your npm. To update your npm, type this into your terminal:

npm install npm@latest -g

How do I make sure I’m using a LTS version of Node.js ?

Not sure yet.

Should I use a Node.js version manager?

Probably?N

Is there a way to switch between versions of node and npm?

Yes

How do I switch my project over to run forever?

Full instructions here.

Type $ npm install forever -g

Then type forever start app.js

My Guide to How Live Streaming Media in the Browser Will Work in My Project

The Challenge

With this guide, I am to explain to myself the higher level flow of how live streaming media, or audio in my case, is being sent by my project’s website from a speaker to a listener.

What is Live Streaming Media?

Live Streaming Media looks like …

  • Watching the Kavanaugh court proceedings live on the New York Times
  • Listening to a live Carnegie Hall concert on the radio station’s WQXR’s website
  • or watching a live Youtube feed of cats playing or sleeping…
  • [I did all of these things recently]

You are enjoying live streaming media in the browser. The technology that allows all of this is WebRTC… at least I think. Perhaps in some cases they aren’t using WebRTC?

What is WebRTC?

Coming. More here. https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Signaling_and_video_calling

And here. https://www.html5rocks.com/en/tutorials/webrtc/basics/

And here. https://codelabs.developers.google.com/codelabs/webrtc-web/#0

What kind of server do I need to use WebRTC?

From what I can tell, I need a javascript file (called server.js) that describes the behavior I want my remote server to carry out. It seems I’ll be using the word “server” a lot, but sometimes I’ll be referring to my server.js file, and other times to my remote server that is hosting all my files.

Based on further research, it looks like people tend to use the words “Signaling Server” to describe the type of behavior I want from my javascript file (?).

A signaling server takes care of a lot of things when one user “calls” another, asking for a live media stream. (The live media stream can be video, audio or both.)

What does a Signaling Server do?

A Signaling Server fulfills an essential function that the WebRTC API does not handle: getting two users connected in the first place.

This type of server lets two users transfer initial introductory messages before they have access to a WebRTC peer connection. This type of communication is called signaling.

Do I have to build it myself?

Yes. The people who wrote the WebRTC APIs (there are three) decided to not handle initial connections, allowing others to set this part up exactly as you please.

Do I really have to build it myself?

Not literally. Actually, most examples I’ve found use the socket.io library to handle signaling for them. As will I!

What are different options for setting up my Signaling Server?

@Mauz, who I am forking super helpful code from his Web RTC Experiments github repos, has a helpful page about all of this.

He suggests using either Socket.io/WebSockets (what I’ll use, like him), XMPP/SIP, PHP/MySQL, WebSync/SignalR, PeerServer/SignalMaster or other gateway.

If people want, you can bypass socket.io and use your own signaling gateway/implementation.

What kind of messages does my Signaling Server need to send?

The bread and butter: the list below is taken from an article by HTML5Rocks.

  • Session messages to begin or end communication.
  • Error messages.
  • Media settings, such as video or audio, the formats to encode media with, bandwidth.
  • Key data for secure connections (how does this work?).
  • Network data, such as a host’s IP address and port as seen by the outside world (what does this mean?)

Once User 1 calls another User, the server needs to pass the offer from User 1, pass the answer from User 2, pass the ICE candidates (more soon) between them, and set up the WebRTC connection.

Below is a nice infographic from Tutorials Point.

Building the Server
A diagram showing communication patterns between User 1, a Server and User 2. Borrowed from Tutorials Point website.

What is RTCPeerConnection?

Not sure yet, do I need to know?

What are STUN and TURN Servers?

Not sure yet, but I might need to know… these servers apparently help users who can’t connect by the most direct route possible, and instead need to traverse NAT gateways and firewalls because direct connection fails. Are these reasons why my friends with AT&T couldn’t connect without local wifi outdoors in Washington Square Park?

It looks like the WebRTC APIs use STUN servers to get the IP address of your computer (why?) and TURN servers to function as relay servers in case peer-to-peer servers fail.

How to Actually Build X

Steps I Need to Take

I started a guide for myself here.

References and More Reading

X Y Z

Future Topics

X Y Z

My Guide to Securing My Project with HTTPS

The Challenge

My goal is to get my code accessible by anyone on the internet, yet prevent anyone else from knowing who visited my site, or seeing any data in transit from them to my server. I hope I can also prevent my visitors’ data from being saved on my server, or prevent my own server, with possibly their data on it, from getting hacked.

Will HTTPS get me there?

Ostensibly, yes. From my understanding, HTTPS is the first major step to prevent bad actors from eavesdropping, tampering, and message forgery on my site.

To be honest, I don’t yet how “safe” HTTPs really is. Can I, the owner of the server, see who is visiting my HTTPS site? How can I not do this? How can I prevent others from hacking my server?

Along these lines, I’ve read that people can modify HTTPS’ security parameters to their liking, which seems to defeat the purpose of consistent and safe browsing on the internet. Maybe it’s not as much modification as it first sounds like. But I need to find out what kinds of security parameters I will add to my site.

Generally, though, HTTPS is the accepted standard. Even Google Chrome wants me to know which sites are secure or not. Interestingly, my WordPress editing page is not secure.

So, what is HTTP?

HTTP is a protocol that sends data between a visitor’s browser and a website. (HTTPS stands for Hyper Text Transfer Protocol). HTTP fetches resources to show on your browser when you visit sites.

And what is HTTPS?

Adding an S on the end signifies the protocol is secure (Hyper Text Transfer Protocol Secure).

HTTPS is secure because it uses additional protocols, most commonly TLS (Transfer Layer Security), to apply encryption to the client’s data.

What is TLS?

TLS offers authentication, encryption, and integrity. It confirms the identity of the server and user. It encrypts any data passed back and forth. And it ensures the data is not lost along the way.

How does HTTPS/TLS check for identity?

HTTPS/TLS helps your browser check a website’s server’s digital certificate to see if it was issued by a trusted organization (important because otherwise anyone can create a certificate claiming to be whatever website they want).

The certificate is used to confirm identity. Specifically, a digital certificate is a data file that links a private cryptographic key to an organization.

You’re Not Done

To modify your server’s configuration of TLS, Mozilla recommends using newest cryptographic tools available for the browsers you want to connect to your site. There are basically three options, each allowing you to work with older and older browsers if needed.

Once you use a configurator tool like Mozilla’s to find a TLS set up that’s best for your visitors, it looks like you enter the provided TLS text inside an appropriate file on your server and restart the server. You need to review the new TLS text in your file to add correct domain names.

How to Actually Build a Site with HTTPS

The ‘Moving to HTTPS Guide‘ is a good overview & how-to for switching over. … Or at least the Mozilla Foundation recommends it, and I trust Mozilla!

You can find the actual configuration options and associated code at Mozilla’s configurator tool here.

I’m unclear if using CertBot’s command-line level application to get a HTTPS key and certificate removes the need to use Mozilla’s TLS configurator tool above? Or do I also need the TLS protocol text provided by Mozilla?

Steps I Need to Take

I started a guide for myself here.

References and More Reading

Mozilla Foundation’s webpages on TLS, HTTP (or how a lot of the internet works, and specifically HTTPS.

Future Topics

Cookies – I don’t need cookies since my visitors won’t be logging in and want anything saved for later (requires cookies to remember state information for the stateless HTTP protocol), and I don’t want to save or analyze my visitors behavior.

Web Analytics – Do I want to know how many people visit the site? Can I accomplish this without google analytics?

Temporary Expert – Topic #2 Blog Links and Updates

As for updates, you can read about…

  • How I’ve put all of my blog posts in online documents here. I find it a lot easier to manage this than my blog. Plus I can use the doc’s comments feature to write down next steps or unanswered questions.
  • Who I’ve asked for informational interviews.
  • My very full are.na mood board for content research.
  • My empty are.na mood board for materials research. I will work on this. But at least I have these two separate tracks set up.
  • My research notes. I reread Lakoff’s Metaphors We Live By and got myself oriented within the IPCC report.

I still need to do these things, but really want to…

  • Set my milestones.
  • Watch Donella Meadows video.
  • Make a crazy sketch.
  • Audio record a two-minute interview with a working participant / non-climate change expert and write two sentences on how what they said could affect/impact your topic, and to post both interview and your response.
  • Did I already did this part here, or this is something different?: State your intent, craft a question.

You can also click around my progress using this link or by clicking on the image below.

Temporary Expert – Topic #2 Intentions and Goals

The topic you choose should:

  • Identify a problem, to which your design is a relevant response (the problem can be grounded in /focused on a subject that is historical, political, social, physical, biological, climatological, economic, etc). From this problematic topic you will design a project that can contribute to change, or offer a participating public critical consideration and new insights.

Climate change is a problem that is tied to other major human concerns, such as racism, poverty, health, and decent work. I was inspired by the United Nations’ 17 Sustainable Development Goals and their climate change panel’s recent report about terrible climate change by 2040 unless we change all market economics at an unprecedented scale in the next ten years. The panel seems to be saying in their report that mitigating climate change can positively influence other Sustainable Development Goals. I found this framework to be helpful for some reason – it makes stopping climate change seem more feasible because people are going to be motivated by at least one of those 17 goals.

  • Start with a question (hypothesis) and design ways to test it

In what ways might addressing climate change from a lens of the UN’s sustainable development goals help people tackle huge problems in the next ten years?

  • Require a consideration of media, audience, and outcomes (theory of change)

By using research in my creative process, creating media and/or physical forms for a specific audience to interact with…

I will accomplish a set of outcomes, or a theory of change.  For example, an outcome might be I might hope to get people to engage with climate change longer than they do on a typical day. A theory of change might be that by engaging with my crazy ITP project, people are more likely to change how they think about climate change.

  • Engage actively with a public (participation, feedback, co-creation)

A public will engage with my piece some how, some way. My research and testing will lead me there!

 

You are required to address each of these points on your blog:

  • Set your intentions (what are you setting out to do?)

To see if I can make stopping climate change seem approachable to people.

To see if I can give people more ways to be motivated to stop climate change.

  • Set your goals (personal learning objectives)

I want to learn more about the UN’s sustainable development goals, and how the UN sees climate change interlinked with those.

I want to interview someone from the I.P.C.C. panel, or a similar group, about the IPCC’s report that just came out.

I want to research mediums and form factors that allow looking at one thing from different angles, revealing different layers depending on the tool you use, reshaping the same form.

Maybe my research will lead me to different approaches to mediums and form factors, too.

  • Hypothesis: what are you asking?

Can a research-based interactive project help people personally engage with climate change?

  • Method: How will you test it?

I could do an artistic-based baseline study, and ask people in different locations how often they think about climate change. What they do or don’t do about it.

And then ask people what they think after engaging with my piece, and/or a week later, too.

  • Epistemologies: what ‘ways of knowing” are you employing? How experimental and open can you be in your research of material and form?

I’d definitely like to be more experimental with the material and form of my Topic #2 than my Topic #1. I can build in milestones to have researched and tried different materials and forms at the same time I am researching about my topic.

  • Results: what goals will you have for your ideation

That people can engage and participate my project. That I prototype something that could be done at scale.

Maybe it’s something they can take and share with other people?

  • Contexts: where do you see this work existing?

Maybe in the mail or drop off points.

Maybe in a public space where a lot of trash is thrown out.

  • Public(s): who will you make this work for/with?

I need to think about this more. I could think of moments in the day when someone might be participating in climate change and poverty, but doesn’t know it. My project could intersect at this point.

  • Documentation: use the suggested template (on the student blog page) for tracking your work threads,  or design your own.

Social VR – Drawing Game

We each created a “drawing game” with the Oculus Virtual Reality headset, using the Steam VR Input package – a recent update that makes it easier for developers to tailor specific events upon player using different controller button inputs.

In the game, the player can pick a paint color and then paint by pressing a button on one of their controllers. In the code, pressing a button is linked to a script’s specific draw() function which instantiates many prefabs of a sphere, creating an illusion of painting.

Here’s a small piece of documentation. Code is on Github here.