These instructions are an amalgam of steps presented by Wired’s Robbie Gonzalez, Phil of thecubicle.com, and JPerm of YouTube fame.
This file contains hidden or 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 <stdlib.h> | |
#include <limits.h> | |
#include <string.h> | |
#include <time.h> | |
/* | |
* generates an unsigned int between low and high, inclusive of both | |
* taken from: https://en.cppreference.com/w/c/numeric/random/rand | |
* |
This file contains hidden or 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
//Borrowed from https://github.com/reneargento/algorithms-sedgewick-wayne/blob/master/src/chapter3/section4/Exercise4.java | |
import java.util.ArrayList; | |
import java.util.HashSet; | |
import java.util.Set; | |
/** | |
* Created by Rene Argento on 19/07/17. | |
* Modified on 10/30/2019 | |
*/ | |
public class Exercise4Mod |
This file contains hidden or 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 bash | |
#TODO: call ddcutil detect and parse output for actual devices; only constants should be VCP code and vars | |
# related to ddcutil | |
BUS_FLAG="-b" | |
I2C_ID=5 | |
CMD="ddcutil" | |
GETTER=getvcp | |
SETTER=setvcp |
This file contains hidden or 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/bash | |
clear | |
for f in {1..10} | |
do | |
vcgencmd measure_temp | |
sysbench --test=cpu --cpu-max-prime=20000 --num-threads=4 run > /dev/null 2>&1 | |
done | |
vcgencmd measure_temp |
This file contains hidden or 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 bash | |
set -eou pipefail | |
sec_list=$(gcloud secrets list --format="table[no-heading](name.basename())") | |
for s in ${sec_list[*]}; | |
do | |
sec=$(gcloud secrets versions access latest --secret="$s") | |
printf "%s: %s\n" $s $sec | |
done |
This file contains hidden or 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/bash | |
set -euo pipefail | |
filename='secmgr.tf' | |
proj_id=$1 | |
sec_list=$(gcloud secrets list --format="table[no-heading](name.basename())") | |
for s in ${sec_list[*]}; | |
do |
This file contains hidden or 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
watch -n5 \ | |
"ls -al; echo; free -h; echo;\ | |
ps axo pid,ppid,psr,pri,start:18,etime:12,pcpu,pmem,rss:12,vsz:12,cmd; echo;\ | |
tail -n15 elt.log; echo;" |
This file contains hidden or 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
apt update | |
apt -y install gnupg2 | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - | |
echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list | |
apt update | |
apt -y install postgresql-client-13 |
This file contains hidden or 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
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |