Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel S. Sterling eqhmcow

View GitHub Profile
@eqhmcow
eqhmcow / cake
Last active Aug 11, 2020
let me eat cake
View cake
### section 1
# disable CPU mitigations, disable CPU sleep (C states), disable CPU throttling (frequency scaling)
# edit /boot/grub/grub.cfg
# mitigations=off intel_idle.max_cstate=0 processor.max_cstate=1
echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
echo performance > /sys/devices/system/cpu/cpufreq/policy1/scaling_governor
View wavepool.patch
dsterling@thinkfly:~/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/src/kaleidoscope/plugin$ git diff
diff --git a/src/kaleidoscope/plugin/LED-Wavepool.cpp b/src/kaleidoscope/plugin/LED-Wavepool.cpp
index 1c24fe49..b649e3a5 100644
--- a/src/kaleidoscope/plugin/LED-Wavepool.cpp
+++ b/src/kaleidoscope/plugin/LED-Wavepool.cpp
@@ -179,10 +179,10 @@ void WavepoolEffect::TransientLEDMode::update(void) {
int8_t *p;
for (p = offsets, value = 0; p < offsets + 8; p++)
value += oldpg[offset + (*p)];
- value = (value >> 2) - newpg[offset];
@eqhmcow
eqhmcow / iptables.rules
Last active Feb 12, 2020
let me eat cake
View iptables.rules
# /etc/iptables.rules
# Generated by iptables-save v1.6.1 on Sat Oct 19 09:21:09 2019
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:MINIUPNPD - [0:0]
View How to run "ls" in docker
How to run "ls" in docker
---
Run "ls" in docker, handling various possible environmental issues that the shell normally directly handles.
That is, the below docker command is similar to simply issuing "ls" at a shell prompt, or adding an "ls" command to a shell script.
Without docker:
@eqhmcow
eqhmcow / README
Last active Oct 7, 2019 — forked from anonymous/README
docker wrapper
View README
slightly-less-insecure-docker
wrapper around docker that perhaps makes it slightly less insecure
example usage:
DOCKER=/path/to/docker-wrapper
sudo $DOCKER run -it -v /etc/passwd:/etc/passwd -v /tmp:/tmp ubuntu
NOTE:
@eqhmcow
eqhmcow / aggregate.pl
Last active Jun 17, 2017
aggregate contiguous positive numbers
View aggregate.pl
use strict;
use warnings;
my @n;
while (<>) {
push @n, $_;
}
my $first_num = 0;
my $next_num = 0;
my $contig = 0;
View gist:886717fc3b584118c954e9be5544dc28
# remove IP / set IP to one that won't be used for other systems
# clear ssh host key
rm -rf /etc/ssh/ssh_host_*
# remove /etc/hosts entries as applicable
# remove utmp data - wtmp and btmp and lastlog
rm /var/log/{w,b}tmp /var/log/lastlog ;
touch /var/log/{w,b}tmp /var/log/lastlog ;
@eqhmcow
eqhmcow / ping-check.pl
Last active Nov 5, 2019
timestamp STDOUT
View ping-check.pl
#!/usr/bin/env perl
use strict;
use warnings;
# apt-get install apache2-utils libyaml-syck-perl libtimedate-perl
use YAML::Syck;
use IO::File;
use Date::Parse;
use Time::Piece;
@eqhmcow
eqhmcow / doit.pl
Last active Sep 26, 2016
quick and dirty ssh then sudo then run commands in a loop w/ Net::CLI::Interact and Parallel::ForkManager
View doit.pl
#!/usr/bin/perl
use strict;
use warnings;
use Net::CLI::Interact;
use Parallel::ForkManager;
# servers
my @doit = qw( server1 server2 server3 );
You can’t perform that action at this time.