Hacker Newsnew | past | comments | ask | show | jobs | submit | gitinit's favoriteslogin

For a while I had expensive internet and low bandwidth, but I loved listening to music and lectures on YouTube. At some point I realized that getting only the audio stream would save me 90% in bandwidth costs. [0]

youtube-dl (and yt-dlp) has a flag, I believe -G, which gives you the URL(s) for the requested format/quality. I used the command line on my computer and put the link in VLC. On my phone I had this elaborate workaround involving downloading the file to my VPS first over SSH, then downloading it to my phone, until I realized my phone browser can consume the URL directly, so I set up a PHP frontend for `youtube-dl -G -f bestaudio {url}`

It's no longer online and I lost the code, but it was like one line of code.

I mention this because you-get seems to support the same usecase (via --url / -u), so I wanted to let people know how useful this is!

(While it was online I shared it on some forums and got very positive feedback, people used it for audiobooks etc.)

[0] Also playing with screen off saves 80% battery life! YouTube knows these facts and that's why they made background playback (which fetches only audio stream) a paid feature...


Stealing this, but had to lookup the parameters. It does work, but it should be `-C -` with a space. Also I like progress bars so my alias for now is:

  curl -#JLOC -
* -# Progress bar instead of the standard meter

* -J Use the server-specified Content-Disposition filename instead of extracting a filename from the URL

* -L Follow redirects

* -O Write output to a local file (download)

* -C - Resume transfers

Maybe a good mnemonic would be something along the lines of jlo liking hashtags?


I gave a talk at PyCon a few weeks ago where I was really struggling to fit my content into the time slot.

I ended up editing out the first couple of minutes of the talk - the bit where I ramped up to the topic, gave a little bit of background about why I was qualified to talk about it, that kind of thing.

Instead I launched straight into my first point (which included a good joke)... and it worked.

A lesson I learned is that if the topic is interesting enough you can skip the intro and jump straight in to that material, and if you combine that with a joke you can capture the audience's attention just fine.


Yes, almost every day. I travel regularly and I love having a big, crisp, private display every where I am: Hotel, plane, train. Makes me so much more productive.

Consuming content is great of course but the AVP has changed my content creation: I take way more panoramas and now spatial photos (Spatialify on iOS works well). I also bought an Insta X4 360 camera which, while a far cry from Apple's immersive content in resolution, can still be a really nice way to relive memories.

More content: Last year I started 3d scanning (using Scaniverse) sculptures and other art / items that catch my eye during my travels. The AVP makes it really easy to import and place them in my environment. When I'm working I'll often place a favorite sculpture next to me for company & as a reminder of a trip I took.

Finally, even after 4 months of use, it's still really fun and, from a tech perspective, astounding in terms of image quality, stability, 3D placement, integration in environment, etc. I love it and I can't wait for this tech to get better and better.


Does this imply that Crostini/ Crouton / Linux developer mode will go away? I'm quite proud of the development I've done on a $200 chromebook and it was one of my favorite features.

I just added a magic URL in my app that GitHub calls whenever a commit is pushed and the server does `git pull` which in turn causes pm2 to reload the app. So committing anything shows up in production in seconds. Great for smaller projects.

Minecraft was the first game, someone on the "internet" gifted me. I was like "Why do you do that?!" and he was just like, because it's cool to play with you.

Ahhhh! Fond memories. :)


Nice! I spent a few months in a bandwidth constrained environment (bluetooth tunnel to free Cafe wifi across the town square...). I generally got a few KB/s. The recent article on Antarctica's internet reminded me of those days.

HN was one of the only sites that was reasonably pleasant to use during that time. Still, I found it more fun and faster to surf via a VPS. So the VPS itself would load and render the page, and only send me the bytes over Mosh (a more efficient SSH protocol).

I tried a few terminal based browsers using this setup. The one that worked best for HN (especially comment indentation!) was w3m.

Here's the current thread in w3m: https://files.catbox.moe/zuabb4.png

I did have fast mobile data but it was expensive and limited. I watched a lot of videos on YouTube and one day realized that almost everything I watched was actually just lectures or discussions. So I could just stream the audio and save 80% of the bandwidth.

I set up a little PHP script* that took a YouTube URL and ran `youtube-dl -g f bestaudio` to give you the URL of an audio-only stream. (Directly from YouTube's servers!)

I could then just load it directly in my browser, or download it for later. (I think I should have used `worstaudio` instead.)

* That little utility page is not up anymore, but others found it very useful so I should probably make another one...

Another benefit of this is to battery life (decoding video is expensive) and being able to turn off the screen (a feature that Google banned from the app store, years before making their own (paid) version available...) Later I learned about f-droid and newpipe... good times :)


When I read stories about companies like Spotify creating e-waste like this, I think it’s worth pointing out that commercial companies don’t have to behave this way.

As a counter-point, back around 2008, I purchased two Squeezebox music players from Logitech (digital music players that Logitech had acquired from Slim Devices: high quality DACs that supported every audio format, gap-less playback, synchronised playing on multiple devices, and were very configurable).

They discontinued these products four years later (2012) but kept their mysqueezebox.com online service running up until the start of this year (2024). They kept the user forums running and archived the knowledge-base wiki. Most importantly, they open-sourced the stand-alone server software for running a local Squeezebox server and continued to pay the main developer to maintain the project for more than a decade after they discontinued the products. He’s still the lead developer and project maintainer of the server software, now called Lyrion Music Server: https://lyrion.org/

Correction: the stand-alone server software was always open source, specifically GPLv2. In addition to the audio quality and features, that was one of the selling points for me. It being written in Perl, meant that it was both cross-platform and easy to run on a GNU/Linux system.


But it's not a rented tool. The subscription is to give a developer the ability to work on a project in a sustainable way. It's open source. You can compile it yourself. How is that rented? This is a fairly niche product in the iOS ecosystem, it is also by far the best terminal for iOS. $20 per year is a pittance in the grand scheme of my tech purchases and well worth transforming my iPad into something more than just a youtube machine. I get that we are all sick of subscriptions but I would rather budget for $20 a year and get nice consistent updates and great support on discord over a product that has paid updates where you have to buy a completely new version just so the dev can continued to get paid.

Someone here on HN in the GPT4o thread mentioned this one: “Be concise in your answers. Excessive politeness is physically painful to me.”

Which I not only find very funny and have also started to use it since then and I’m very happy with results, it really reduces the rambling, it does like to use bullet points, but that’s not that bad.


This is very similar to the method I use and, after conversation with him, the method Art Benjamin uses. It's trivial to do in 10 to 15 seconds, though it requires practice, a very small amount of memorisation[0], and a small amount of mental arithmetic. I use it regularly, partly to keep in practice, and partly because once you have the skill you find it's surprisingly useful.

JH Conway used a different technique[1] which I have swutch to when computing days in the current year. It's quicker and easier, but I find that it's harder to compute "The Doomsday" for other years (it's Thursday this year), so I revert to my standard method[2].

Example: Today is 2024/05/24

    Years since 2012 is 12
    Leap years is 12/4 = 3
    Magic month number = 2
    Date is 24
    Add mod 7 is (12+3+2+24) = (-2)+3+2+3 = 6 = Friday
[0] A "magic number" for each month. There are mnemonics, and they can be computed from first principles if needed. It's also easy to remember a few and then compute the others.

  144 : Jan, Feb, Mar
  025 : Apr, May, Jun
  036 : Jul, Aug, Sep
  146 : Oct, Nov, Dec
[1] https://en.wikipedia.org/wiki/Doomsday_rule

[2] All values computed mod 7. Take years since 1900. Add number of leap years since 1900 (so (YYYY-1900)/4 rounded down). Add the magic number for the month. Add the day of the month. Then Sunday=1, Wednesday=4, etc.

Because the calendar repeats every 28 years, for more recent dates you can start with 2012 instead of 1900.


My preferred way of disabling Windows Defender is to boot Linux, mount windows partition and rename windows defender directories to *.disabled or whatever.

Example (assuming it is mounted at /mnt/ntfs):

mv "/mnt/ntfs/Program Files/Windows Defender" "/mnt/ntfs/Program Files/Windows Defender.disabled"

mv "/mnt/ntfs/Program Files (x86)/Windows Defender" "/mnt/ntfs/Program Files (x86)/Windows Defender.disabled"

mv "/mnt/ntfs/ProgramData/Microsoft/Windows Defender" "/mnt/ntfs/ProgramData/Microsoft/Windows Defender.disabled"

Antivirus service fails to start and that's about it, no other side effects.

To revert just rename back.

I have dual boot set up, but I believe the Ubuntu USB install image supports NTFS.


I kind of wish this was a tool to author bash, or better yet very compatible POSIX sh. (versus being using bash as a compile target that a human isn't meant to read)

It's a bit of a stretch, but comparing it to something like MJML for HTML emails. [0] It doesn't make great HTML, but it's not unreadable and standard quality for HTML emails. It just handles all of the weird things you have to consider for maximum email client compatibility. It's basically a bunch of HTML macros, with react being an implementation detail under the hood. It's not like it's bringing any new features to HTML emails, because if it did, the output WOULD be unreadable.

If this was just some type hints, and cleaner syntax around sh, that I think would be really useful. This in it's current state is just sort of a tech debt generating machine. If something is built in amber, it's because we can only use bash for some reason, but if we can use bash we could either... use bash, or we could call something else (Ruby, Python, etc), from a 2 line bash script.

[0] https://mjml.io/try-it-live (click "View HTML" to see outputted source.)

Edit: Idea, it would be cool if you could define the environment available to the final script when using the compiler. That way, if there was something you wanted to distribute, the person building your project could say "this docker container I'm running this in won't have sed, but it will have bc and awk" or something.


I've built a web-based tool for myself that has similar philosophy: https://edna.arslexis.io/

It does support multiple pages but you can use just one.

It has a nifty feature in that you can divide the single file into virtual parts. They just have alternate backgrounds to tell them apart. And each virtual part can have a type for syntax highlighting (plain text, markdown or a programming language).

I've been using it for a few months now and it's my primary note taking / knowledge recording thing.

Even though it's web based, on Chrome you can save notes on disk so it works like a desktop app.

Each note is a plain text file so you can edit them in any text editor.

If you put notes on a shared drive (Dropbox, OneDrive, Google Drive etc.) you can work on notes on multiple computers.

It's also open-source: https://github.com/kjk/edna


If humans beings were perfectly rational at all times everywhere then the world would look a lot different (and much less exciting I presume)

Engineers named the Xbox One X "Scorpio", which is a much cooler name.

The best option is probably Flutter right now: https://flutter.dev/

If you don't mind writing the UI native, sharing only business logic code, Kotlin is an option: https://kotlinlang.org/docs/multiplatform.html#kotlin-multip...

Kotlin also can do the UI if you use Compose: https://www.jetbrains.com/lp/compose-multiplatform/ ... however, iOS support is still in alpha, and Web is "experimental". If you're not willing to cope with that (expect to have to change your code as they develop the framework) then Flutter is the way as it's pretty stable already on all platforms.

If you already know Typescript and React, you may also consider React Native (but I can't attest to its performance on iOS or anywhere else): https://reactnative.dev/


I’m probably a little odd but I wipe my devices before international travel. All my travel documents are printed. If they want to steal a device, I’ll just replace it.

When I arrive safely I restore from backup and nothing is lost except an hour or so.


I'm running a Debian VM on my M1 Mac (it's a mess to cleanup dependencies and tooling after a project on macOS). I also use i3wm and before launching Firefox, the whole OS consumed only 300 MB of ram. In the past I use Arch with i3wm to have enough free ram (on a 8GB laptop) for Android Studio and Firefox. Some people are angry with Apple for their 8GB offering, but it would be great to imagine what can be done with less and the operating system being just an operating system, not an application suite.

May I recommend the learn Morse with google page?

https://morse.withgoogle.com/learn/

I went through it a few times in a day and felt confident enough to be able to solve the Morse puzzles on my own in Keep Talking and Nobody Explodes when playing with friends. The site made it pretty easy to pick up!


From the article

> Go aims to help developers write code that is secure by default. When we observe a common mistake with security consequences, we look for ways to reduce the risk of that mistake or eliminate it entirely. In this case, math/rand’s global generator was far too predictable, leading to serious problems in a variety of contexts.

> For example, when Go 1.20 deprecated math/rand’s Read, we heard from developers who discovered (thanks to tooling pointing out use of deprecated functionality) they had been using it in places where crypto/rand’s Read was definitely needed, like generating key material.

I made exactly this mistake in rclone. I refactored some code which was using the Read function from crypt/rand and during the process the import got automatically changed (probably by goimports when mixing code which did use math/rand) to math/rand. So it changed from using a secure random number generator to a deterministic one rclone seeded with the time of day. I didn't notice in the diffs :-( Hence

https://www.cvedetails.com/cve/CVE-2020-28924/

So this change gets a big :+1: from me.


I think the Windows equivalent of this software is Synchronous Audio Router: https://github.com/eiz/SynchronousAudioRouter

I also find it interesting that all of the examples are for routing DAWs to video call apps. Don’t these apps have screen sharing and wouldn’t that be higher quality than using the microphone input?


I went through a bunch of note-taking apps before I settled on a git directory that's auto-synced once an hour. This bash script is all it takes.

      cd ~/notes

      if [[ ''$(git status --porcelain) ]]; then
       git stash save
       git pull --rebase
       git stash pop || true
       git add .
       git -c "user.name=Phil Kulak" -c "[email protected]" commit -m "''$(date)"
       git push origin main
      else
       git pull
      fi

Isn't that conflicting with their microsoft deal?

I remember when I first learned about it while planning a hiking trip to Sweden. The idea that you can wander through forests, across fields, and along rivers without worrying about trespassing was quite liberating. I ended up exploring some stunning landscapes that I wouldn't have discovered otherwise. I wish more places adopted this approach, it would make outdoor activities more accessible for everyone.

The fact the IMEI is generally not editable seems like a massive privacy hole.

Just let people edit it. Then I can be someone new every day and nobody can track me.

Mac address randomization does that for wifi. Now do the same for mobile networks.


I think direnv already does a good job in this space, and it's already available in your package manager.

https://direnv.net/


The first major piece of code that I ever wrote was a publishing workflow management system for a major newspaper. It routed page images to presses and generated pdfs of each page in each edition of the newspaper and made pdfs of each day's newspaper editions and published them to a static website where they were archived.

I was only allowed to use perl 4 to write this software and I wasn't allowed to use a database, even though the datastructure for a day's publishing batch had tens of thousands of keys and values and required RDBMs style queries. It also features a configurable postscript parser that extracts all kinds of data from completed newspaper pages that informs the publishing system. When I wrote it I was told that it would run for a few months only while we figured out how to get a $5M commercial product to handle the work.

The whole thing was written in perl 4 style OO Perl and came in at about 16k lines of code in the end -- most of the code was for the postscript processor and tons of cruft that I had to write to made a relational DBMS in memory because I wasn't allowed to use mysql. It took me four months to write it. I launched it in January of 2002 and it runs to this day. I know this because I got a call about it last month where my replacement's replacement's replacement asked me a few questions about what OO Perl is because he wanted to make a few changes. Good luck! It still runs and is responsbile for about 80% of what it was originally built to do. It is used by hundreds of people daily, who by all reports absolutely hate it. There are people working at the newspaper today that use it regularly that were not born when I wrote it. I am twice as old as I was when I wrote it.

They have apparently tried to replace it several times over the last 22 years and have failed to do so... this is likely due to the blockheadedness of my old boss (who is still there) as much as the radically insane obscurity of my code, which is exactly how you'd expect 16k lines of 22 year old OO Perl 4 would be.


Right? I wonder what this will offer?

Marginal improvement over GitHub CoPilot or Cursor?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: