Skip to content

Instantly share code, notes, and snippets.

View ProfAvery's full-sized avatar

Kenytt Avery ProfAvery

  • California State University, Fullerton
  • Fullerton, CA
View GitHub Profile
@ProfAvery
ProfAvery / tuffix-android.md
Created September 25, 2018 22:26
Android on Tuffix

Running the Android emulator on Tuffix

Note: these instructions are for a native installation of Tuffix. Do not run the emulator inside a Tuffix Virtual Machine.

  1. Install the following packages:
    $ sudo apt update

$ sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager

@ProfAvery
ProfAvery / TCPServer.py
Created September 24, 2018 04:26
Rewritten TCPServer.py to better show parallels with UDPServer.py
# TCPServer.py
#
# Compare to Kurose & Ross 7th Ed. pp. 168-169 and 163-164
#
from socket import *
serverPort = 12000
serverSocket = socket(AF_INET, SOCK_STREAM)
serverSocket.bind(('', serverPort))
serverSocket.listen(1)
@ProfAvery
ProfAvery / labtainer-reset.sh
Created September 24, 2018 04:06
Try to recover from issues with Labtainers by removing all containers and re-installing.
#!/bin/sh
# In case of Labtainer catastrophe, try this.
# Remove all containers:
for container in $(docker ps --all --quiet)
do
docker rm --force $container
done
# Update Labtainers just in case:
@ProfAvery
ProfAvery / emailapp.py
Created September 24, 2018 04:00
Simple SMTP client for CPSC 471 demo
# Simple Email client
#
# Hacked-up version of https://github.com/arka-nitd/send-email-gui.git
#
# To run a debugging SMTP server:
#
# $ python3 -m smtpd -n -d -c DebuggingServer
#
from tkinter import *
@ProfAvery
ProfAvery / <class>.c
Last active May 9, 2018 22:22
GObject Template
// <class>.c
#include "<class>.h"
typedef struct _<Class>Private <Class>Private;
G_DEFINE_TYPE(<Class>, <class>, G_TYPE_OBJECT)
#define <CLASS>(object) \
(G_TYPE_INSTANCE_GET_CLASS((object), TYPE_<CLASS>, <Class>))
@ProfAvery
ProfAvery / random-web-projects.py
Created April 19, 2018 03:58
Generate random dumb ideas for CPSC 473 projects
#!/usr/bin/env python
# Use Morphological Analysis to generate random project ideas
# See <https://guides.co/g/creativity/60958> for more information
import random
NPROJECTS = 100
projects = {
@ProfAvery
ProfAvery / .htmlhintrc
Last active June 4, 2017 05:16
.htmlhintrc to eliminate "Doctype must be declared first" errors in .hbs files
{
"doctype-first": false
}
@ProfAvery
ProfAvery / .eslintrc.js
Created April 18, 2017 03:36
ESLint configuration file for ES6
module.exports = {
"env": {
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
@ProfAvery
ProfAvery / db.json
Created March 20, 2017 05:27
CPSC 473 - Spring 2017 - Homework 8
{
"coffeeorders": [
{
"coffee": "test",
"emailAddress": "test@bignerdranch.com",
"size": "tall",
"flavor": "",
"strength": "30",
"id": "test@bignerdranch.com"
}
@ProfAvery
ProfAvery / server.js.diff
Last active October 18, 2016 06:11
Updates to Chapter6/app/Amazeriffic/server.js for Express 4.x
diff --git a/Chapter6/app/Amazeriffic/server.js b/Chapter6/app/Amazeriffic/server.js
index fc11916..dceaa69 100644
--- a/Chapter6/app/Amazeriffic/server.js
+++ b/Chapter6/app/Amazeriffic/server.js
@@ -1,5 +1,6 @@
var express = require("express"),
http = require("http"),
+ bodyParser = require("body-parser"),
app = express(),
toDos = [