[gentoo-user] script help - removing newlines
I have text files that are sometimes; property "something" comment "whatever" but sometimes there are newline characters in the comment field; property "something" comment "something something else a third thing" I want to replace any newlines between 'comment "' and the next '"' with spaces so the whole comment is on a single line. How can it be done?
Re: [gentoo-user] NAS suggestions for home user
On Fri, Oct 1, 2021 at 9:39 AM Wols Lists wrote: > > On 01/10/2021 17:08, Mark Knecht wrote: > > This old machine is now about 10 years old. It's a big Cooler Master > > case, 6 or 8 removable drive bays, heavy. It collects dust and > > sometimes the fans are quite noisy. If I was going this direction > > I think I'd have to tear the whole thing down, redo the case fans at > > least. If I did all that then I think I'd use it for the new machine, > > but you do have a point. > > Okay, get your new disk drive, stick it in your old server, put btrfs on > it, learn to play with the backups etc. You can hoover out the inside at > the same time, and possibly replace the fans - they might be noisy > because the bearings are shot. > > There's no reason why your backup drive has to be in a different machine > (other than the physical safety of it being separate), so play with it > as part of your current machine. Learn btrfs, learn rsync, learn all > that stuff. > > (Your case sounds a bit like the N300 I've just bought. I want to put a > whole load of 1TB drives in it as a raid testbed - you might have > noticed my name on the raid wiki :-) > > The other thing, if you are interested and happy with just one disk not > raid, look at getting one of these HOST MANAGED shingled drives, and use > a log-structured file system. Again, I don't know anything about these > other than what they are, but for backups it should be a good and > reasonably cheap solution. > > If you want to go down the pi route, I think you can get little cases, > and I've got a USB thingy into which you can plug two drives. But at > about £30-40 each, that's $100 for hardware over and above your drive. > I'd recycle the old machine :-) > > Cheers, > Wol > So here I am reporting back after a couple of months of not working on this task. I dug around in the garage and found an old i5 Clarksdale machine that literally hadn't been turned on since we sold a house back in about 2013. Unboxed it, cleaned it up a bit, took out all the old hard drives, the CD and the floppy and put in 2 500GB WD Enterprise drives I had sitting here from a previous upgrade. Darned if the machine didn't boot right up from a FreeNAS (now TrueNAS Core) flash drive. I installed the OS to a second USB thumb drive, booted the machine, created a 500GB ZFS mirrored pool, created a user directory and 3 hours later I'm doing backups. So far it's done 30GB of about 450GB and just seems to be humming along nicely. CPU usage is only about 5% most of the time. The processor is only 2 cores, 4 threads, but most of the time it's only using about 5% CPU. No idea how stable it will be but the computer itself was always a good machine 10 years ago so I'll keep my fingers crossed and see how it goes. I'll be adding a SSD front end cache to the storage pool later this week and will likely move the OS to something internal (SSD or maybe an old HDD) as I don't like the idea of depending on a USB boot. Cheers, Mark Anyone looking for some similar solution so far I really couldn't be happier with how easy it was to get this up and running.
Re: [gentoo-user] Bash prompt colours
Am Tue, Dec 07, 2021 at 10:26:11AM -0700 schrieb Grant Taylor: > Some drive-by after-the-fact comments: > > On 12/6/21 4:03 PM, Frank Steinmetzger wrote: > > [ "$MC_SID" ] && PS1_JOBS_COUNT="${PS1_JOBS_COUNT}MC " > > [ "$RANGER_LEVEL" ] && PS1_JOBS_COUNT="${PS1_JOBS_COUNT}R " > > I've taken to using things like the following: > >PS1_JOBS_COUNT="${PS1_JOBS_COUNT}${MC_SID:+MC }${RANGER_LEVEL:+R }" > > Leverage Bash's (and Zsh's) expansion conditional. If the variable is set, > then expand it to a different value. By jove, you’re right. Maybe I’ve written that stuff before I knew about default values. I checked in that code in September of 2016. And it could possibly be even much older, because I clean up my config git repository only very sporadically, as in two or three times a year. >${VARIABLE:+alternate text to show if VARIABLE is set} > > > if [[ -z "$PROMPT_COMMAND" ]]; then > > PROMPT_COMMAND=__jobsprompt > > else > > PROMPT_COMMAND="$PROMPT_COMMAND ; __jobsprompt" > > fi > > Is there a reason to not simply do the following, eliminating the if > conditional: > >PROMPT_COMMAND=${PROMPT_COMMAND:+${PROMPT_COMMAND} ; __jobsprompt} Maybe inexperience? :D Or sometimes, explicit is better than implicit? -- Grüße | Greetings | Qapla’ Please do not share anything from, with or about me on any social network. I had a problem and used Java. Now I have a ProblemFactory. signature.asc Description: PGP signature
Re: [gentoo-user] Bash prompt colours
Some drive-by after-the-fact comments: On 12/6/21 4:03 PM, Frank Steinmetzger wrote: [ "$MC_SID" ] && PS1_JOBS_COUNT="${PS1_JOBS_COUNT}MC " [ "$RANGER_LEVEL" ] && PS1_JOBS_COUNT="${PS1_JOBS_COUNT}R " I've taken to using things like the following: PS1_JOBS_COUNT="${PS1_JOBS_COUNT}${MC_SID:+MC }${RANGER_LEVEL:+R }" Leverage Bash's (and Zsh's) expansion conditional. If the variable is set, then expand it to a different value. ${VARIABLE:+alternate text to show if VARIABLE is set} if [[ -z "$PROMPT_COMMAND" ]]; then PROMPT_COMMAND=__jobsprompt else PROMPT_COMMAND="$PROMPT_COMMAND ; __jobsprompt" fi Is there a reason to not simply do the following, eliminating the if conditional: PROMPT_COMMAND=${PROMPT_COMMAND:+${PROMPT_COMMAND} ; __jobsprompt} -- Grant. . . . unix || die
RE: [gentoo-user] Steam overlay
Nope. Check dmesg. Check syslog. Try launching the game from a terminal. Even Steam games usually give *some* kind of hint. LMP -Original Message- From: Alan Grimes Sent: Monday, December 6, 2021 11:59 PM To: Gentoo User Subject: [gentoo-user] Steam overlay CAUTION: This is an EXTERNAL email. Do not click links or open attachments unless you recognize the sender and know the content is safe. Anyone have any idea why 90% of my steam games now instantly crash to desktop with no error message or anything? -- Beware of Zombies. =O #EggCrisis #BlackWinter White is the new Kulak. Powers are not rights.