This script makes use of the Numpad to control media players and volume on your system.
- Install AutoHotkey
- Right-click
.ahk
script Compile Script
- Start executable
This script makes use of the Numpad to control media players and volume on your system.
.ahk
scriptCompile Script
Pattern file: /etc/logstash/patterns/nginx
Logstash shipper: /etc/logstash/conf.d/shipper.conf
Nginx http log module: http://nginx.org/en/docs/http/ngx_http_log_module.html
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: TeamCity Build Agent | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start build agent daemon at boot time | |
# Description: Enable service provided by daemon. | |
### END INIT INFO |
const charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%&()/\\+<>'; | |
const randomCharacter = charset[Math.floor(Math.random() * charset.length)]; | |
outputContext.fillStyle = `rgb(${r},${g},${b})`; | |
outputContext.fillText(randomCharacter, x, y); |
for (let y = 0; y < height; y += fontHeight) { | |
for (let x = 0; x < width; x += fontWidth) { | |
const frameSection = hiddenContext.getImageData(x, y, fontWidth, fontHeight); | |
const { r, g, b } = getAverageRGB(frameSection); | |
outputContext.fillStyle = `rgb(${r},${g},${b})`; | |
outputContext.fillText('@', x, y); | |
} | |
} |
const getAverageRGB = (frame) => { | |
const length = frame.data.length / 4; | |
let r = 0; | |
let g = 0; | |
let b = 0; | |
for (let i = 0; i < length; i++) { | |
r += frame.data[i * 4 + 0]; | |
g += frame.data[i * 4 + 1]; |
const fontHeight = 12; | |
if (width && height) { | |
// canvas setup removed for brevity | |
hiddenContext.drawImage(video, 0, 0, width, height); | |
outputContext.textBaseline = 'top'; | |
outputContext.font = `${fontHeight}px Consolas`; | |
const text = outputContext.measureText('@'); |
const video = document.querySelector('#camera-stream'); | |
const hiddenCanvas = document.querySelector('#hidden-canvas'); | |
const outputCanvas = document.querySelector('#output-canvas'); | |
const hiddenContext = hiddenCanvas.getContext('2d'); | |
const outputContext = outputCanvas.getContext('2d'); | |
const processFrame = () => { | |
const { videoWidth: width, videoHeight: height } = video; | |
if (width && height) { |
const constraints = { | |
video: { | |
width: 512, | |
height: 512, | |
}, | |
}; | |
navigator.getUserMedia(constraints, function (stream) { | |
video.srcObject = stream; | |
video.play(); |