Here I am getting schooled again by @darkvinge's answer to yesterday's Linux DFIR command line trivia question.
How do you output an entire directory structure of file paths, sorted in descending by size? Old-school me would have told you to do something like this:
find /some/path -type f -exec wc -c {} \; | sort -nr
It's an interesting example of one time when you want to use "find ... -exec" rather than "find ... | xargs ...".
But then @darkvinge pointed out that you can just use "-printf" instead of "-exec":
find /some/path -type f -printf "%s\t%p\n" | sort -nr
"-printf" has a huge number of handy shortcuts for different file parameters. Here we see "%s" for file size and "%p" for file path.
This is vastly more efficient than executing "wc -c" on each file. Don't believe me? Check out how long the different find commands take on the same directory structure:
# time find /usr -type f -exec wc -c {} \; >/dev/null
real 4m20.615s
user 2m47.897s
sys 1m37.520s
# time find /usr -type f -printf "%s\t%p\n" >/dev/null
real 0m0.306s
user 0m0.068s
sys 0m0.238s
It's not even remotely close.
@rebeccawangart These are amazing!
An oldie but a goodie! This is "Anticipation", which I use for my logo. Acrylics on wood panel, 2018. A colorful pet portrait of an orange and white tabby cat in bright rainbow colors! I started a series of dog and cat paintings in 2018 to create a portfolio for my new pet portrait business.
Prints: https://rebeccawangart.com/featured/anticipation-psychedelic-rainbow-tabby-cat-rebecca-wang.html
RB: https://www.redbubble.com/shop/ap/36245309
#Art #MastoArt #FediGiftShop #BuyIntoArt #cat #TraditionalArt #AnimalArt #AcrylicPainting #FantasyArt #ArtAdventCalendar
Create a freeze frame of the action in a video every 7 frames and pause at the end for 50 frames.
mpv --ao=null --vo=image --start=0:1:44.25 --end=0:1:46.6 GUEZCxBcM78.mp4
i=1
for f in 000*.jpg; do
convert -evaluate-sequence Min ${a[@]} $f $f
[[ $((i%7)) == 0 ]] && a=(${a[@]} $f)
i=$((i+1))
l=$f
done
echo 0001{00..50}.jpg |xargs -n1 ln -s $l
cat 000*.jpg |ffmpeg -y -f mjpeg -i - -c:v libx264 -r 24 -pix_fmt yuv420p skier.mp4
People call us stats nerds, but we're really sum of the least squares.
@AgeOfAutumn @MoonLily You deserve plenty of kindness Autumn! Hang in there!
Here's an original (circa 1904) rotary AC-DC converter providing power to the (former) IRT subway in NYC. It still works, and is occasionally pressed into service during times of peak load, though most of the system now uses solid-state converters. It is very loud.
Full version at https://www.flickr.com/photos/mattblaze/32992380451
55 years ago #today Jocelyn Bell discovered the first known pulsar -- a star the size of a city, spinning once a second, whipping up intense radio signals that sounded like the beep-beep-beep of an alien signal.
In her own words: https://www.cam.ac.uk/stories/journeysofdiscovery-pulsars #astronomy #discovery
Writing a new dating profile, so far I have “has all own teeth”
Father, Fiancé, Volunteer EMT, (conflicted) Veteran, Computer Geek, Perpetual Student. Command line kind of guy (he/him) Very amateur woodworker, crude sketcher, proud nerd, liberal, wished I knew more math and science.
I’m willing to be wrong, certainty often means that I don’t actually understand the problem