Linux

Posted on
Page
of 47
  • You can do it using, possibly, Winamp or, definitely, Tag and Rename in Windows.

    I think Winamp at least works under Wine.

  • You can probably do it in one line of perl!

  • You can probably do it in one line of bash!

    for file in *.mp3; do [ "$(tag "$file")" == "TAG" ] && \
        (  artist="$(tail -c 95 "$1" | head -c 30 | rtrim; "$file" | filt)"; \
           album="$(tail -c 65 "$1" | head -c 30 | rtrim; "$file" | filt)"; \
           title="$(tail -c 125 "$1" | head -c 30 | rtrim; "$file" | filt)"; \
           track="$(tail -c 3 "$1" | hexdump -ve '/1 "%02i "' \
                       | awk '{ if ($1 == 0 && $2 != 0) print $2" " }' "$file" | filt)"; \
           dir="$artist - $album"; \
           newfile="$track$artist - $title.mp3"; \
           mkdir -p "$dir"; \
           mv "$file" "$dir/$newfile"); \
        done
    
  • My perl/bash is non-existant.

    But I'll give that a bash...

    #yolo

  • You can probably do it in python, for sanity's sake.

    https://wiki.python.org/moin/UsefulModules#ID3_Handling

  • Copy everything into a sandbox environment and run it there.

    Cos I have never run it myself.

    And copypastad it from somewhere else with about 0 due diligence.

  • I said #yolo.

  • Any suggestions for a small linux liveusb? Mainly for web-browsing, etc on a laptop that isn't mine.

    I have a ubuntu installation on an external HDD but that seems to have borked due to powering off rather than shutting down so I want a liveusb as a temporary solution.

    The trouble is my internet is crap so I'm struggling to download Ubuntu, which I normally use, at 1GB. Any other suggestions? Cheers

  • @aggi have you seen "damm small linux" (DSL) , it really is small at 50MB and can be setup via unetbootin so quick and easy.

  • Cheers, that looks like what I want

  • No Unetbootin

  • I guess I could mention this here, because you'd need a Linux device to try it out (a laptop might be most suitable at the moment). I've made stopwatch software that uses a webcam, suitable for single person use on a velodrome or other similar tracks.

    The program works by using motion detection to capture images of a rider passing the finish line, after the ride matching key frames are picked out by the user. The software calculates lap times and speeds as well as cumulative total for the whole ride. Rides are saved to the disk.

    I've made the software mostly for my own personal amusement, so it well might not be suitable for anything resembling serious use, or a solution to a problem that doesn't exist. I did try it out on the local velodrome a couple of times last autumn, and I though it worked pretty nice.

    A couple of caveats: timing comes strictly from image capture times so full laps only, and estimating standing start time can be a bit fiddly. I've also tested only a single webcam, there might be some compatibility issues.

    You can get the source code from here. I'd be interested in hearing if anyone tries it out.

    An image of what you'll end up with. The layout might be slightly lfgss inspired, sorry about that.


    1 Attachment

    • stopwatch.jpg
  • Looks good! What do the lighting conditions need to be like?

  • Slack spokes...

  • I've tested the software on the velodrome only a handful of times, but I haven't noticed it being particularly sensitive to different lighting conditions. Setting the motion detection threshold seems pretty easy. I haven't seen an abrupt change from constant random triggering to missing meaningful frames.

    Quick changes (like a passing cloud) could probably trigger the motion detection accidentally, but that would be more of an inconvenience because the key frames are picked manually.

    Too dark might increase noise and cause motion blur. I've used a simple method to reduce the effect of sensor noise, which looks to work pretty effectively. And if it's dark enough I guess using a torch to illuminate the passing bike could work.

  • Wouldn't it be better to do shape detection before comparing? That way clouds shouldn't matter.

  • Actually I'm just using a summed luminance channel difference between consecutive frames, with noise reduction by ignoring per pixel differences under a specified limit. Very naive implementation but seems to work well enough. It's also very light on the cpu, ran fine even on Raspberry Pi.

  • Is there any kind of easy repair utility for Ubuntu? I have it on an external drive to use as a fancy live CD and it no longer boots. I suspect some files got corrupted after accidentally unplugging it whilst running but no idea how to fix this.

  • boot from a working liveCD/usb, then mount the broken install and chroot in.

  • I have crouton installed on my chromebook to run ubuntu. Basically it uses chroot to run whichever version of linux you install (I use classic ubuntu). There is a slight issue with graphic drivers on my laptop so I run the following:

    sudo enter-chroot

    sudo rm /dev/dri/card0
    sudo mv /dev/dri/card1 /dev/dri/card0
    exit

    sudo enter-chroot gnome-session-wrapper gnome-fallback

    I'd like to run all this as one script but the trouble I have is that once the first line runs it's in a different environment and so the rest of the script doesn't run.

    Is there any way around this?
    Cheers

  • You could give this a try:

    sudo "enter-chroot ln -sf /dev/dri/card{1,0}"
    or
    sudo "enter-chroot \"ln -sf /dev/dri/card{1,0}\""

    etc.

    It looks like the enter-chroot script takes an optional parameter of "program to run in chroot". If it does, this should be doable quite easily once you get the right incantation.

    Note I replaced your rm & mv with a forced symlink

  • Cheers, I'll give those a try

  • Over recent months, my 18 month Arch install has got a little messy on my primary machine (used for both personal stuff and for work). I plan to nuke and pave sometime soon but fancy taking the opportunity to make my life a little easier by switching to something stable which just works without the constant tinkering.

    I'm leaning toward Ubuntu/Debian with XFCE. Anyone got any thoughts and/or suggestions? What are people using for "Linux on the Desktop" these days?

  • I've settled on Debian testing. I'm pretty lazy keeping my system up to date, and for me Debian's been good at not breaking everything when I finally do an upgrade. I've tried Ubuntu a few times in the past, but for my tastes the default installation has been a bit bloated, plus I've been left with a broken installation after a dist-upgrade more than once. Arch didn't really work for me either.

  • Debian unstable here, but I enjoy things that don't work

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Linux

Posted by Avatar for hael @hael

Actions