Skip to content

Instantly share code, notes, and snippets.

View ojsl1's full-sized avatar
💭

Niinu Laari ojsl1

💭
  • Lahti, Finland
  • 07:58 (UTC +03:00)
View GitHub Profile
@ojsl1
ojsl1 / headless.sh
Created January 22, 2024 09:29 — forked from lebedov/headless.sh
Using Xvfb to create a headless display
#!/bin/bash
# Demonstrates how to create a headless display using xvfb.
# Create the display:
Xvfb :100 -ac &
PID1=$!
export DISPLAY=:100.0
# Run the application that needs the display:
@ojsl1
ojsl1 / repo-rinse.sh
Created August 25, 2023 16:21 — forked from nicktoumpelis/repo-rinse.sh
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive
@ojsl1
ojsl1 / alsamixer_autorestore_settings_every_reboot.md
Created October 29, 2022 23:51 — forked from enrialonso/alsamixer_autorestore_settings_every_reboot.md
Auto restore custom settings for alsamixer every reboot

Edit your alsamixer settings

alsamixer

Store the changes on a file

alsactl --file /home/<>/.config/asound.state store
@ojsl1
ojsl1 / nvidia-installer.sh
Created July 5, 2022 11:11 — forked from GloriousEggroll/nvidia-installer.sh
nvidia /etc/profile.d/ script
#!/usr/bin/sh
nvgpu=$(lspci | grep -iE 'VGA|3D' | grep -i nvidia | cut -d ":" -f 3)
nvkernmod=$(lspci -k | grep -iEA3 'VGA|3D' | grep -iA3 nvidia | grep -i 'kernel driver' | grep -iE 'vfio-pci|nvidia')
if [[ ! -z $nvgpu ]]; then
if [[ -z $nvkernmod ]]; then
# Check for internet connection
wget -q --spider http://google.com
if [ $? -eq 0 ]; then