This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import blessed | |
import os, glob | |
import math | |
# TODO: | |
# - fast in-memory string compression of output | |
# - run at ~some fps, index into frames by rtt /2 use terminal query | |
import asyncio, telnetlib3 | |
class MyTelnetServer(telnetlib3.TelnetServer): | |
def on_naws(self, rows, cols): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### note: I wouldn't recommend using the python library of libchafa, at least, at the time of authoriship, | |
### it segfaulted every ~100 calls. I would suggest to use subprocess.Popen family of calls to the 'chafa' | |
### CLI utility, instead. | |
# TODO: calibration of FONT_RATIO: | |
import os | |
# ".. make a perfect circle ..." | |
import blessed | |
from chafa import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ChessPiece { | |
String kind; | |
Position pos; | |
ChessPiece next; | |
ChessPiece(String kind, int xpos, int ypos) | |
{ | |
this.kind = kind; | |
this.pos = new Position(xpos, ypos); | |
next = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Jeff Quast | |
# 11/10/05 | |
# | |
# Program Purpose: | |
# | |
# Scan for machines on domain, and build a database | |
# of machines. Populate database with WMI data retrieved | |
# from host through parallel scanning. Dump successful | |
# retrievals to comma-delimited file for 3rd party import. | |
domain = 'zzz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ksh | |
# my weather program, using netcat as a telnet client. | |
set -e | |
hostport='rainmaker.wunderground.com 23' | |
if [ -z "$1" ]; then | |
read state?"2-letter U.S. State abbreviation? " | |
echo "Fetching airport codes for US State: '"${state}"'." | |
(echo; echo; echo 1; echo 3; echo $state; echo X; ) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# inspired by https://www.theverge.com/2020/5/18/21262316/doordash-pizza-profits-venture-capital-the-margins-ranjan-roy | |
import math | |
starting_cash = 16 | |
cost_to_order = 16 | |
doordash_pays = 24 | |
cost_of_pizza = 4 | |
cash = starting_cash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/ksh | |
# contact@jeffquast.com | |
# | |
# move a zone by replicating a zfs container to a remote host, | |
# exporting and importing the zone configuration and attaching the container, | |
# then destroying the previous zone after the destination zone is verified. | |
# | |
# default containers are 'tank' or 'rootpool' | |
# | |
# references: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
/* modify speed if it runs too fast */ | |
#define SPEED 20 | |
#define FLAKES 128 | |
#define FLIES 15 | |
#define COLUMNS 80 | |
#define ROWS 25 | |
#define CENTER_X 40 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// -rwxr--r-- 0 jeremy users 1982 Feb 12 2003 ansi-codes.php | |
// -rwxr--r-- 0 jeremy users 1166 Feb 13 2003 ansi.php | |
function ansi_decode($ansicodes){ | |
$fontline="<font "; | |
$ansi=explode(";",$ansicodes[0]); | |
$attrib=0; | |
for($code=0;$code<count($ansi);$code++){ | |
switch ($ansi[$code]) { | |
case 0: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env php | |
# $Id: pong.phps,v 1.2 2006/01/28 14:45:22 dingo Exp $ | |
# imported via lynx -dump 2006 jdq, orig by theedge@efnet | |
<?php | |
/* | |
Jeremy Brenner 2005 | |
*/ | |
ncurses_init(); | |
ncurses_timeout(0); | |
ncurses_cbreak(); |
NewerOlder