HackerTrans
TopNewTrendsCommentsPastAskShowJobs

gyf304

no profile record

Submissions

Crossing the Mixed Content Boundary: Abusing Stun/Turn as Communication Channel

blog.yifangu.com
1 points·by gyf304·2 года назад·1 comments

Show HN: Dotenv, if it is a Unix utility

github.com
225 points·by gyf304·2 года назад·100 comments

comments

gyf304
·2 месяца назад·discuss
That’s a thing as well in some US states called duty to retreat.
gyf304
·11 месяцев назад·discuss
Look great, a few nits:

- For the convert page, the tool seems to conflate codec and container format. For example, for MKV option, the tool specifies libx264, when MKV is capable of many more codecs. In addition, a lot of the times when people want to "convert", e.g. from MP4 to MKV, they mean to remux - i.e. "-c copy", which doesn't seem like an option here.

- For the compress page, the tool allows you to specify the target size, however the command output limits bitrate instead of target size. This means that the output size will vary depending on how long the input is, and will almost never be the specified target size.

I would suggest merge the "Convert" and "Compress" tabs, and allow specifying:

- video bitrate (-b:v)

- video codec (-c:v)

- audio bitrate (-b:a)

- audio codec (-c:a)

- container format

I found handbrake to be a good GUI-based alternative if ffmpeg commands are overwhelming.
gyf304
·в прошлом году·discuss
It’s worth noting that this same restriction of not being able to do perspective transformations is also one of the defining characteristics of PlayStation 1 graphics. And the workaround of subdivision is also the same workaround PS1 games used.

More reading: https://retrocomputing.stackexchange.com/questions/5019/why-...
gyf304
·2 года назад·discuss
I made something that achieved similar results with existing technologies by abusing STUN/TURN. It does not handle discovery but it does allow local communication without a server.

https://blog.yifangu.com/2024/07/16/crossing-the-mixed-conte...
gyf304
·2 года назад·discuss
If you want to index HTML documents using SQLite FTS5, I have a HTML (pseudo) tokenizer plugin https://github.com/gyf304/sqlite3-fts5-html
gyf304
·2 года назад·discuss
I usually copy the built library from a Chrome/Chromium installation, saves me from building the library myself.
gyf304
·2 года назад·discuss
This is an awesome solution.

I have the 5-bay variant of the same NAS. I decided to put TrueNAS Scale on it using a Samsung USB stick using the internal USB. I chose one that’s widely used for Tesla dashcam, so I know it is at least somewhat durable.

I’m happy with it so far. I still find the CPU performance very lacking so I’m planning on upgrading to something beefier.
gyf304
·2 года назад·discuss
This is a very neat project that seems to accomplish the same goal and have some extra features.
gyf304
·2 года назад·discuss
* Memory allocation NULL check: this is a bona-fide bug introduced by my refactoring

* MAX_FILE_SIZE: I don't think this is true.

* skip_until_charset, skip_charset bound check bug: I don't think this is true

* Uninitialized value_end: I don't think this is true - and if true should be caught by -Wall -Werror flags.

* argc < 1 check not being necessary: This is not true, you can make argc == 0 by using the exec family of libc functions.

* Error Handling: Currently all parsing errors should cause the program to exit, which I think is the desired behavior.

* Unsanitized input for .env: Intended behavior.

* Unsanitized input for execvp: Intended behavior.
gyf304
·3 года назад·discuss
The reason I think is that GM is multinational. And while Buick is not doing well in the US, it’s doing very well in China (80%+ of sales of the brand is in China).
gyf304
·3 года назад·discuss
The crosswalk button my city uses has an LED that illuminates if the button was pressed before. It’s a great UX improvement over the ones without the LED.
gyf304
·3 года назад·discuss
Did something very similar years ago - https://blog.yifangu.com/tag/library-occupancy-project/
gyf304
·3 года назад·discuss
Does anyone remember X3D[1] / VRML? X3D is roughly the same concept, 20-some years ago.

Here's a hello world for X3D: https://www.web3d.org/x3d/content/examples/Basic/X3dSpecific...

And here's a hello world for OpenUSD: https://www.openusd.org/release/tut_helloworld.html#viewing-...

Although X3D is a bit more verbose, a lot of parallels can be drawn between the two, 20 years apart.

[1] https://en.wikipedia.org/wiki/X3D
gyf304
·3 года назад·discuss
Thank you for your reply.

Here are my thoughts on your 2 points.

(1) Noted. The main graphic emphasizes reporting rate over the delta, in both the axes selection and the ranking - and indeed the ranking is the main takeaway from many of the readers. If you rank by percentage delta of report rate, the graphic would be drastically different. This newer graphic wouldn't be "fair" either, as countries with higher control (no money) report rate would have a relatively low percentage delta.

(2) The World Bank Enterprise Survey data is listed under the title "Percent of firms using e-mail to interact with clients/suppliers" (for which China is at 85%) which I think is not the same as email penetration rate (which in the above reference in my parent comment, is at <40%). I understand your reasoning that cross country data is hard to come across.

I also read your reply in Science. I believe that while there are multiple limitations conducting the research - all perfectly reasonable - the limitations nonetheless affected the credibility of Fig. 1 - the main figure of the paper.

It is also mentioned in the reply that creating new social accounts is unfeasible. While I think this is true, wouldn't a single account per platform suffice? Most social platforms allow anonymity for display names / handles. If the social account name does not bear resemblance to an actual name, I don't think the participants would notice.
gyf304
·3 года назад·discuss
I believe the methodology is flawed.

> The business cards displayed the owner’s name and email address and we used fictitious but commonplace male names for each country.

This is assuming that email is a ubiquitous communication method in all countries, which is not true. USA has a very high email penetration rate, so does Japan (where all phones use email instead of SMS). On the other end of the spectrum, China's email penetration rate is less than 40% [1]. Business in China is conducted over WeChat and phone calls instead of email. If the person receiving the wallet does not have an email account, or doesn't even know what email is, I'd imagine the email contact rate to be quite low.

[1] https://www.twinova.com/email-dead-long-live-wechat/#:~:text....
gyf304
·3 года назад·discuss
I know exactly where this is from. This has been floating around the Chinese Internet for a bit. The repo is originally at https://github.com/wheatup/evil.js but has been made private since then. A few variants of this was made and uploaded to NPM.

Here's a English translation of the README.md in that specific repo.

> What? The notorious 996 company wants you to hit the road?

>

> Do you want to leave a small "gift" for your project before you go?

>

> Let's sneak this project into yours, and your project will have, but not limited to, the following magical effects:

>

> - When the length of the array is divisible by 7, Array.includes will always return false.

> - When it's Sunday, the result of the Array.map method always loses the last element.

> - There is a 2% chance that the result of Array.filter will lose the last element.

> - setTimeout will always trigger one second slower than expected.

> - 10% of Promise.then will not register on Sundays.

> - JSON.stringify will change uppercase I to lowercase l.

> - The result of Date.getTime() will always be one hour behind.

> - There is a 5% chance that localStorage.getItem will return an empty string.

see: https://juejin.cn/post/7133134875426553886
gyf304
·3 года назад·discuss
Something about the use billiard balls immensely amuses me. I'm impressed.