// ==UserScript== | |
// @name HN Chat Mode | |
// @namespace https://news.ycombinator.com/ | |
// @version 2024-09-18 | |
// @description live comments updater | |
// @author You | |
// @match https://news.ycombinator.com/item* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=news.ycombinator.com | |
// @grant none | |
// ==/UserScript== |
#!/usr/bin/env python | |
""" | |
pip install tiktoken requests | |
export OPENAI_API_KEY=<redact> | |
chmod +x prepare-commit-msg | |
mv prepare-commit-msg .git/hooks/ | |
""" | |
import math |
// I'm tired of extensions that automatically: | |
// - show welcome pages / walkthroughs | |
// - show release notes | |
// - send telemetry | |
// - recommend things | |
// | |
// This disables all of that stuff. | |
// If you have more config, leave a comment so I can add it!! | |
{ |
Control media with easy to remember keyboard shortcuts.
Even if you have a keyboard with dedicated media buttons, you'll find these keyboard shortcuts a lot easier to control the media on your computer.
- Alt + Shift + Space : Pause/Play
- Alt + Shift + n : Next
- Alt + Shift + p : Previous
- Alt + Shift + m : Mute
- Alt + Shift + + : Volume up
Add a local rdp user via user data at launch of a Windows EC2 instance. Note that this includes a password passed in thru both the user data and powershell command line and is a bad security practice because they can be viewed later. At a minimum, you should connect to the instance immediately after launch and change the password interactively. Also, delete the userdata from the instance after launch. More secure would be to connect the instance to a domain for authentication or use AWS native tooling to connect to the instance (e.g., AWS Session Manager).
<powershell>
# Be sure to set the username and password on these two lines. Of course this is not a good
# security practice to include a password at command line.
scriptencoding utf-8 | |
" ============================================================================ | |
" Author: yangguang | |
" Version: v1.1.0 | |
" Update Time: 2020-01-01 | |
" ============================================================================ | |
" Vundle initialization | |
" Avoid modify this section, unless you are very sure of what you are doing |
With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.
For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.
In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:
- Go to your computers/phones settings
- Ensure Bluetooth is turned on
#!/bin/bash | |
# | |
# Need to generate passwords frequently on the Linux CLI? | |
# | |
# This script creates a password and copies it to the clipboard. | |
# | |
# 1. Ensure you have 'pwgen' and 'xclip' installed | |
# (sudo apt-get install pwgen xclip) | |
# 2. Download this script and make it executable: | |
# (sudo wget -O /usr/bin/pw https://gist.githubusercontent.com/caseyamcl/53f0c91e9ef1b42abb57/raw/pw && sudo chmod 755 /usr/bin/pw) |
{ | |
"Description": "Create a VPC with a SG which references itself", | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Resources": { | |
"vpctester": { | |
"Type": "AWS::EC2::VPC", | |
"Properties": { | |
"CidrBlock": "172.16.0.0/23", | |
"EnableDnsSupport": false, | |
"EnableDnsHostnames": false, |