Skip to content

Instantly share code, notes, and snippets.

@Trucido
Trucido / openSUSE-Leap-42.3-pam_kwallet-guide.md
Last active October 14, 2023 18:32 — forked from benediktg/pam_kwallet-guide.md
How to configure pam_kwallet to auto-unlock kdewallet from sddm login credentials on openSUSE Leap 42.3 KDE Plasma5

How to configure pam_kwallet to auto-unlock the default kwallet5 "kdewallet" from sddm login credentials on openSUSE Leap 42.3 KDE Plasma5

Note: Many other guides & posts were attempted before creating this, however they either no longer work or are ugly hacks which don't follow SUSE's odd pam.d layouts. Essentially, this solution boils down to this: pam_kwallet needs to be loaded from it's own substack just like pam_gnome_keyring already is configured to do so, so new substacks were created based on the gnome_keyring ones so that they could be added to sddm. I'm unsure how both gnome_keyring and kwallet behave if both are loaded from the same substack so I kept them in separate stacks. This was tested with only kwallet5 installed but it should also optionally load the old kwallet4 if it's present. My understanding of PAM is limited, so I'm open to suggestions, but this seemed like the cleanest solution which doesn't get overwritten on updates, though it should probably be globally registered as a

@Trucido
Trucido / 50-coredump.conf
Last active March 16, 2019 00:45
Disable systemd dumps
# /etc/sysctl.d/50-coredump.conf
##################################################################################
## NO DUMPING ALLOWED ##
## VIOLATORS WILL BE PROSECUTED ##
##################################################################################
fs.suid_dumpable = 0
kernel.suid_dumpable = 0
kernel.core_pattern = |/bin/false
#!/bin/bash
#
# /etc/init.d/zswap || zswap.service || /usr/local/sbin/zswap || somethingsomething
#
### BEGIN INIT INFO
# Provides: zswap
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# ~/.rc/bash_prompt.sh
# Check that we're zsh and real bash not sh bash
case "$(readlink /proc/$$/exe 2>/dev/null)" in
*/bash) ! shopt -oq posix || return;;
*/zsh) ;;
*) return;;
esac
# Interactive only
[[ $- == *i* ]] || return
@Trucido
Trucido / foo.sh
Created April 7, 2018 19:01
PROMPT_COMMAND
if [ -z "$PROMPT_COMMAND" ]; then
case $TERM in
xterm*|vte*)
# check /etc/sysconfig and /etc/default for expert custom file first
# Debian example: 'echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
elif [ -e /etc/default/bash-prompt-xterm ]; then
PROMPT_COMMAND=/etc/default/bash-prompt-xterm
elif [[ -e "${XDG_CONFIG_HOME:-$HOME/.config}/bash-prompt-xterm" ]]; then
@Trucido
Trucido / uniquefy.sh
Created April 8, 2018 20:50
uniquefy_buttpaths
uniquefy_search_path ()
{
OIFS="$IFS"
IFS='
'
set -- $(echo ${1+"$@"} | sed -r 's@/*:|([^\\]):@\1\n@g;H;x;s@/\n@\n@')
IFS="$OIFS"
_y=""
for _x ; do
################################################################################
## ~/.inputrc
##
## Control the behaviour of the readline library used e.g.
## by the bash in the interactive mode for line editing.
##
################################################################################
##----------------------------------------------------------------------------##
## readline(3) - Global order: /etc/inputrc, ${INPUTRC:-$HOME/.inputrc}
# .bashrc -*- mode:shell-script sh-basic-offset:4 indent-tabs-mode:nil -*-
#
#
# Sanity checks
#
[ -n "$BASH_VERSION" -a -n "$BASH" ] || return 0
# Always set histfile to avoid clobbering other shells.
HISTFILE=${HOME}/.bash_history
# Test for corner cases in shells sourcing this file.
--- 1/usr/share/vim/site/plugin/powerline.vim 2018-05-19 13:09:49.950986016 -0400
+++ 2/usr/share/vim/site/plugin/powerline.vim 2018-05-19 13:10:13.602985689 -0400
@@ -26,14 +26,14 @@ if exists('g:powerline_pycmd')
let s:pyeval = g:powerline_pyeval
let s:has_python = 1
endif
-elseif has('python')
- let s:has_python = 1
- let s:pycmd = 'py'
- let s:pyeval = get(g:, 'powerline_pyeval', 'pyeval')
--- 1/etc/profile.d/vte.sh 2018-04-19 16:46:08.000000000 -0400
+++ 2/etc/profile.d/vte.sh 2018-05-17 15:08:01.808845123 -0400
@@ -50,9 +50,11 @@
}
__vte_prompt_command() {
+ local command=$(HISTTIMEFORMAT= history 1 | sed 's/^ *[0-9]\+ *//')
+ command="${command//;/ }"
local pwd='~'
[ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}