Showing posts with label crib-note. Show all posts
Showing posts with label crib-note. Show all posts

Tuesday, April 7, 2020

Crib Notes: Finding Missing Single- Or Double-Quote Pairs

So, today, was writing a BASH utility. As per normal, I have a commit-time check that runs it through shellchecker. That test came up green. However, when I ran the script if finished by complaining:


XXXXXX.sh: line 290: unexpected EOF while looking for matching `"'
Naturally, my reaction was something along the lines of:




I mean, shellchecker's usually pretty damned good about finding trivial flubs like that. So, Googled about to see if there was an easy way to double-check things. My search was fruitful – I found this cute, little snippet:
| tr -cd '"\n' | awk 'length%2==1 {print NR, $0}'
I catted my script to that pipe and, for better or worse, it agreed with shellchecker that all my single- and double-quotes were properly paired.

Monday, December 17, 2018

Crib-Notes: Tuning MTU-size on EL7-based DHCP Clients

Because:
  • One of the networks I deal with is broken
  • I have only about a 15% hit-rate of what I actually need whenever I try to re-find the info
  • most of my Google hits seem to think that using `ip link set...` is a fine, long-term solution and the ones that point to persistency referenc either nmcli or the /etc/sysconfig/network-scripts file
Need to save this here (maybe by doing so, Google will at least return this page when I need to re-search)...

To override the default MTU (in my case turning off Jumbo frames), edit the /etc/dhcp/dhclient-eth0.conf file like so:
interface eth0 {
    supersede interface-mtu 1350;
}
Reboot and everything should be fine (actually able to vi a file, use man pages, etc., without locking up my SSH session!).