Skip to content

Instantly share code, notes, and snippets.

View geekodour's full-sized avatar
🐧
who are you and why are you here. tell me.

Hrishikesh Barman geekodour

🐧
who are you and why are you here. tell me.
View GitHub Profile
@jsomers
jsomers / websockets.md
Created September 27, 2018 12:50
Using websockets to easily build GUIs for Python programs

Using websockets to easily build GUIs for Python programs

I recently built a small agent-based model using Python and wanted to visualize the model in action. But as much as Python is an ideal tool for scientific computation (numpy, scipy, matplotlib), it's not as good for dynamic visualization (pygame?).

You know what's a very mature and flexible tool for drawing graphics? The DOM! For simple graphics you can use HTML and CSS; for more complicated stuff you can use Canvas, SVG, or WebGL. There are countless frameworks, libraries, and tutorials to help you draw exactly what you need. In my case, this was the animation I wanted:

high-priority

(Each row represents a "worker" in my model, and each rectangle represents a "task.")

@klange
klange / readme.md
Last active April 18, 2018 20:08
From Boot to HTTP: A Line-by-Line Analysis (ToaruOS-NIH)

Note: This article is a work-in-progress.

From Boot to HTTP: A Line-by-Line Analysis

A few years ago I did a talk about ToaruOS in which I traced through the system and explained how typing in a terminal worked at each layer. ToaruOS has changed a lot since then, and the slides from that talk have become outdated. Additionally, the level of detail to which a 40-minute talk can delve is limited, but an article can go much deeper. With the recent development of ToaruOS-NIH, a completely in-house distribution of ToaruOS with all code under the NCSA license, I figured it was time to approach that challenge again.

Background

This article is a followup to my talk at Yelp, which itself was inspired by an article that posed the following question:

@TeMPOraL
TeMPOraL / init-web-server.el
Created April 3, 2018 21:45
Serve files over HTTP directly from Emacs.
;;;; A webserver in Emacs, because why not.
;;;; Basically a fast replacement for serve_this in Fish.
(use-package web-server
:config
(defvar my/file-server nil "Is the file server running? Holds an instance if so.")
(defun my/ws-start (handlers port &optional log-buffer &rest network-args)
@jdarpinian
jdarpinian / executable.c
Last active May 30, 2024 19:42
Add one line to your C/C++ source to make it executable.
///$(which true);FLAGS="-g -Wall -Wextra --std=c17 -O1 -fsanitize=address,undefined";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $FLAGS "$THIS_FILE" -o "$OUT_FILE" || exit $?;exec bash -c "exec -a \"$0\" \"$OUT_FILE\" $([ $# -eq 0 ] || printf ' "%s"' "$@")"
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Setting up netboot.xyz with an EdgeRouter

This document covers how to setup netboot.xyz, a service that provides iPXE-based installation and live boot of a bunch of operating systems, on a Ubiquiti EdgeRouter.

Assumptions

I've made a few assumptions throughout this document that will probably be different for your setup:

@acolyer
acolyer / jessfraz.md
Created November 19, 2017 13:39
Containers, operating systems and other fun things from The Morning Paper
@joyeusenoelle
joyeusenoelle / Mastodon.md
Last active January 23, 2024 02:43
An increasingly less-brief introduction to Mastodon
@Aliireeza
Aliireeza / lwnfs.c
Created September 14, 2017 04:52 — forked from prashants/lwnfs.c
Updated lwnfs
/*
* Demonstrate a trivial filesystem using libfs.
*
* Copyright 2002, 2003 Jonathan Corbet <corbet@lwn.net>
* This file may be redistributed under the terms of the GNU GPL.
*
* Chances are that this code will crash your system, delete your
* nethack high scores, and set your disk drives on fire. You have
* been warned.
*/
@przemoc
przemoc / tc-delaydnsreqs.sh
Last active April 9, 2021 13:51
Traffic control - Make DNS requests delayed and low priority on Linux
#!/bin/sh
# SPDX-License-Identifier: MIT
## Copyright (C) 2017 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Traffic control - Make DNS requests delayed and low priority on Linux.