Skip to content

Instantly share code, notes, and snippets.

View InvertedAcceleration's full-sized avatar

Chris Magee InvertedAcceleration

View GitHub Profile
@InvertedAcceleration
InvertedAcceleration / enableViaAccess.sh
Created September 13, 2023 16:46
Enable VIA (https://usevia.app/) access to Keychron keyboards in Linux
#!/bin/bash
FILES=/dev/hidraw*
for f in $FILES
do
FILE=${f##*/}
DEVICE="$(cat /sys/class/hidraw/${FILE}/device/uevent | grep HID_NAME | cut -d '=' -f2)"
if [[ "$DEVICE" == *"Keychron"* ]]; then
echo "Enabling VIA access for $DEVICE."
chmod a+rw /dev/$FILE
@InvertedAcceleration
InvertedAcceleration / Xonar Essence ST - Analog Out toggling AutoIt script.au3
Last active August 29, 2015 14:13
Xonar Essence ST - Analog Out toggling AutoIt script
$windowTitle = "Xonar Essence ST Audio Center"
$currentOutput = ControlCommand($windowTitle, "", "[CLASS:ComboBox; INSTANCE:5]", "GetCurrentSelection")
$newOutput = stringinstr($currentOutput, "Headphone") ? "2 Speakers" : "Headphone"
ControlCommand($windowTitle, "", 2401, "SelectString", $newOutput)
sudo find / -name 'filename.file' -exec rm -i {} \;
@InvertedAcceleration
InvertedAcceleration / multitail.conf
Last active August 29, 2015 14:10
A colour scheme for symfony 2.3.x+ logs
colorscheme:symfony
cs_re:yellow:"[^"\\]*(\\.[^"\\]*)*"
cs_re:cyan:^\[....-..-.. ..:..:..\]
cs_re:green:.*DEBUG.*
cs_re:red:^.*(WARNING|ERROR|CRITICAL).*$
cs_re:blue:.*INFO.*
#!/bin/bash
# node.js using PPA (for statsd)
sudo apt-get --yes update
sudo apt-get --yes install python-software-properties
sudo apt-add-repository ppa:chris-lea/node.js
sudo apt-get --yes update
sudo apt-get --yes install nodejs
# Install git to get statsd
rds-modify-db-parameter-group {param-group-name} \
--parameters="name=character_set_server, value=utf8, method=pending-reboot" \
--parameters="name=collation_server, value=utf8_general_ci, method=pending-reboot" \
--parameters="name=tmp_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=max_heap_table_size, value={DBInstanceClassMemory/16}, method=pending-reboot" \
--parameters="name=query_cache_type, value=1, method=pending-reboot" \
--parameters="name=query_cache_size, value=131072, method=pending-reboot" \
--parameters="name=table_open_cache, value=2500, method=pending-reboot" \
--parameters="name=join_buffer_size, value={DBInstanceClassMemory/64}, method=pending-reboot" \
--parameters="name=thread_cache_size, value={DBInstanceClassMemory/12582880}, method=pending-reboot" \
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings]
"Present"=dword:00000001
"HostName"=""
"LogFileName"="putty.log"
"LogType"=dword:00000000
"LogFileClash"=dword:ffffffff
"LogFlush"=dword:00000001
"SSHLogOmitPasswords"=dword:00000001
@InvertedAcceleration
InvertedAcceleration / gist:2150177
Last active September 30, 2016 16:26
Extension method for IEnumerable
public static class IEnumerableExtensions {
public static IEnumerable<TSource> Alternate<TSource>(this IEnumerable<TSource> self, IEnumerable<TSource> with) {
using (var selfEnumerator = self.GetEnumerator())
using (var withEnumerator = with.GetEnumerator()) {
bool selfHasCurrent;
bool withHasCurrent;
do {
selfHasCurrent = selfEnumerator.MoveNext();