My evakool fridge comes with an app that connects over WiFi to a proprietary TCP service. ie: not HTTP.
The Android app that talks to this TCP service is shit.
I'm going to attempt to make a less shit app.
#!/bin/sh | |
# WMCTRL Desktop Automation script | |
# ================================ | |
# Author: Brad Jones <brad@bjc.id.au> | |
# | |
# I assume you know what wmctrl is, if not not see: | |
# https://sites.google.com/site/tstyblo/wmctrl/ | |
# | |
# I also assume you actually read the documentation. | |
# I have tested this on Fedora 21 running cinnamon and it works great. |
RUN export BUILD_PACKAGES="gnupg curl ca-certificates apt-transport-https" \ | |
&& export EXISTING_PACKAGES="$(mktemp)" && apt-mark showauto | sort > $EXISTING_PACKAGES \ | |
&& apt-get update && apt-get install -y --no-install-recommends $BUILD_PACKAGES \ | |
&& export NEW_PACKAGES="$(mktemp)" && apt-mark showauto | sort > $NEW_PACKAGES \ | |
&& export PACKAGES_TO_REMOVE="$(comm -23 $NEW_PACKAGES $EXISTING_PACKAGES)" \ | |
\ | |
&& mkdir -p /usr/share/man/man1 \ | |
&& curl -s https://apt.corretto.aws/corretto.key | apt-key add - \ | |
&& echo 'deb https://apt.corretto.aws stable main' > /etc/apt/sources.list.d/corretto.list \ | |
&& apt-get update && apt-get install -y --no-install-recommends java-1.8.0-amazon-corretto-jdk \ |
ARG USERNAME | |
ARG WSL_DISTRO_NAME | |
RUN mv /home /home-tpl | |
COPY ./mount-home.ts /usr/bin/mount-home.ts | |
RUN deno cache /usr/bin/mount-home.ts | |
RUN chmod +x /usr/bin/mount-home.ts | |
RUN sed -i "s/%USERNAME%/$(printf '%s\n' "$USERNAME" | sed -e 's/[\/&]/\\&/g')/g" /usr/bin/mount-home.ts | |
RUN sed -i "s/%WSL_DISTRO_NAME%/$(printf '%s\n' "$WSL_DISTRO_NAME" | sed -e 's/[\/&]/\\&/g')/g" /usr/bin/mount-home.ts | |
COPY ./mount-home.service /usr/lib/systemd/system/mount-home.service | |
RUN systemctl enable mount-home.service |
#!/bin/bash | |
exec deno run --cached-only -qA /usr/bin/xdg-open.ts "$@" |
const { syscall, getAddress } = require("libsys"); | |
const os = require("os"); | |
if (os.endianess() != "LE") | |
throw "only little endian supported"; | |
let dontGC = []; | |
function ref(buffer) { | |
dontGC.push(buffer); | |
return getAddress(buffer); |
<?php | |
// Read in the users to find passwords for. | |
$users = array(); | |
foreach (file('users-to-find.txt') as $line) | |
{ | |
$users[] = trim($line); | |
} | |
// Create the tcpdump command to search for all pop3 and imap login traffic |
I'm buiding a command line tool in Go that has an option to install itself as a service on Windows, which it needs admin rights for. I wanted to be able to have it reliably detect if it was running as admin already and if not, relaunch itself as admin. When the user runs the tool with the specific switch to trigger this functionality (-install or -uninstall in my case) they are prompted by UAC (User Account Control) to run the program as admin, which allows the tool to relaunch itself with the necessary rights.
To detect if I was admin, I tried the method described here first:
https://coolaj86.com/articles/golang-and-windows-and-admins-oh-my/
This wasn't accurately detecting that I was elevated, and was reporting that I was not elevated even when running the tool in CMD prompt started with "Run as Administrator" so I needed a more reliable method.
I didn't want to try writing to an Admin protected area of the filesystem or registry because Windows has the ability to transparently virtualize those writes
<?php | |
/** | |
* Class: DbDiff | |
* ============================================================================= | |
* This class will output the SQL needed to transform db_1 into db_2 including | |
* DATA changes, not just schema changes!!! And it pretty fast, when run locally | |
* at least. I developed this to help me detect changes in CMS type databases | |
* like wordpress so I could create SQL migration and seeding scripts easily. | |
* |