Skip to content

Instantly share code, notes, and snippets.

@kamilhism
kamilhism / oktaverify2totp.md
Created September 10, 2022 16:18
Get TOTP secret key for Okta Verify
  1. Get the content of the QR for Okta Verify app setup. It looks like this: oktaverify://[email protected]/?t=XXXXX&f=YYYYY&s=https://DOMAIN.okta.com&issuer=DOMAIN.okta.com&isIdxEnabled=true
  2. Replace XXXXX, YYYYY and DOMAIN to your values in curl below:
curl --request POST \
  --url https://DOMAIN.okta.com/idp/authenticators \
  --header 'Accept: application/json; charset=UTF-8' \
  --header 'Accept-Encoding: gzip, deflate' \
  --header 'Authorization: OTDT XXXXX' \
  --header 'Content-Type: application/json; charset=UTF-8' \
@fbmoose48
fbmoose48 / amdgpu_compute_mode_linux.php
Created July 4, 2019 05:06 — forked from divinity76/ubu_1804_amdgpu_compute_mode_linux.php
sets "compute mode" on AMD GPU's in linux
#!/usr/bin/env php
<?php
declare(strict_types = 1);
if (posix_geteuid () !== 0) {
die ( "error: this script requires root privileges, re-run it as root." );
}
$amdgpu_dir = '/sys/bus/pci/drivers/amdgpu';
$dirs = array_filter ( array_map ( 'trim', glob ( $amdgpu_dir.DIRECTORY_SEPARATOR.'*', GLOB_NOSORT | GLOB_ONLYDIR | GLOB_MARK ) ), function (string $str) {
return (is_writable ( $str."power_dpm_force_performance_level" ) && is_writable ( $str.'pp_compute_power_profile' ));
} );
@piotr-dobrogost
piotr-dobrogost / mine
Created July 18, 2017 09:35
Set of scripts to manage ethereum miner ethminer.
#!/bin/bash
export DISPLAY=:0
sudo nvidia-smi -pl 108
tmux \
set-option -g remain-on-exit on \; \
new-session -A -s ethminer "mining-oc && ethminer -SP 2 -U -S daggerhashimoto.eu.nicehash.com:3353 -O <address>:<miner>" \; \
split-window "mining-stats" \; \
@Waltibaba
Waltibaba / coreboot_config_t420_2017_02
Created May 23, 2017 11:15
coreboot build configuration for t420, applicable to master branch around february 2017. Requires VGA and nvramcui binaries
#
# Automatically generated file; DO NOT EDIT.
# coreboot configuration
#
#
# General setup
#
CONFIG_LOCALVERSION=""
CONFIG_CBFS_PREFIX="fallback"
@NickSeagull
NickSeagull / ubuntu-bloat-removal.sh
Last active April 6, 2025 10:56
Updated Jan 22nd, 2024 - Simple command to remove all "bloatware" from ubuntu
sudo apt-get remove \
aisleriot \
brltty \
duplicity \
empathy \
empathy-common \
example-content \
gnome-accessibility-themes \
gnome-contacts \
gnome-mahjongg \
#find which mem chip exactly it is (in flashrom's internal naming scheme - the real chip is the 6406E, but flashrom combines it with the 6408E)
flashrom -L | grep MX25L
#read
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 --chip MX25L6406E/MX25L6408E -r romread1.rom
#read a few times and compare with 'diff' to be sure read didn't have errors, just in case you have to flash back
@Hammster
Hammster / login-background.sh
Last active February 12, 2020 19:54
Gnome Loginscreen wallpaper replacement bashscript useage: sh login-background.sh PATH_TO_IMG
#!/usr/bin/sh
if [ "$IMAGE" = "" ]; then
IMAGE=$(
dbus-launch gsettings get org.gnome.desktop.screensaver picture-uri |
sed -e "s/'//g" |
sed -e "s/^file:\/\///g"
)
fi
@valc93
valc93 / xgala.txt
Last active June 21, 2023 21:23
XFCE + GALA
Source: https://www.reddit.com/r/linux/comments/14heuu/xfce_gala_plank_awesome/
Add the elementary daily ppa and install gala + plank + dconf-tools
sudo apt-add-repository ppa:elementary-os/daily
sudo apt-get update $$ sudo apt-get dist-upgrade
sudo apt-get install gala plank dconf-tools gtk2-engines-pixbuf
Set gala as xfce's default window manager
@ahoward
ahoward / caching-https-creds.markdown
Created June 6, 2012 21:42
Fix Username/Password prompting for github repos cloned via https scheme

github recently switched to an https scheme as the default for cloning repos. as a side effect you may suddenly be prompted for a 'Username' and 'Password' when you push where, previously, you were able to do so without typing in credentials. the solution is to cause git to cache https credentials which is easy, since git uses curl under the covers

in your home directory create a file called '.netrc', for example

/Users/ahoward/.netrc

in it put these contents