|
BrainDance posted:It's a whole event and I wouldn't be surprised if that process broke something, or if the data just had those weird character codes. Is there anything I could do with sed or something that would just strip it of any weird character codes? I'm not sure how to word that, but you know, stuff that isn't just... normal? I once had to use find to search any files with unusual characters, I suspect grep or sed would support similar character set searches. code:
|
# ? Feb 18, 2023 06:49 |
|
|
# ? May 24, 2024 14:50 |
|
Saukkis posted:I once had to use find to search any files with unusual characters, I suspect grep or sed would support similar character set searches. Thanks, this got me started on the right path, managed to do it with sed code:
So, then I just took the working Shakespeare example and appended the daodejing to the bottom of it and tried that, and it started training. Then I deleted all the Shakespeare stuff and left the daodejing... and it trained. Which left only the validation file. I was using one example for each for the validation file. So one verse of the daodejing or one message from the chat logs. The Shakespeare validation file is longer because Shakespeare just is longer than a verse from the very short daodejing. And, in the end, basically it turns out there is a minimum length for the validation file. This is not documented anywhere, because the documentation for this is all kinda garbage, but yeah that seems to be what it was.
|
# ? Feb 18, 2023 09:48 |
|
BrainDance posted:That actually seems like it might be something. The other text, it's ripped from chat logs. The chat logs are from a Chinese chat program though that sometimes formats things weird (like weird apostrophes.) I've built a whole process for cleaning them up, like, for the chat logs For later, you could also try piping it through iconv and converting it to something minimal - ASCII//IGNORE should keep the US-ASCII characters and just drop the rest, or you can try //TRANSLIT and see how that interprets things. (I have no idea what translit would do with chinese characters.)
|
# ? Feb 19, 2023 13:47 |
|
I'm having a super annoying issue I've not been able to fix consistently since it started happening. I have an Elgato XLR interface with audio output and (obviously) an XLR-microphone input. However, the microphone works intermittently. It won't even act like it's receiving sometimes. I usually don't notice it isn't working until I'm under time pressure to talk to someone on Discord -- the microphone won't work. It shows up in Alsamixer and is unmuted, and the only "consistent" way I can resolve the issue is by opening pavucontrol and switching the XLR Usb Audio Configuration from Digital Out + Mono Input to Analog Out + Mono Input back and forth like 10x-20x, then sometimes, sometimes, the microphone will spontaneously begin to function normally. I've tried so many things. I've tried adding snd-usb-audio to alsa-config, One time opening pulse meter just fixed it, like it woke it up from some sleep state? One time, unlocking and locking the input channels fixed it. One time, I couldn't fix it without restarting my machine three times. It works fine in Windows and MacOS. I'm so desperate I started asking ChatGPT what other poo poo it could think of to try and resolve it. I just disabled usb power management, I think? I don't even know man. I will literally try anything at this point. (I really don't want to replace it because the microphone really wants 60db lift and the interface provides it and it sounds like anything else I'd get I'd have to pair it with a cloudlifter pre-amp or something). I guess I could just tear it all out and sell it or something (the microphone and interface),, Oh it's happening in Ubuntu and Arch but seems to be mostly present under Gnome de, and it doesn't care if I'm using pulseaudio or pipewire (I assume because it's using pipewire-pulse) (just using ALSA doesn't fix it either). I haven't tried running a JACK only environment, and I don't... really want to especially for literally no reason.
|
# ? Feb 20, 2023 05:24 |
|
Thanks for all the previous help. Why in hell is it that if, say, I want to delete all the pdf files in a directory, I can simply invoke code:
code:
|
# ? Feb 26, 2023 20:08 |
|
find . -type f -iname "*.mp4" -delete Leave off the delete flag flag first time if you want to check what will be remove. Add a -maxdepth 0 if you don't want to search subfolders. The find command is massively powerful and all linux admins should master its ways.
|
# ? Feb 26, 2023 20:26 |
|
F_Shit_Fitzgerald posted:Thanks for all the previous help. Neither of those snippets are working the way you are expecting them to, actually. In the first example you are doing shell expansion for all files "*.pdf" in the directory, and then running "rm *.pdf" to delete everything if the test returns true ("[ -f FILE]" is to check if a file exists and is a regular file). I'm not sure why your second example wouldn't have the same result to be honest, but why even set up a for loop for this when you are just running "rm *.mp4"? In your example you're trying to delete everything matching "*.mp4" for each element you iterate over in the loop of files matching the pattern "*.mp4". When setting up a loop you should use the variable you have assigned to operate on the current element: code:
|
# ? Feb 26, 2023 20:28 |
|
F_Shit_Fitzgerald posted:Thanks for all the previous help. What do you want that isn't done by "rm -f *.mp4" ?
|
# ? Feb 26, 2023 20:29 |
|
rm -f *.mp4 is perfect! I didn't realize it could be that simple; I thought you had to set up a conditional for each file type. Thanks! Still a lot I have to learn about Bash.
F_Shit_Fitzgerald fucked around with this message at 20:56 on Feb 26, 2023 |
# ? Feb 26, 2023 20:46 |
|
I'd leave off the -f flag. Most of the time it's not required, such as here, and it increases the risk of pain should an rm command ever be typed wrong. Generally speaking I only ever use it to delete a non-empty directory.F_Shit_Fitzgerald posted:rm -f *.mp4 is perfect! I didn't realize it could be that simple; I thought you had to set up a conditional for each file type. Thanks! Still a lot I have to learn about Bash. Pablo Bluth fucked around with this message at 21:03 on Feb 26, 2023 |
# ? Feb 26, 2023 20:59 |
|
To save yourself looking into the abyss use a real programming language for scripts if they get longer than several lines of bash. Its great for quick one off stuff, not so much for medium-large scripts.
|
# ? Feb 26, 2023 21:00 |
|
If that's the case, I might keep it, actually. I do volunteer work that uses a variety of different file types - docx, pdf, mp4 - and this script is intended to only clean out old files of the specific type while preserving other files (e.g: text files, subdirectories, etc).
|
# ? Feb 26, 2023 21:03 |
|
F_Shit_Fitzgerald posted:If that's the case, I might keep it, actually. I do volunteer work that uses a variety of different file types - docx, pdf, mp4 - and this script is intended to only clean out old files of the specific type while preserving other files (e.g: text files, subdirectories, etc). Delete files 7 days old, https://unix.stackexchange.com/a/447363 code:
Throw in in a systemd unit timer to really piss off grey beards
|
# ? Feb 26, 2023 21:09 |
This is exactly the kind of thing chatGPT will spit out for you by the way if you ask it.quote:"write a bash script to remove all files in a directory older than 7 days" You can even ask it to tweak it. quote:"change the script so it asks the user what type of file to be removed"
|
|
# ? Feb 26, 2023 21:18 |
|
Pablo Bluth posted:I'd leave off the -f flag. Most of the time it's not required, such as here, and it increases the risk of pain should an rm command ever be typed wrong. Generally speaking I only ever use it to delete a non-empty directory. rm without "-f" will throw an error if there is no matching file. And to delete a directory you would use "-r", just "-f" doesn't work.
|
# ? Feb 27, 2023 19:31 |
|
hazzlebarth posted:rm without "-f" will throw an error if there is no matching file. And to delete a directory you would use "-r", just "-f" doesn't work.
|
# ? Feb 27, 2023 19:59 |
hazzlebarth posted:rm without "-f" will throw an error if there is no matching file. And to delete a directory you would use "-r", just "-f" doesn't work. Isn't it better to wrap it up with an code:
|
|
# ? Feb 27, 2023 20:01 |
|
You can't accidentally rm -rf / It specifically detects that and forces you to add a flag saying "I meant to do that"
|
# ? Feb 27, 2023 20:02 |
Tesseraction posted:You can't accidentally rm -rf / I think code:
|
|
# ? Feb 27, 2023 20:05 |
|
You're correct, although I'd argue that's a weirder error to make. Also I need to reinstall my Debian WSL.
|
# ? Feb 27, 2023 20:06 |
|
rm -rf ${path variable_i_forgot_to_set}/* would thus be a command of doom... (or you type a path with a space and forget to quote/escape it)
Pablo Bluth fucked around with this message at 20:12 on Feb 27, 2023 |
# ? Feb 27, 2023 20:09 |
Nitrousoxide posted:I think
|
|
# ? Feb 27, 2023 21:13 |
|
rm -rf /* is at most a nuisance. Nothing that can't be fixed with a reinstall. rm -rf somedir * while in <home>, now that's scary poo poo. Because in <home> the important files are located. Of course, <home> also is most likely to be backed up, so if you did your homework, that too can be just a minor nuisance.
|
# ? Feb 27, 2023 21:51 |
|
Volguus posted:rm -rf /* is at most a nuisance. Nothing that can't be fixed with a reinstall. rm -rf somedir * while in <home>, now that's scary poo poo. Because in <home> the important files are located. Of course, <home> also is most likely to be backed up, so if you did your homework, that too can be just a minor nuisance. Well the expansion of /* will include /home so it'll eventually delete the same stuff as doing rm -rf * in your home directory would. It's just a question of how long it runs before you stop it E: on another note, will `cp /dev/sda /dev/sdb` clone a drive?
|
# ? Feb 27, 2023 22:36 |
/home/ is a symlink. /usr/home/ is the correct directory.
|
|
# ? Feb 27, 2023 23:10 |
|
VostokProgram posted:Well the expansion of /* will include /home so it'll eventually delete the same stuff as doing rm -rf * in your home directory would. It's just a question of how long it runs before you stop it Yes, the key word in here is "eventually". Depending on how fast your fingers are and how fast the drive is ... you may get lucky and <home> may escape untouched. When you're already in <home>, using a nvme drive, after you had a few beers, the odds are very much not in your favour. Don't ask how I know.
|
# ? Feb 27, 2023 23:16 |
|
I once did the opposite and filled a directory with so many zero size files (a horribly broken script written in a rush and left running on a server overnight at work. I recall it got somewhere past the 100 million mark), attempting to do anything bought the system to a halt, despite being a high performance Panasas system. Find's delete was the only thing that would touch it without the process immediately freezing. Find has been my goto tool ever since....
|
# ? Feb 27, 2023 23:32 |
|
Pablo Bluth posted:I once did the opposite and filled a directory with so many zero size files (a horribly broken script written in a rush and left running on a server overnight at work. I recall it got somewhere past the 100 million mark), attempting to do anything bought the system to a halt, despite being a high performance Panasas system. Find's delete was the only thing that would touch it without the process immediately freezing. Find has been my goto tool ever since.... It's almost funny how quickly Panasas shits the bed if a directory has "too many" files. All these specific optimisations for throughput and 65536 is enough to bring stuff to a crawl.
|
# ? Feb 27, 2023 23:38 |
|
Pablo Bluth posted:rm -rf ${path variable_i_forgot_to_set}/* would thus be a command of doom... (or you type a path with a space and forget to quote/escape it) The Moodle service at my university got destroyed, because the admin accidentally right-clicked a PuTTY window and pasted a bash script to a rooted terminal with 'rm -rf $variable/' in it.
|
# ? Feb 28, 2023 01:24 |
VostokProgram posted:Well the expansion of /* will include /home so it'll eventually delete the same stuff as doing rm -rf * in your home directory would. It's just a question of how long it runs before you stop it I think the real question is whether it would nuke the binary for rm or some other mission critical system dependency before it gets to /home
|
|
# ? Feb 28, 2023 03:30 |
|
Nitrousoxide posted:I think the real question is whether it would nuke the binary for rm or some other mission critical system dependency before it gets to /home as long as the rm command is still running, the binary still referenced in /proc/$PID/exe and so still resident in memory and will still happily run until completion, as far as i know
|
# ? Feb 28, 2023 03:35 |
|
The first sign of problems is usually "ls not found? what the gently caress, how??"
|
# ? Feb 28, 2023 04:11 |
|
Saukkis posted:The Moodle service at my university got destroyed, because the admin accidentally right-clicked a PuTTY window and pasted a bash script to a rooted terminal with 'rm -rf $variable/' in it. Ugh, that is a stupid setting in PuTTY then. Other ssh clients at least have a confirmation window when pasting multi-line text.
|
# ? Feb 28, 2023 13:50 |
|
I stopped using putty once Windows Terminal + WSL2 became solidly mature. It just works so well, and WinTerm does the multi-line paste warning.
|
# ? Feb 28, 2023 14:09 |
|
VostokProgram posted:E: on another note, will `cp /dev/sda /dev/sdb` clone a drive? Depending on the kind of drive you probably want some flavor of: code:
code:
|
# ? Feb 28, 2023 16:04 |
|
AlexDeGruven posted:I stopped using putty once Windows Terminal + WSL2 became solidly mature. It just works so well, and WinTerm does the multi-line paste warning. It still doesn't handle something about deleting or overwriting right when connected to FreeBSD, so I keep putty around just to save me the frustration of trying to edit a line from history while the rendering on screen is a couple of characters off.
|
# ? Feb 28, 2023 20:17 |
|
Computer viking posted:It still doesn't handle something about deleting or overwriting right when connected to FreeBSD, so I keep putty around just to save me the frustration of trying to edit a line from history while the rendering on screen is a couple of characters off. That's fair. I only ever connect to Linux, so it's worked perfectly for me for a while.
|
# ? Feb 28, 2023 22:17 |
|
This is a question about ffmpeg. I don't know where else in the forums to ask it. I've got this HEVC mkv file and I'm trying to convert it to H.264 using the h264_v4l2m2m codec. The following works fine: code:
code:
code:
code:
code:
|
# ? Mar 1, 2023 00:25 |
|
I've been messing around with Pop OS and just like people said Steam games run pretty well with Proton enabled. However, I have noticed that the games have a bad habit of "hitching" every second or so. Any suggestions on what to look into first? I have an Nvidia GPU and I'm using the driver that was suggested in the built in Pop OS app store. Also, if there's a better place to ask about this please let me know.
|
# ? Mar 1, 2023 21:35 |
|
|
# ? May 24, 2024 14:50 |
|
McCracAttack posted:I've been messing around with Pop OS and just like people said Steam games run pretty well with Proton enabled. However, I have noticed that the games have a bad habit of "hitching" every second or so. Any suggestions on what to look into first? I have an Nvidia GPU and I'm using the driver that was suggested in the built in Pop OS app store. Start with a look at the system journal with journalctl to see if anything obvious is happening. Helpful options: -b -p4 = events since last reboot, priority 4 or higher (weeds out unimportant junk) --follow = monitor the journal live, if you have multi-monitor you could watch a console window while playing a game You could also try to narrow down whether it's steam or the system in general by trying out lutris, or finding a linux-native game. there's a linux gaming thread
|
# ? Mar 1, 2023 22:17 |