This file contains 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 -x | |
# Scaling driver | |
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver | |
# for example: amd-pstate-epp | |
# Scaling governor | |
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor |
This file contains 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
nmcli -f name connection show | grep -Ev 'Tatooine5G|NAME' | sed -e 's/[[:space:]]*$//' | tr '\n' '\0' | xargs -0 -n1 nmcli connection delete |
This file contains 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
"""The following command checks which packages have a dependency on a given package checking through all packages even though not installed locally: | |
pacman -Sii nodejs-lts-gallium | grep "Req" | sed -e 's/Required By : //g' | |
This returns a string of packages separated by spaces and some prefix. | |
This script does the same thing but then in python and tells you which packages you currently have installed of those. | |
THis is inspired by getting "warning: removing 'nodejs' from target list because it conflicts with 'nodejs-lts-gallium'" why trying to run pacman -Syu today. | |
The warning does not help, it should tell me where the warning is coming from. | |
This script told me that apm was the culprit (turned out to be implicitly installed for atom) I dont use atom, so removed atom along with all its dependencies. problem solved. |
This file contains 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/sh | |
client=$1 | |
if [ x$client = x ]; then | |
echo "Usage: $0 clientname" | |
exit 1 | |
fi | |
easyrsa_dir="/etc/openvpn/easy-rsa" |
This file contains 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 python3 | |
# -*- coding: utf-8 -*- | |
# | |
# Usage: | |
# $ cat ~/.bash_history | ./bash-history-to-zsh-history.py >> ~/.zsh_history | |
import sys | |
import time | |
def main(): |
This file contains 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
import asyncio | |
async def foo(): | |
print('hello') | |
tasks = [ | |
bar(), | |
bar(), | |
bar(), | |
bar(), |
This file contains 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
// create a file named input containing 1, 2, 3, 4 on separate lines | |
// cat input | node serial-readline.js | |
// output (shows bot stdin and stdout): | |
// 1 | |
// start handler | |
// end handler | |
// 2 | |
// 3 | |
// 4processing: 1 | |
// start handler |
This file contains 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
/** | |
* Fake createOrder. It fails half of the time and had a random runtime between 0 and 1000 ms. | |
*/ | |
async function createOrder() { | |
return new Promise((resolve, reject) => { | |
let action; | |
let returns; | |
if (Math.random() < 0.01) { | |
console.log('action=resolve'); |
This file contains 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
#!groovy | |
import groovy.json.JsonOutput | |
import groovy.json.JsonSlurper | |
/* | |
Please make sure to add the following environment variables: | |
HEROKU_PREVIEW=<your heroku preview app> | |
HEROKU_PREPRODUCTION=<your heroku pre-production app> | |
HEROKU_PRODUCTION=<your heroku production app> |
This file contains 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
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
"github.com/spf13/pflag" | |
) |
NewerOlder