Blog 2020/5/7
<- previous | index | next ->
EDIT 2024/12/1: I updated a few of these commands to work with qemu 9.x.
| import Control.Monad | |
| import Data.Char | |
| import System.IO | |
| import Network | |
| import Data.Time.LocalTime | |
| data RequestType = GET | POST deriving (Show) | |
| data Request = Request { rtype :: RequestType, path :: String, options :: [(String,String)] } | |
| data Response = Response { version :: String, statuscode :: Int } |
| from django.utils import simplejson | |
| class JSONMiddleware(object): | |
| def process_request(self, request): | |
| request.JSON = None | |
| if request.is_ajax(): | |
| if request.META.get('CONTENT_TYPE').count('application/json'): | |
| try: | |
| request.JSON = simplejson.loads(request.body) | |
| except simplejson.JSONDecodeError: |
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>This is the title of the webpage!</title> | |
| </head> | |
| <body> | |
| <p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p> | |
| </body> | |
| </html> |
| # If the server has ffmpeg: | |
| ## For the server: | |
| ffmpeg -f fbdev -i /dev/fb0 -f avi pipe:1 | nc -l -p 1234 | |
| ## For the viewer: | |
| nc 127.0.0.1 1234 | ffplay -i pipe:0 | |
| # If the server doesn't have ffmpeg: | |
| ## For the server: | |
| sudo cat /dev/fb0 | nc -l -p 1234 | |
| ## For the viewer (replace 1920x1080 with the server's resolution): |
Blog 2020/5/7
<- previous | index | next ->
EDIT 2024/12/1: I updated a few of these commands to work with qemu 9.x.
NixOS provides good support for the Xfce desktop environment out-of-the-box, but the defaults are minimal. The files in this Gist provide a more complete experience, including a suite of basic software and plugins as well as an optional home-manager configuration for theming.
The key additions to the default Xfce provided by NixOS are: