This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sc triggerinfo w32time start/networkon stop/networkoff | |
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /v NtpServer /d ntp.nict.jp,0x8 /f | |
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config" /v UpdateInterval /t REG_DWORD /d 100 /f | |
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config" /v PhaseCorrectRate /t REG_DWORD /d 7 /f | |
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import time | |
import smbus | |
i2c = smbus.SMBus(1) | |
addr=0x36 | |
data = i2c.read_i2c_block_data(addr, 0x04, 2) | |
capacity = int((data[0] << 8 | data[1]) / 256) | |
print(f'battery.capacity\t{capacity}\t{time.time()}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
hour=$(date +%H) | |
if [ "$hour" -lt 9 ]; then | |
exit | |
fi | |
mean=$(curl -s "http://localhost/webcam/?action=snapshot" | identify -format "%[mean]" jpg:- | cut -d . -f 1) | |
if [ "$mean" -lt 1000 ]; then | |
curl -s "http://192.168.0.82:42897/api/light/on" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLUG_HOST=192.168.0.30 | |
OCTOPI_HOST=octopi.local | |
API_KEY= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@powershell -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 1})-join\"`n\");&$s" %*&goto:eof | |
$dest = $env:USERPROFILE + '\dropbox\' | |
$src = 'C:\Program Files (x86)\Steam\userdata\******\582010\remote\' | |
While ($true) { | |
$saveGame = Get-ChildItem $src -Recurse | Where-Object {$_.Name -eq 'SAVEDATA1000'} | |
$latestBackup = Get-ChildItem $dest | Sort-Object LastWriteTime -Descending | Select-Object -first 1 | |
if ($saveGame.LastWriteTime -gt $latestBackup.LastWriteTime) { | |
Copy-Item $saveGame.FullName ($dest + (Get-Date -Format yyyy-MMdd-HHmmss) + '-SAVEDATA1000') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@powershell -NoProfile -ExecutionPolicy Unrestricted "$s=[scriptblock]::create((gc \"%~f0\"|?{$_.readcount -gt 1})-join\"`n\");&$s" %*&goto:eof | |
$path = "$env:USERPROFILE\Documents\Elder Scrolls Online\live\UserSettings.txt" | |
(Get-Content $path) | foreach { $_ -creplace "SET SkipPregameVideos `"0`"", "SET SkipPregameVideos `"1`"" } | Set-Content $path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Usage | |
* | |
* copy core.asar from Discord app | |
* Win: %APPDATA%/discord/0.0.xxx/modules/discord_desktop_core/core.asar | |
* Mac: ~/Library/Application\ Support/discord/0.0.xxx/modules/discord_desktop_core/core.asar | |
* yarn add asar | |
* asar e core.asar core | |
* CSS_PATH=C:/dropbox/discordUser.css node injectUserCss.js | |
* asar p core core.asar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <avr/interrupt.h> | |
#include <LUFA/Drivers/Peripheral/Serial.h> | |
#define MAX_BUFFER 32 | |
char b[MAX_BUFFER]; | |
uint8_t l = 0; | |
ISR(USART1_RX_vect) { | |
char c = fgetc(stdin); | |
printf("%c", c); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const argv = require('minimist')(process.argv.slice(2)); | |
const net = argv.ssl ? require('tls') : require('net'); | |
const irc = require('slate-irc'); | |
const dns = require('dns'); | |
const exec = require('child_process').exec; | |
const growl = require('growly'); | |
const growlIcon = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAB0VBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////P+BsGAAAAmnRSTlMAAQIDBAUGBwgJCgsMDRARExQVFhcYGhscHR4fICEiIyQlJicp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript <<EOM | |
twtu = (title, url) => { | |
const args = commandline.command.split(/\s+/); | |
const text = args.slice(1, -1).join(' '); | |
const match = /^@\w{1,15}(#\d+)$/.exec(args[1]); | |
const r = 140 - 23 - text.length + (match ? match[1].length : 0); | |
if (title.length > r-7) { | |
title = title.slice(0, r-7) + '\u2026' | |
} | |
return `"${title}" - ${url}`; |