Skip to content

Instantly share code, notes, and snippets.

@loops
loops / gist:3903e26099dde637660c80546829be86
Created November 25, 2023 22:45
GDM use monitors.xml to enable external monitor for login
> touch /usr/lib/gdm/.config/monitors.xml
> chown gdm:gdm /usr/lib/gdm/.config/monitors.xml
Set contents to:
<monitors version="2">
<configuration>
<logicalmonitor>
<x>0</x>
<y>0</y>
@loops
loops / gist:45ca63a278e6508255939813c8e3a21f
Created July 14, 2023 04:08
Mounting WDTV media box from Linux over CIFS.
Samba, Linux SMB/CIFS client, Error 5 -- July 2023
--------------------------------------------------
You may find that trying to mount an old SMBv1 samba server (like a WDTV Live Hub media box)
from a Linux client, leads to an "Error 5". Using smbclient or Fuse will both work, and yet
you can't mount it with the Linux kernel. It's widely known you will need to use the "vers"
mount option, but it turns out that disabling DFS with the "nodfs" option is also needed.
So /etc/fstab will have an entry like:
@loops
loops / gist:e6e9430ce90c07e4aef981c5f8bd2ba0
Last active January 19, 2019 01:24
Fedora tftp-client and firewalld
Fedora, up to at least version 29 has incorrect Firewalld settings to allow
a tftp client to connect to a remote server. The problem is that the
OUTPUT chain in the raw table of iptables is not configured to trigger
the conntrack tftp helper. This raw OUTPUT chain is responsible for
connections created by local processes.
As a temporary fix you can add some config to the file:
/etc/firewalld/direct.xml
@loops
loops / gist:00f417e31954589e79cc7456163fe19f
Last active December 31, 2018 01:18
Interactive Zsh - easier one liners with your favorite language
A little feature to pass interactive comments to your favorite language
as-is. This lets you do one-liners easliy without having to quote
strings and semi-colons and other special characters. Zsh completely
ignores interactive comments for itself, but passes them on to any
command with the leading hash character (#) stripped.
For instance you could do something like this at the Zsh prompt:
zsh> perl6 -e # my $a='hello'~chr(8+<2)~"world "~7*6; say $a if 0|1
#!/bin/env perl6
use lib 'lib';
use Graphics::TinyTIFF;
use NativeCall;
# changed your library away from blob to this:
#
# sub TinyTIFFReader_getSampleData( TinyTIFFReaderFile is rw, CArray[uint16] is rw, uint16 )
#
# Didn't change anything else. And then this worked:

Keybase proof

I hereby claim:

  • I am loops on github.
  • I am loops (https://keybase.io/loops) on keybase.
  • I have a public key ASATYrH7oPOUiiZdtq6B-FmAtbjCsP8ua35Ul7UXc125XAo

To claim this, I am signing this object:

@loops
loops / gist:8e95a133a07b729b1761016732b5fb3a
Created October 26, 2016 20:16
Patch for Terminix not showing terminal for a new session
Date: Wed, 26 Oct 2016 13:00:08 -0700
Subject: [PATCH] Ensure first terminal in a new session is displayed at
creation
In a new session, the initial terminal may not be displayed
resulting in a grey screen. If you then use the keyboard
shortcut to add a new terminal to the session, both it and
the initial terminal would become visible.
Date: Wed, 26 Oct 2016 13:00:08 -0700
Subject: [PATCH] Ensure first terminal in a new session is displayed at
creation
In a new session, the initial terminal may not be displayed
resulting in a grey screen. If you then use the keyboard
shortcut to add a new terminal to the session, both it and
the initial terminal would become visible.
@loops
loops / gist:2194bf4e82c67748fbe7
Created December 1, 2015 19:07
Linux system inspection tools
Netflix has a performance monitoring article...
https://media.netflix.com/en/tech-blog/linux-performance-analysis-in-60-000-milliseconds
Which references this interesting article about the USE method...
http://www.brendangregg.com/usemethod.html
# CPU
perf record -F 99 -a -g -- sleep 10; perf report -n --stdio # and flamegraphs
execsnoop # from perf-tools
turbostat