Create a gzipped tar archive:
tar -czvf /path/to/file.tar.gz ./stuff-to-archive
List contents of a gzipped tar archive:
tar -ztvf file.tar.gz
Extract contents of a gzipped tar archive:
tar -zxvf file.tar.gz
Create a gzipped tar archive:
tar -czvf /path/to/file.tar.gz ./stuff-to-archive
List contents of a gzipped tar archive:
tar -ztvf file.tar.gz
Extract contents of a gzipped tar archive:
tar -zxvf file.tar.gz
Had to figure out how to do string replacement (Scott wanted to convert WMA files to similarly named MP3 files) and pass a single parameter that has spaces into a shell script.
${original_string/thing_to_find/thing_to_replace_there} does string replacement. And $@ is the unexpanded parameter set. So this wouldn’t work if we were trying to pass in more than one parameter (well, it *would* … I’d just have to custom-handle parameter expansion in the script)
“Dependency hell” used to be a big problem — you’d download one package, attempt to install it, and find out you needed three other packages. Download one of them, attempt to install it, and learn about five other packages. Fifty seven packages later, you forgot what you were trying to install in the first place and went home. Or, I suppose, you managed to install that first package and actually use it. The advent of repo-based deployments — where dependencies can be resolved and automatically downloaded — has mostly eliminated dependency hell. But, occasionally, you’ll have a manual install that says “oh, I cannot complete. I need libgdkglext-x11-1.0.so.0 or libminizip.so.1 … and, if there’s a package that’s named libgdkglext-x11 or libminizip … you’re good. There’s not. Fortunately, you can use “dnf provides” to search for a package that provides a specific file — thus learning that you need the gtkglext-libs and minizip-compat packages to resolve your dependencies.
This time, I’m writing this down so I don’t have to keep looking it up. To display some packet info to the screen while writing a network capture to a file, include the -P option (older versions of tshark used -S)
2021-04-18 13:58:58 [lisa@server ~]# tshark -f "udp port 123" -w /tmp/ntpd.cap -P Running as user "root" and group "root". This could be dangerous. Capturing on 'enp0s25' 1 0.000000000 10.x.x.x → x.x.x.18 NTP 90 NTP Version 4, client 2 3.898916081 10.x.x.x → x.x.x.199 NTP 90 NTP Version 4, client 3 7.898948128 10.x.x.x → x.x.x.20 NTP 90 NTP Version 4, client 4 7.928749596 x.x.x.20 → 10.x.x.x NTP 90 NTP Version 4, server 5 9.898958577 10.x.x.x → x.x.x.76 NTP 90 NTP Version 4, client 6 9.949450324 x.x.x.76 → 10.x.x.x NTP 90 NTP Version 4, server 7 10.898981132 10.x.x.x → x.x.x.185 NTP 90 NTP Version 4, client 8 11.009163093 x.x.x.185 → 10.x.x.x NTP 90 NTP Version 4, server
Since it’s the third time I’ve had to do this so far this year, I’m going to write down how I disable IPv6 in Fedora. Add these lines to /etc/sysctl.conf
[lisa@server~]# grep ipv6 /etc/sysctl.conf net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6=1
Then load the sysctl settings (sysctl -p) or reboot.
Without IPv6, if you do X-redirection, you may get an error indicating the redirection was refused. In journalctl, there’s an error “error: Failed to allocate internet-domain X11 display socket”. Evidently you’ve got to configure sshd to use IPv4 by setting “AddressFamily inet” in /etc/ssh/sshd_config
[lisa@server~/]# grep AddressFamily /etc/ssh/sshd_config AddressFamily inet
We’ve been seeing dropped packets on one of our servers — that usually means more data is coming in than can be processed, but it’s nice to confirm rather than guess. The command “netstat -s” displays summary statistics that are nicely grouped into causes:
TcpExt: 16 invalid SYN cookies received 88 resets received for embryonic SYN_RECV sockets 18 packets pruned from receive queue because of socket buffer overrun 2321 ICMP packets dropped because they were out-of-window 838512 TCP sockets finished time wait in fast timer
Evolution has the most microscopic text. Scott literally picks his computer up sometimes just so he can read the message. You get a lot of text on the screen … I guess. But it’s not really useful if you cannot read it.
(1) There’s a system-wide default font in KDE. Under the Fonts, there are setting for “small”, “toolbar”, “menu”, “window title” … they seem to default to 10 points (8 for small). That’s rather small on a high-resolution monitor.
(2) In Evolution, select Edit > Preferences
Select Mail Preferences from the left sidebar. Untick the box “Use the same fonts as other applications” and then pick a bigger font. This only changes the message text — the from/subject/date and folder structure are still using the system font.
Create partition, format, find UUID, and add line to fstab to mount the volume
[lisa@linuxhost ~]# parted /dev/sdb
GNU Parted 3.2.153
Using /dev/sdb
Welcome to GNU Parted! Type ‘help’ to view a list of commands.
(parted) mklabel GPT
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? y
(parted) mkpart primary 2048s 100%
(parted) q
Information: You may need to update /etc/fstab.
[lisa@linuxhost ~]# mkfs.xfs -f /dev/sdb1
meta-data=/dev/sdb1 isize=512 agcount=4, agsize=163839872 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=655359488, imaxpct=5
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=319999, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[lisa@linuxhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1G 0 part /boot
└─sda2 8:2 0 19G 0 part
├─fedora-lisa 253:0 0 17G 0 lvm /
└─fedora-swap 253:1 0 2G 0 lvm [SWAP]
sdb 8:16 0 2.5T 0 disk
└─sdb1 8:17 0 2.5T 0 part
sr0 11:0 1 650M 0 rom
[lisa@linuxhost ~]# blkid | grep sdb1
/dev/sdb1: UUID=”801ebed3-ddd6-459d-bd62-04a0a75f91b8″ TYPE=”xfs” PARTLABEL=”primary” PARTUUID=”b9a9a340-28f5-4efb-b649-af804ef5bc4c”
Add a line to /etc/fstab to mount the volume — here I’m mounting it to /mnt/data/mythtv:
UUID=801ebed3-ddd6-459d-bd62-04a0a75f91b8 /mnt/data/mythtv xfs defaults 0 0
To change the default shell without root access, use chsh. You will need to use a valid shell. To obtain a list, run ” chsh –list-shells”
Once you have the proper path for your preferred shell, use chsh with the –shell option. For example, to use the Korn shell as default, run “chsh –shell /bin/ksh username”
You can, of course, use –exclude and avoid adding the .git folders to your tar archive, but I discovered a really cool option that excludes the folders created by a whole host of version control systems:
--exclude-vcs
Which, as of version 1.32, means excluding CVS, RCS, SCCS, git, SVN, Arch, Bazaar, Mercurial, and Darcs as follows: