Quick tutorial on how to play sound from your computer to a Sonos device
192.168.1.111 IP of your Sonos Device
192.168.1.128 IP of your computer
| Okay so here's the setup: | |
| [-] The primary server API is exposed via Flask (Python) and all static files, including all html, css, js is served by nginx. | |
| [-] Python is exposing an API at url http://domain.com/api/download/<file_id>, where file_id is a database id for the file that we're interested in downloading. | |
| 1. User wants to download a file, so we spawn a new window with the url '/api/download/<file_id>' | |
| 2. Nginx intercepts the request, sees that it starts with /api/, and then forwards the request to Flask, which is being served on port 5000. | |
| 3. Flask routes the request to its download method, retrieves the pertinent data from the file_id, and constructs additional header settings to make nginx happy and to force the browser to see the file stream as a download request instead of the browser just trying to open the file in a new window. Flask then returns the modified header stream to nginx | |
| 4. Nginx is finally ready to do some work. While parsing the headers for the incoming request, it encounters "X |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| upstream plex-upstream { | |
| # change plex-server.example.com:32400 to the hostname:port of your plex server. | |
| # this can be "localhost:32400", for instance, if Plex is running on the same server as nginx. | |
| server plex-server.example.com:32400; | |
| } | |
| server { | |
| listen 80; | |
| # server names for this server. |
| #!/bin/bash | |
| # Favicon and Apple Touch Icon Generator | |
| # | |
| # This bash script takes an image as a parameter, and uses ImageMagick to convert it to several | |
| # other formats used on modern websites. The following copies are generated: | |
| # | |
| # * apple-touch-icon-114x114-precomposed.png | |
| # * apple-touch-icon-57x57-precomposed.png | |
| # * apple-touch-icon-72x72-precomposed.png |
| # Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect | |
| # Forked from jeroen@massar.ch - http://jeroen.massar.ch | |
| # Preparation: you need to install and configure fcgiwrap and set it to listen at fcgiwrap.socket. | |
| # An example tutorial: https://www.howtoforge.com/serving-cgi-scripts-with-nginx-on-centos-6.0-p2 | |
| # A useful hint: add -f as a parameter to fcgiwrap to redirect the cgi errors to your nginx error log. | |
| server { | |
| listen 80; | |
| server_name git.example.com; | |
| # See Remove default Apps from Windows 10 https://thomas.vanhoutte.be/miniblog/delete-windows-10-apps/ | |
| # See Debloat Windows 10 https://github.com/W4RH4WK/Debloat-Windows-10 | |
| # Command line to list all packages: Get-AppxPackage -AllUsers | Select Name, PackageFullName | |
| Get-AppxPackage Microsoft.Windows.ParentalControls | Remove-AppxPackage | |
| Get-AppxPackage Windows.ContactSupport | Remove-AppxPackage | |
| Get-AppxPackage Microsoft.Xbox* | Remove-AppxPackage | |
| Get-AppxPackage microsoft.windowscommunicationsapps | Remove-AppxPackage # Mail and Calendar | |
| #Get-AppxPackage Microsoft.Windows.Photos | Remove-AppxPackage | |
| Get-AppxPackage Microsoft.WindowsCamera | Remove-AppxPackage |
| # Download latest archlinux bootstrap package, see https://www.archlinux.org/download/ | |
| wget 'ftp://ftp.nluug.nl/pub/os/Linux/distr/archlinux/iso/latest/archlinux-bootstrap-*-x86_64.tar.gz' | |
| # Make sure you'll have enough entropy for pacman-key later. | |
| apt-get install haveged | |
| # Install the arch bootstrap image in a tmpfs. | |
| mount -t tmpfs none /mnt | |
| cd /mnt | |
| tar xvf ~/archlinux-bootstrap-*-x86_64.tar.gz --strip-components=1 |
| #!/usr/bin/env python3 | |
| """ | |
| License: MIT License | |
| Copyright (c) 2023 Miel Donkers | |
| Very simple HTTP server in python for logging requests | |
| Usage:: | |
| ./server.py [<port>] | |
| """ | |
| from http.server import BaseHTTPRequestHandler, HTTPServer |
To play webcam using mplayer, we will need to use TV input but with v4l2 as driver,
$ mplayer tv:// -tv driver=v4l2
then it just plays with default values. We can add options to tweak such as width, height, output format, frame rate, select device…Each option is separated by a colon. For example, play webcam from /dev/video0, with widthxheight=1280×720, framerate=30, and output format is YUV (YUY2),