Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Alternatively, you could write a fairly simple script in bash/perl/python to iterate over all the files in the target directory, using tar's append option to add a file one at a time until the tar file exceeds the defined maximum size, t which point you start a new tar archive.

Depending on how strict you need to be about the tar size, you could set the size limit conservative so the resultant tar is always likely to be below your hard limit, or when the tar exceeds the limit delete the last file added, and start the new tar with that file.

Adbot
ADBOT LOVES YOU

some kinda jackal
Feb 25, 2003

 
 
All good, I really appreciate the additional advice. The fs and contents of this artifact are something I thankfully have control over, and these will ultimately still be used as a batch together so I’m ok with the underlying risks. The tool seems to have generated exactly what I need so I’ll pin this one for now :)

Tea Bone
Feb 18, 2011

I'm going for gasps.
I've got a bunch of audio files which I'd like to trim the first 18 seconds and last 36 seconds from.

I'm using:
code:
ffmpeg -ss 18 -i input.mp3 output.mp3
to cut the start and that works fine. But cutting the end off is proving tricky. I know I can specify -t in ffmpeg to set the duration but all the files are a different length and don't really want to manually work out the end point for all of them. Basically I want an equivalent to -sseof to set the end point. Or is there a better way of doing this?

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.
Script it, using ffprobe to get the duration in seconds prior to using ffmpeg to trim?

Tea Bone
Feb 18, 2011

I'm going for gasps.

Pablo Bluth posted:

Script it, using ffprobe to get the duration in seconds prior to using ffmpeg to trim?

Yeah I figured that's my next step. I'm not 100% comfortable with bash scripting but I can work it out. I just wanted to check I'm not missing a simple flag to make it a one-line command, .

Pablo Bluth
Sep 7, 2007

I've made a huge mistake.

Tea Bone posted:

Yeah I figured that's my next step. I'm not 100% comfortable with bash scripting but I can work it out. I just wanted to check I'm not missing a simple flag to make it a one-line command, .
Comedy option: trim start, use a filter to reverse the audio, trim the start, reverse the audio back to the correct direction.

Tea Bone
Feb 18, 2011

I'm going for gasps.

Pablo Bluth posted:

Comedy option: trim start, use a filter to reverse the audio, trim the start, reverse the audio back to the correct direction.

I'm ashamed to admit I actually started down that path before posting here and realising there had to be a better way! Anyway, it looks like sox does the trick nicely, for some reason I just got hung up thinking ffmpeg had to be the answer.

RFC2324
Jun 7, 2012

http 418

Pablo Bluth posted:

Comedy option: trim start, use a filter to reverse the audio, trim the start, reverse the audio back to the correct direction.

this is the only correct answer

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe
Are Nvidia drivers really that bad in Linux? I use wayland and do some occasional gaming in Linux, but mostly code and internet. I have a separate windows partition for actual gaming that I use occasionally & AMD drivers are such crap (in windows) that I almost want to try my luck with Nvidia.

Kamrat
Nov 27, 2012

Thanks for playing Alone in the dark 2.

Now please fuck off
Nvidia works but you'll be behind the times when it comes to features and stuff is generally more broken.

If you game mostly on windows it doesn't really matter.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

some kinda jackal posted:

I have a really weird problem I'm trying to solve with hopefully built in tools..

Is there a way to take a folder, create a tar file of said folder, but have that tar file be limited to a specific filesize so it creates subsequent tar files if necessary, BUT (and this is the part I can't figure out) each tarfile itself is a fully standalone package, that is to say doesn't truncate or split files across tarfiles.

So I can do something like

tar --tape-length=90000 -M -c --file=mytar{1..99}.tar SOURCEFOLDER

and it'll create mytar1.tar, mytar2.tar, mytar3.tar, but the binaries which are caught at the tape limit are basically truncated and continue in the next.

My goal here is to be able to take each tar file as its own artifact independent of the others, so this kind of relies on tar saying "oh yeah ok this next file won't fit in my size limit so it'll go in the next tar". In my ideal scenario, I could take mytar1.tar and extract it without mytar2 or 3, or do the same with 2 without 1 and 3 and the only consequence would be missing files, but not missing in the sense that half of it exists in this tar and it failed to materialize because the other half isn't available. Essentially all files would live 100% in one tar or another, not on the boundary.

I'm articulating this beyond terribly but hopefully someone gets WHAT I'm trying to accomplish, if not why. The reason is really esoteric and specific to some tooling I have to conform to.



This would be a good whiteboard question to interview programmers

Volguus
Mar 3, 2009

a dingus posted:

Are Nvidia drivers really that bad in Linux? I use wayland and do some occasional gaming in Linux, but mostly code and internet. I have a separate windows partition for actual gaming that I use occasionally & AMD drivers are such crap (in windows) that I almost want to try my luck with Nvidia.

There was a period a bunch of years ago that for a few months the nvidia drivers on linux had issues. Other than that, I've been using nvidia drivers (the proprietary ones) on linux for 20 years now and they've been top notch always. However, they dragged their heels on wayland support. The latest versions are really good though (510.54). Wayland works flawlessly in Gnome on nvidia, it's not quite there in KDE, but still usable. Therefore I'm right now on Xorg since gently caress gnome, even though wayland scaling for 4k is a lot better than X11.

Windows games, those that work, work fine. I play Diablo and WoW and a smattering of other smaller games and they work fine. The main issue with nvidia drivers is when the kernel gets an update they need to be recompiled. If you have it setup correctly, such as having them registered with dkms or akmod so that they recompile on new kernels, usually you're set. Sometimes though, these automatic kernel modules systems fail and you can be left with a black screen when trying to boot it. Sometimes, their drivers do not compile on new-enough kernels, so that can be a pita to fix, but if they're pulled in from packages there are usually no issues.

Nvidia drivers are "bad" because they're not open source and therefore nobody can fix them if something goes wrong. Their lag on supporting the needed libraries for Wayland was again a sticky point. For Nvidia these things don't matter though, since fixing them didn't make them any more money therefore were never a priority. They make their money from Hollywood, who are running server rendering farms on Linux/FreeBSD therefore those needs were prioritized. And with Optimus ... they really gave the finger to linux, though from what I've heard it's usable nowadays just fine.

But the drivers themselves are (and always were) above AMDs in terms of quality, stability and performance.

Computer viking
May 30, 2011
Now with less breakage.

Bob Morales posted:

This would be a good whiteboard question to interview programmers

Doing it optimally is some sort of variation over the knapsack problem and thus NP-complete, I think?

On the other hand, finding a simple good-enough solution sounds like a fertile field. :)

ExcessBLarg!
Sep 1, 2001

Computer viking posted:

Doing it optimally is some sort of variation over the knapsack problem and thus NP-complete, I think?
Sure but it's probably not so many files that the search space is that large. Or if it is the files are probably small enough that not much effort is needed to get close to optimal.

a dingus
Mar 22, 2008

Rhetorical questions only
Fun Shoe

Volguus posted:

Nvidia stuff

Thanks dude! And everyone else as well. If I get the opportunity to grab a newer Nvidia card I may jump on it.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Computer viking posted:

Doing it optimally is some sort of variation over the knapsack problem and thus NP-complete, I think?


Yea. I just want to hear some dumb answers and see some embarrassingly bad code for the take home assignment

some kinda jackal
Feb 25, 2003

 
 
oh well now I feel like I have to write an awful implementation of this

Mr. Crow
May 22, 2008

Snap City mayor for life

Volguus posted:

But the drivers themselves are (and always were) above AMDs in terms of quality, stability and performance.

This is utter horse poo poo nvidia drivers have been utterly terrible for the past several years, even on windows.

They've significantly dropped in quality from the halcyon days.

Volguus
Mar 3, 2009

Mr. Crow posted:

This is utter horse poo poo nvidia drivers have been utterly terrible for the past several years, even on windows.

They've significantly dropped in quality from the halcyon days.

That has not been my experience at all. It's true, it's only anecdotal since I don't have the desire, time and money (and frankly I don't really care) to fund a scientific study on how horseshit they are now compared with <x> years ago, but, for me, they have been getting better and better. On linux, as that's all I can speak about.

If you do have data from such a study, by all means, share it with the class. It won't make me buy an AMD card anytime soon, but it may convince others.

Computer viking
May 30, 2011
Now with less breakage.

some kinda jackal posted:

oh well now I feel like I have to write an awful implementation of this

I have several quarter-baked ideas and I'm halfway tempted to create a data set from my fileserver and see how they work out.

e:
code:
> files = list.files(path.expand("~"), recursive = TRUE)
> sizes = unname(sapply(files, file.size))
> str(sizes)
 num [1:17039] 1088353 39552 1849 211335 209745 ...
> summary(sizes)
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
        0       552      1935    464254     13818 199931726 
Yeah that'll do nicely.

It's my windows Documents directory, instead - faster to scan through and large enough.
Copy here.

Computer viking fucked around with this message at 22:07 on Mar 11, 2022

RFC2324
Jun 7, 2012

http 418

Volguus posted:

That has not been my experience at all. It's true, it's only anecdotal since I don't have the desire, time and money (and frankly I don't really care) to fund a scientific study on how horseshit they are now compared with <x> years ago, but, for me, they have been getting better and better. On linux, as that's all I can speak about.

If you do have data from such a study, by all means, share it with the class. It won't make me buy an AMD card anytime soon, but it may convince others.

the in-kernel-tree drivers is what has convinced me my next video card will probably be AMD

Volguus
Mar 3, 2009

RFC2324 posted:

the in-kernel-tree drivers is what has convinced me my next video card will probably be AMD

That's true, that's absolutely the major advantage for AMD. No more akmod/dkms shenanigans. For me that's not an issue (plus I need CUDA), but I can understand those for which it is.

RFC2324
Jun 7, 2012

http 418

Volguus posted:

That's true, that's absolutely the major advantage for AMD. No more akmod/dkms shenanigans. For me that's not an issue (plus I need CUDA), but I can understand those for which it is.

I use opensuse tumbleweed, so its not an issue of dkms shennanigans, its that they don't release the drat driver updates at the same cadence as kernel updates, so everytime a kernel update comes out it break video for a week or two.

new kernel updates come out quite frequently in a rolling release

ExcessBLarg!
Sep 1, 2001

Computer viking posted:

Yeah that'll do nicely.
I hope you show up to an interview someday and use R as your "language of choice" for operations scripts.

I mean, I love R. Well, I wouldn't say "love"--we have a complicated relationship.

spiritual bypass
Feb 19, 2008

Grimey Drawer
I'm writing an http server. Should I log incoming requests to stdout or stderr?

BlankSystemDaemon
Mar 13, 2009




You should log to syslog and let it decide what to do about it using the severity, tag and facility control syslog has.

I assume you're writing a httpd as a learning exercise?

RFC2324
Jun 7, 2012

http 418

BlankSystemDaemon posted:

You should log to syslog and let it decide what to do about it using the severity, tag and facility control syslog has.

I assume you're writing a httpd as a learning exercise?

This. Log to the unified logger.

Also, don't use log4j, tia

ExcessBLarg!
Sep 1, 2001

cum jabbar posted:

I'm writing an http server. Should I log incoming requests to stdout or stderr?
I would use stdout for request-level tracing (optionally, with a -v argument) and use stderr for daemon-level errors. This lets you redirect them separately to an access.log and error.log if you manually invoke the server. If you were to make it a service, then on Linux journald will vacuum up both.

For portability you could consider using syslog(3) instead, but that's not as convenient if your primary use is running the server in the foreground. Jourmald also vacuums up syslog(3) so it would be functionally equivalent, particularly if you include <> levels in your messages.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

cum jabbar posted:

I'm writing an http server. Should I log incoming requests to stdout or stderr?

You're own log file in some nonstandard location

KozmoNaut
Apr 23, 2008

Happiness is a warm
Turbo Plasma Rifle


Log the text represented as graphics to giant .BMP files in a hidden subfolder of the user's home folder, with a name that is entirely unrelated to the name of your httpd.

RFC2324
Jun 7, 2012

http 418

Bob Morales posted:

You're own log file in some nonstandard location

/Var/opt/obscura/files/data/logs

Happy Litterbox
Jan 2, 2010

Bob Morales posted:

You're own log file in some nonstandard location

As is industry standard. Alternatively just shoot it into the void. I have found no log at all very compelling to troubleshoot.

Mega Comrade
Apr 22, 2004

Listen buddy, we all got problems!

Volguus posted:


Nvidia drivers are "bad" because they're not open source and therefore nobody can fix them if something goes wrong. Their lag on supporting the needed libraries for Wayland was again a sticky point. For Nvidia these things don't matter though, since fixing them didn't make them any more money therefore were never a priority. They make their money from Hollywood, who are running server rendering farms on Linux/FreeBSD therefore those needs were prioritized. And with Optimus ... they really gave the finger to linux, though from what I've heard it's usable nowadays just fine.

But the drivers themselves are (and always were) above AMDs in terms of quality, stability and performance.

No they are "bad" because they are bad. I don't give a crap about 'open source vs propriety' I'll use whatever works better.

Ive had both cards over the years and it used to be that Nvidia was bad but atleast performed ok while AMD were bad and performed like trash. But since AMD threw everything out and started fresh its been much better, slowly catching up to the point now where the linux drivers out perform the windows ones in some games.
With my 1070 it was a constant hassle of fighting the drivers at every turn, wayland performing like dog poo poo and having to manually fix so many games. Now I'm on a 5700XT, everything just works, even better it works best with the built in kernel mesa drivers, I don't have to do anything.

I'm not gonna defend AMD on windows, their drivers still suck over there but if you are Linux only then I see no reason to even consider an nvidia card as it stands.

Mega Comrade fucked around with this message at 18:01 on Mar 12, 2022

Methanar
Sep 26, 2013

by the sex ghost

cum jabbar posted:

I'm writing an http server. Should I log incoming requests to stdout or stderr?

log to stdout, run your app in a container and let god sort it out

Mr. Crow
May 22, 2008

Snap City mayor for life

Volguus posted:

That has not been my experience at all. It's true, it's only anecdotal since I don't have the desire, time and money (and frankly I don't really care) to fund a scientific study on how horseshit they are now compared with <x> years ago, but, for me, they have been getting better and better. On linux, as that's all I can speak about.

If you do have data from such a study, by all means, share it with the class. It won't make me buy an AMD card anytime soon, but it may convince others.

I mean my experiences are also anecdotal; I find it highly unlikely anyone had done a video driver stability study or how you would even do one, there's so many moving parts... But the gist I've seen and personally experienced is that people are increasingly annoyed with nvidia driver quality.

I was trying to find a video I thought GN or LTT or Hardware Unboxed or one of the big tech channels did on geforce experience but either I'm imagining it or I can't find it, its a trifecta of buzz words pulling up a lot of garbage in search.

Certainly though if your gaming on linux and is the way to go, I've never heard someone say they're happy with the nvidia linux experience.

BlankSystemDaemon
Mar 13, 2009




KozmoNaut posted:

Log the text represented as graphics to giant .BMP files in a hidden subfolder of the user's home folder, with a name that is entirely unrelated to the name of your httpd.
The complete lack of steganography and home-rolled encryption makes this not worth doing; if you gotta have bad ideas, you need to be sure you hit as many of them as possible.

Crack
Apr 10, 2009
I started dualbooting arch a few days ago with a 3080 as windows was really starting to irritate, here are some first impressions of nvidia on linux:

I wanted to try a tiling window manager and figured wayland was the way to go as it's the future. Sway looked like the most popular and well developed wm on wayland so I picked that. I had to type '--unsupported-gpu' to launch it (used to be called '--i-will-not-buy-an-nvidia-graphics-card-in-the-future' or something). When I launched it I had no mouse cursor. I may have messed up some config with this as from a cursory web search not many people have had this problem outside of a vm and I don't have much linux experience but that's not the point - I'm not sure how common refusal to support proprietary drivers is in the freedom end of the linux community or if it's more specifically because of the gbm support in this case. Either way I'm using X11 for now.

sometimes my monitor wouldn't reconnect after sleep, I think I've fixed it now by editing some 'nvsleep.sh' file using instructions on linux mint forums, so I don't think it's an error on my part for this one. Possibly could have opened a terminal blind and reconnected it but I hadn't even heard of xrandr at that point so I had to cycle the power, which was quite annoying.

no hardware accelerated web browsing for modern nvidia apparently? the best solution for watching youtube videos on linux with nvidia seems to be 'use mpv'. Perhaps being forced to use something like mps is healthier than being exposed to youtube proper but hardware acceleration feels like something that should just be a standard feature these days.

Overall it feels like nvidia and at least some portion of the community does not care about the linux desktop user experience for those with nvidia hardware. As I don't really play games now anyway it would be nice for my 3080 to at least pull it's weight a little bit day to day by performing basic tasks like drawing the mouse cursor and decoding videos. If I was in the market for a new card I think I would go for AMD unless I had a good reason to use cuda.

Unrelated, I'm probably missing something obvious but I made a user systemd timer to change my wallpaper every so often. I'm not at the machine right now so I don't have the exact command but it was something like ExecStart=/usr/bin/feh --bg-max --randomize ~/.wallpaper/* straight from the examples. the exact same command works fine in the terminal but the log shows errors from feh that ~/.wallpaper/* does not exist and no usable images found. Using ~/.wallpaper/ works fine in both. how is the systemd --user service running commands differently than me pasting it in the terminal and how would this lead to feh itself seeming to interpret the path differently?

pseudorandom name
May 6, 2007

Crack posted:

Unrelated, I'm probably missing something obvious but I made a user systemd timer to change my wallpaper every so often. I'm not at the machine right now so I don't have the exact command but it was something like ExecStart=/usr/bin/feh --bg-max --randomize ~/.wallpaper/* straight from the examples. the exact same command works fine in the terminal but the log shows errors from feh that ~/.wallpaper/* does not exist and no usable images found. Using ~/.wallpaper/ works fine in both. how is the systemd --user service running commands differently than me pasting it in the terminal and how would this lead to feh itself seeming to interpret the path differently?

Wildcard expansion is done by the shell, not the command itself, and systemd isn't a shell and doesn't do that kind of expansion.

Mr. Crow
May 22, 2008

Snap City mayor for life
Specifically read the specifiers section in the man page https://www.freedesktop.org/software/systemd/man/systemd.unit.html

"%h" is how you reference the home directory.

Adbot
ADBOT LOVES YOU

Crack
Apr 10, 2009

Mr. Crow posted:

Specifically read the specifiers section in the man page https://www.freedesktop.org/software/systemd/man/systemd.unit.html

"%h" is how you reference the home directory.

I'm not at my desktop right now and just copied the example as it's basically what I used but I did specify the whole path in my service. These specifiers look very handy for future reference to save from having to do that though.

pseudorandom name posted:

Wildcard expansion is done by the shell, not the command itself, and systemd isn't a shell and doesn't do that kind of expansion.

I'd assumed that the path was being sent to feh as-is, and feh was doing the expansion ( althoughI didn't know it was called wildcard expansion). Seems a little pointless in this example given an apparent equivalent result with the wildcard omitted. systemd timers were sold to me as direct replacement for cron which apparently does use a shell (and also handles ~) by the arch wiki, so I figured it would handle commands similarly. Guess I still have a lot to learn.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply