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
corecount="${1:-"$(nproc 2>/dev/null || echo 8)"}" | |
procpids=() | |
multiproc() { | |
local cmd="$(printf "%q " "$@")" | |
eval "$cmd" & | |
procpids+=($!) | |
echo "Spawned $!: $cmd" | |
if [ "${#procpids[@]}" -ge "$corecount" ]; then | |
local finished=0 |
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/sh | |
# Automatically rotate the screen when the device's orientation changes. | |
# Use 'xrandr' to get the correct display for the first argument (for example, "eDP-1"), | |
# and 'xinput' to get the correct input element for your touch screen, if applicable | |
# (for example, "Wacom HID 486A Finger"). | |
# | |
# The script depends on the monitor-sensor program from the iio-sensor-proxy package. | |
if [ -z "$1" ]; then |
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
# Copy fan-speed-control.sh to `/usr/local/bin/fan-speed-control.sh`, | |
# make sure it's executable with `sudo chmod +x /usr/local/bin/fan-speed-control.sh`. | |
# Then copy this file `/lib/systemd/system/fan-speed-control.service`, | |
# then run `sudo systemctl enable --now fan-speed-control`. | |
# Check that everything looks OK with `sudo journalctl -fe -u fan-speed-control`. | |
[Unit] | |
Description=Fan speed control | |
[Service] |
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/sh | |
make_has_flags=0 | |
for arg in "$@"; do | |
if [ "${arg#-}" = "-" ]; then | |
make_has_args=1 | |
break | |
fi | |
done | |
cores=$(($(nproc) * 2)) |
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/sh | |
# Automatically show an on-screen keyboard when enabling tablet mode. | |
# The script depends on the acpi_listen program from the acpid package, | |
# and the onboard program from the onboard package. | |
listener() { | |
pid= | |
while read -r line; do | |
if [ "$line" = 00000001 ]; then |
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
SRC := $(shell find src -name '*.c') | |
HDR := $(shell find src -name '*.h') | |
OBJ := $(patsubst src/%.c,obj/%.o,$(SRC)) | |
DEP := $(patsubst src/%.c,dep/%.d,$(SRC)) | |
PKG_CONFIG ?= pkg-config | |
STRIP ?= strip | |
TARGET := my-project | |
VERSION = $(shell git describe --long --all --dirty) |
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
[ 133.464103] wlan: SCAN COMPLETED: scanned AP count=22 | |
[ 134.686709] 1b0c000.qcom,cci supply qcom,gdscr-vdd not found, using dummy regulator | |
[ 134.687340] msm_cci_init:1015: hw_version = 0x10000008 | |
[ 135.256489] 1b0c000.qcom,cci supply qcom,gdscr-vdd not found, using dummy regulator | |
[ 135.256891] msm_cci_init:1015: hw_version = 0x10000008 | |
[ 135.439496] helper_vb2_buf_init, list_add_tail(ffff80001d95e208, ffff80002e077850) | |
[ 135.440181] helper_vb2_buf_init, list_add_tail(ffff80001d95fa08, ffff80002e077850) | |
[ 135.446840] helper_vb2_buf_init, list_add_tail(ffff8000176a6e08, ffff80002e077850) | |
[ 135.454212] helper_vb2_buf_init, list_add_tail(ffff8000176a4a08, ffff80002e077850) | |
[ 135.610874] helper_vb2_buf_init, list_add_tail(ffff8000176f6608, ffff80002e077850) |
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
# /etc/systemd/logind.conf | |
[Login] | |
#HandleLidSwitch=suspend | |
HandleLidSwitch=ignore | |
#HandleLidSwitchExternalPower=suspend | |
HandleLidSwitchExternalPower=ignore |
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 -e | |
# Prerequesites: | |
# * https://github.com/electron/electron/blob/v4.1.3/docs/development/build-instructions-linux.md#prerequisites | |
# * libav{codec,format,util}-dev libxss-dev libkrb5-dev | |
# This script downloads and builds Electron. | |
# Everything will happen in a 'work' directory relative to the path of the build.sh file, | |
# and when Electron is built, it will end up in 'work/electron-gn/src/out/Release/electron'. |
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
let depth = 0; | |
// https://www.npmjs.com/package/hsv-rgb | |
function rgb(h, s, v) { | |
var s = s / 100, v = v / 100 | |
var c = v * s | |
var hh = h / 60 | |
var x = c * (1 - Math.abs(hh % 2 - 1)) | |
var m = v - c |