Skip to content

Instantly share code, notes, and snippets.

@baleyko
baleyko / socat_server.sh
Created March 8, 2018 10:44 — forked from CMCDragonkai/socat_server.sh
Socat: Simple HTTP Server
socat \
-v -d -d \
TCP-LISTEN:1234,crlf,reuseaddr,fork \
SYSTEM:"
echo HTTP/1.1 200 OK;
echo Content-Type\: text/plain;
echo;
echo \"Server: \$SOCAT_SOCKADDR:\$SOCAT_SOCKPORT\";
echo \"Client: \$SOCAT_PEERADDR:\$SOCAT_PEERPORT\";
"
@notbanker
notbanker / stockfish.sh
Last active November 24, 2019 16:03
Use stockfish engine to output the position evaluation only
#!/usr/bin/env bash
# Call stockfish engine on mac and return only the evaluation score
# Usage stockfish.sh 'r1b2rk1/4qppp/2pp4/pp6/3Bn3/PB3Q1P/1PP2PP1/3R1RK1' 5 mac 12 1024
# Usage stockfish.sh 'r1b2rk1/4qppp/2pp4/pp6/3Bn3/PB3Q1P/1PP2PP1/3R1RK1' 5 mac 12 1024
# Assumes the stockfish binary is called 'stockfish_'+binary
fen=$1
seconds=${2:-3}
binary=${3:-mac}
threads=${4:-12}
@mvaneijgen
mvaneijgen / Scale resolution.scpt
Last active March 26, 2023 10:46
Change screen resolution AppleScript
local index1, index2
set index1 to 3 -- 1920 x 1200
set index2 to 4 -- 1280 x 800
-- Launch "System Preferences", open the "Displays" options and change to the "Display" tab
tell application "System Preferences"
activate
set the current pane to pane id "com.apple.preference.displays"
reveal anchor "displaysDisplayTab" of pane id "com.apple.preference.displays"