Skip to content

Instantly share code, notes, and snippets.

View jirib's full-sized avatar

jirib jirib

View GitHub Profile
#!/bin/bash
#set -x
DUSER=badbrowser
# X11 display
xhost +SI:localuser:${DUSER} >/dev/null
# pulseaudo
setfacl -m u:${DUSER}:x ${XDG_RUNTIME_DIR}/pulse
@jirib
jirib / smbd.log
Created January 5, 2022 07:04
an example of failing idmap
[2021/12/31 07:49:25.049908, 5, pid=14551, effective(0, 0), real(0, 0)] ../../source3/lib/username.c:181(Get_Pwnam_alloc)
Finding user EXAMPLENET\foo
[2021/12/31 07:49:25.049929, 5, pid=14551, effective(0, 0), real(0, 0)] ../../source3/lib/username.c:120(Get_Pwnam_internals)
Trying _Get_Pwnam(), username as lowercase is examplenet\foo
[2021/12/31 07:49:25.050300, 5, pid=14551, effective(0, 0), real(0, 0)] ../../source3/lib/username.c:128(Get_Pwnam_internals)
Trying _Get_Pwnam(), username as given is EXAMPLENET\foo
[2021/12/31 07:49:25.050538, 5, pid=14551, effective(0, 0), real(0, 0)] ../../source3/lib/username.c:141(Get_Pwnam_internals)
Trying _Get_Pwnam(), username as uppercase is EXAMPLENET\FOO
[2021/12/31 07:49:25.050818, 5, pid=14551, effective(0, 0), real(0, 0)] ../../source3/lib/username.c:153(Get_Pwnam_internals)
Checking combinations of 0 uppercase letters in examplenet\foo

WIP: neomutt with notmuch and multiple accounts

~/.notmuch-config

[database]
path=/home/foo/.mail

[user]
name=foo
@jirib
jirib / gist:4c99c9d8b513664241a4b0429bb1bbdc
Last active October 29, 2021 09:13
testing kernel oops
# based on https://programmersought.com/article/30002612436/ and
# https://www.thegeekstuff.com/2013/07/write-linux-kernel-module/
cat > oops.c <<EOF
#include <linux/kernel.h>
#include <linux/module.h>
static int __init hello_init(void)
{
int *p = 0;
$ ls -ld /home ~/.ssh ~/.ssh/authorized_keys
drwxr-xr-x 3 root root 18 Mar 2 12:56 /home
drwx------ 2 jiri users 4096 Mar 23 12:28 /home/jiri/.ssh
-rw------- 1 jiri users 109 Mar 12 16:55 /home/jiri/.ssh/authorized_keys
$ cat /tmp/ssh/sshd_config
AllowUsers jiri
AuthorizedKeysFile /home/jiri/.ssh/authorized_keys
Subsystem sftp /usr/libexec/ssh/sftp-server
Port 1234
@jirib
jirib / opensuse_usb_install_serial_console.md
Last active June 7, 2021 04:03
openSUSE USB installation media with serial console

For BIOS boot, IMO UEFI works differently (GRUB).

fdisk /dev/sda # create partition and set it active
mkfs.ext4 /dev/sda1
mount /dev/sda1 /mnt
bsdtar -xvf <iso> -C /mnt/
grub2-install --target=i386-pc --recheck --debug --boot-directory=/mnt/boot /dev/sda
cat > /mnt/boot/grub2/grub.cfg <<EOF
serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
$ id; sftp -b - -s '/usr/bin/sudo /usr/libexec/sftp-server' localhost << EOL
> pwd
> cd /root
> ls -al
> quit
> EOL
uid=1000(jiri) gid=1000(jiri) groups=1000(jiri),4(wheel),12(audio),13(video),20(scanner),21(network),987(docker),990(libvirt),995(bluetooth)
sftp> pwd
Remote working directory: /home/jiri
sftp> cd /root
@jirib
jirib / UTF-8-demo.txt
Created March 10, 2021 08:14 — forked from bric3/UTF-8-demo.txt
Shell (commands) tips accumulated over years
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Markus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 CC BY
The ASCII compatible UTF-8 encoding used in this plain-text file
is defined in Unicode, ISO 10646-1, and RFC 2279.
$ type foo
foo is a function
foo ()
{
echo "foo";
echo "bar";
echo "running"
}
$ status=$(foo)
$ echo ${status}
+/- Job: "show_id_job"
+/- Task Group: "show_id_group"
+/- Task: "show_id"
+/- Config {
+/- args[0]: "--login" => "jiri"
+/- args[1]: "jiri" => "-c"
args[2]: "/usr/bin/id"
command: "/usr/bin/su"}