Advertisement
Advertisement
How to Create an NPM Package
This is a quick guide to creating a Node.js package for npm. Full package.json documentation available from npmjs.com.
Socket.io Basics
Intro
This is the very basics of using Socket.io.
Two other articles that may be relevant:
Installation
You need socket.io
at a minimum. The others are optional.
Websocket Basics with JavaScript
Intro
To implement WebSockets, you need a client and a server. Ws.js is a library for Node.js that lets you create servers. For the client side, we'll use the native WebSocket object in the browser.
Server example
You need to install the ws
package with npm
first:
Express.js Basics
Intro
This is a quick overview of a very simple express.js app.
Installation
npm install --save express ejs
The ejs
package is for simple HTML templates.
Use auto-generated project template
Read more at https://expressjs.com/en/starter/generator.html.
2-minute Intro to p5.js
Drunk Kaleidoscope
Color Tunnel (p5.js)
Install Lutris Gaming on Debian
This will guide through the steps to install Lutris for gaming on Debian Linux. I followed these steps using Debian 11 to play StarCraft 2 and other games.
Install VirtualBox Guest Additions in Debian
When installing Debian or other Linux distributions as a guest in VirtualBox, you should install the guest additions for better integration. This allows shared clipboard, screen resizing, and more.
Python Packaging Tutorial
This tutorial will cover setuptools
and how to package libraries and applications
for pip
, https://pypi.org, and distribution to others.
Which Linux Distro do I use?
Build Node.js from Source
Let's walk through the process of building Node.js from source.
I'll be demonstrating this on Debian 10 Buster. The current version of Node.js in the Debian repository is v10.24.
I'm going to download the newest version 15 and build it. When I'm done, I'll have the latest version node
and npm
executables installed on my system.
Change GRUB Bootloader colors, image & timeout
Let's look at how to customize the GRUB bootloader background image, colors, and timeout. These were all done and tested in Debian 10.8 Buster.
Change Console Font Size in Debian
Introduction
If you do a base install of Debian with no graphical desktop, you'll only have the console terminal. You can change this font to make it larger.
dpkg-reconfigure
Use the dpkg-reconfigure
tool to update the console.
sudo dpkg-reconfigure console-setup
When you run it, it will ask you
Install Linux in VirtualBox
Learn to install Debian in a virtual machine with VirtualBox.
Why bpython is Awesome
Convert Markdown to HTML with Python
Python-Markdown is a package that converts content in Markdown format to HTML. In this example, we will look at how to convert Markdown to HTML and automatically generate a table-of-contents. We will also look at using the command-line tool to convert content. We will also cover how to use fenced code blocks and
Process Form Inputs with PHP
An essential task for most web applications is the ability to take user input. We will look at several common tasks in PHP like:
- How to access GET query parameters from the URL
- How to use forms to submit GET and POST values
- Understanding the security implications of accepting user data and how to protect yourself
- Creating a form to submit GET or POST requests
- Handling checkbox and multi-select fields
- Handing file uploads
HTTP Basic Authentication with PHP
There many ways of performing authentication over the web. You can use a token and pass it as a special header. This is commonly done with API tokens. You can also use a cookie to store a session token. This is common for webservers that have a database session in the backend.
One simple method is to use HTTP Basic Access Authentication. This involves adding a header that contains your username and password. The proper format for the header is:
Authorization: Basic XXXXXX
Where XXXXXX
is your credentials in the form of username:password
with base64 encoding.
PHP automatically decodes and splits the username and password into special named constants:
PHP_AUTH_USER
with the username as a plain-text stringPHP_AUTH_PW
with the password as a plain-text string
We will look at how to restrict a page using HTTP basic authentication in PHP.
Advertisement
Advertisement