Skip to content

Instantly share code, notes, and snippets.

View ojsl1's full-sized avatar
💭

Niinu Laari ojsl1

💭
  • Lahti, Finland
  • 02:18 (UTC +03:00)
View GitHub Profile
@ojsl1
ojsl1 / nodelay.md
Last active November 8, 2024 22:41
Disabling and or changing the sudo wrong password delay on linux

Linux authentication

On linux systems the password fail delay ie. password authentication is managed by either shadow or PAM.

Completely disabling the fail delay

As of the 2020 release of PAM 1.5.1 the delay can be directly disabled by adding nodelay to /etc/security/faillock.config

Completely disabling the fail delay (old method)

Separately append the nodelay parameter to each auth ... pam_faillock.so line within your /etc/pam.d/ configuration files such as system-auth or common-auth, and the other relevant pam files such as sudo, su and su-l. See below example.

@ojsl1
ojsl1 / discord-manual-updater.sh
Last active September 6, 2024 02:59
Automated workaround for the borked discord linux updater
#!/bin/bash
# Description: Workaround for the borked discord linux updater
#
# Note:
# 1. Downloads an updated discord linux build into ~/.cache/discord-tmp
# 2. Edits and symlinks the newly downloaded .desktop file to your ~/.local/share/applications
#
# Author: Niinu <github.com/ojsl1>
# Email: ojsl@protonmail.ch
@ojsl1
ojsl1 / asm.md
Last active May 19, 2024 18:33
Github assembly markdown codeblocks syntax highlighting examples
lea rdi, main ; main
call cs:__libc_start_main_ptr
.text
main:
        la   $s0, A              # load variables A and B into registers
 lw $s0, 0($s0)
@ojsl1
ojsl1 / wayland-incomplete.md
Last active February 5, 2025 11:02
Stuff that havent worked out of the box after switching from X11 to Wayland

Stuff that havent worked ootb after switching from kwin_x11 to kwin_wayland

1) Xcolor has too many non-working alternatives.

aur/wl-colorpicker-plasma-git (the only one that works on kwin_wayland)

grim + slurp = broken:

  • $ grim -g "$(slurp -p)" -t ppm - | convert - -format '%[pixel:p{0,0}]' txt:- gives:
compositor doesn't support wlr-screencopy-unstable-v1
@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 / root_clone.md
Last active April 22, 2024 15:55
Cloning and resizing root partition with dd and gparted

|unallocated space|root partition|

Free unallocated space in front of root partition, options for merging:

  1. Clone root into unallocated space, and then resize to the right.
  2. Move root to the beginning of disk.
  3. Resize root to the left.

Cloning root into unallocated space

Format unallocated space with gparted or man mkfs.

@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/&lt;&gt;/.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