prep xubuntu image with https://github.com/fijimunkii/umpc-ubuntu
add the following to /usr/share/X11/xorg.conf.d/20-intel.conf
# fix screen flickering
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "sna"
#!/bin/sh | |
# delete github actions runs for disabled workflows | |
repo="$1" | |
for workflow_id in $(gh api /repos/$repo/actions/workflows | jq -r '.workflows[] | select(.state == "disabled_manually") | .id'); do | |
for run_id in $(gh api /repos/$repo/actions/workflows/$workflow_id/runs | jq -r '.workflow_runs[].id'); do | |
gh api /repos/$repo/actions/runs/$run_id -X DELETE | |
sleep 1 # to avoid rate limit | |
done | |
done |
prep xubuntu image with https://github.com/fijimunkii/umpc-ubuntu
add the following to /usr/share/X11/xorg.conf.d/20-intel.conf
# fix screen flickering
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "sna"
#include <string> // std::string | |
#include <string.h> // string | |
#include <sstream> // std::stringstream | |
std::ostringstream stream; | |
stream << remoteCharacteristic->readUInt16(); | |
std::string strValue = stream.str(); |
// grab page - extract text - send post request back to same page | |
const crypto = require('crypto'); | |
const http = require('http'); | |
const querystring = require('querystring'); | |
const host = 'someapp.host'; | |
const port = 38008; | |
const path = '/'; | |
const options = { host, port, path }; | |
let Cookie; |
Docker for Mac lets you run any Linux executable in an isolated process on Mac. A graphical app is just another process, that needs access to the X11 socket of the system, or an X11 server. You can run X11 applications on a Mac using an open source project called Xquartz. The steps to expose XQuartz to a Linux process running in Docker are simple:
const https = require('https'); | |
const urls = ['https://postman-echo.com/get','https://httpbin.org/anything']; | |
Promise.all(urls.map(url => new Promise((resolve,reject) => { | |
https.get(url, r => { | |
const data = []; | |
r.on('data', d => data.push(d)); | |
r.on('end', () => resolve(Buffer.concat(data).toString())); | |
}).on('error',console.log); | |
}))) | |
.then(d => console.log(d.join('')), console.log); |
const data = JSON.stringify({a:1,b:2,c:3},null,2); | |
const GIST_ID = 'axdl090asdfojal3rwaf'; | |
const GITHUB_TOKEN = process.env.GITHUB_TOKEN; | |
return new Promise((resolve, reject) => { | |
const postData = JSON.stringify({files:{"ua.json":{content:data}}}); | |
const options = { | |
hostname: 'api.github.com', | |
port: 443, | |
path: `/gists/${GIST_ID}`, |
[ | |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36", | |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36", | |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:90.0) Gecko/20100101 Firefox/90.0", | |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36", | |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36", | |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36", | |
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36", | |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15", | |
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KH |
const app = require('http').createServer((req, res) => { res.end((new Date()).toISOString()); }) | |
const listener = require('net').createServer(connection => { | |
connection.once('data', buffer => { | |
connection.pause(); | |
console.log(buffer.toString('utf8')); | |
app.emit('connection', connection); | |
connection.emit('data', buffer); | |
connection.resume(); | |
}); |