Better HN
topnewbestaskshowjobs
Log inSign up

codedokode

9,867 karma · joined Aug 20, 2015 (11y ago) · 5,528 submissions

PHP developer from Russia.
Submissions

comment 12mo ago · link · parent

Interesting, from the thread I learned that Apple have removed "advanced data protection" in UK [1]. I think, is is available even in Russia, but not in UK. That's why you cannot rely on commercial companies protecting your data - they are always ok with negotiating secret deals behind the closed doors. The only ones who are on your side are unpaid open-source volunteer developers.

[1] https://www.bbc.com/news/articles/cgj54eq4vejo

comment 12mo ago · link · parent

Well, we can remember what France did to Durov, still without charging him with anything.

comment 12mo ago · link · parent

> the bacterium Carsonella ruddii, which lives as a symbiont within the guts of sap-feeding insects, has an even smaller genome than Sukunaarchaeum, at around 159,000 base pairs

159 000 base pairs is ~320 Kbit, or 40 KBytes. I wonder, if that is the minimum size of a cell firmware. Also, if the cell is that simple, can we study it exhaustively and completely? Like, decipher every base pair in DNA, and determine what it is responsible for. And make an interactive website for that.

comment 12mo ago · link · parent

Yes, it's possible that you are right - I checked it on a random video, and there is no overlay.

comment 12mo ago · link · parent

Yes, I saw a promoted video with cryptocurrency scam ("earn lot of money trading crypto with ChatGPT") for many months on European Youtube. As I remember, to become rich you just need to put your private keys into their script and run it.

comment 12mo ago · link · parent

> repeat the same thing the fucking guy is talking but just with flashy text on screen

This have been a thing on Japanese TV since long ago, doubling down on the punchlines with subtitles or adding a comment or comeback (conveniently, Japanese text takes less space that Western text, so the characters can be relatively large). So I think they just copied it.

comment 12mo ago · link · parent

It's actually good, the default videos are usually fighting videos, dash camera videos and garbage TV series. You don't want to see them anyway.

comment 12mo ago · link · parent

Javascript garbage collector wouldn't take so long... probably it's launching a new thread or process (for example, DRM decryption) for every song, and there becomes too many of them. Or it runs out of memory and starts swapping.

comment 12mo ago · link · parent

> so you can no longer see the content in case you paused to freeze the frame.

It's similar on desktop, if you pause the video, an overlay with recommendations appears, and it prevents you from reading the subtitles, for example.

comment 12mo ago · link · parent

The names are pretty unattractive (which is not uncommon for C) though to the point one would want to avoid them in the code.

comment 12mo ago · link · parent

By the way, for small arrays removing branches also improves performance (according to my tests). So if you do a constant-time comparison like this:

    match = True
    for a, b in pad(entered_pass, real_pass):
        match = match and a == b
    return match
Then it will be faster as well. I was surprised to find this.

comment 12mo ago · link · parent

> video auto plays with sound.

Without sound in Firefox, I assume?

comment 12mo ago · link · parent

What's special about consciousness? I assume it is just a sequence of thoughts/images inside the brain and that's all? Like when a cat sees a cheese and an image of its taste appears instantly and motivates it to come closer. Human is the same, I think.

comment 12mo ago · link · parent

> the ratio is never 1:1, there's always way more men.

Isn't it weird? There should be approximately equal number of not married men and women, so there should be some reason why there are less women on dating platforms. Is it because women work more and have less free time? Or because men are so bad? Or because they have an AI boyfriend? Or married men using dating apps shift the ratio?

comment 12mo ago · link · parent

I am using bwrap - it allows blocking network, creating a new process namespace (so that sandboxed program cannot mess with host processes) and creating a new filesystem, where you can mount host directories. I only pass through minimal set of directories like /usr and /lib, and only selected files from /etc, as they can contain valuable information. I also pass through several device files like /dev/null, but not the whole /dev.

I do not pass through /proc, as it contains not only information about processes (which is not a concern), but a lot of identifying information about a machine. However, lot of modern software due to poor coding and not following standards crashes or exhibits various bugs without /proc, so I wrote a minimal Python /proc emulator using FUSE: https://pastebin.com/s49V5nVL . /proc doesn't allow bind mounting its subdirectories somewhere else, so the only option was FUSE (or writing a kernel module). As you see, with Linux you learn something new every day, like it or not. The emulator is not perfect - it doesn't expose thread information, and, for example, Grand Central Dispatch library [1] terminates the application because of this. Telegram is using the library and crashes randomly because of this. I expected better quality from Apple and Swift.

Most importantly, I run the app as a different user (Android-style), because historically Linux was built around idea of protecting users from each other, and I don't trust namespaces as much. I clear the environment variables as well. Ideally, I should also be closing file descriptors to prevent leaks (for example, you can easily leak a file descriptor to your Wayland server, Dbus or something else).

To use Xorg, I grant access to the app's user. X server has no issues with sharing access to it. I am not sure if one can use Wayland with different users (is uses unix sockets). Pipewire doesn't allow its use by different users, so I have to add a pipewire-pulse plugin listening on localhost, and configure ALSA inside sandbox to connect to that pulseaudio server. Obviously, the app in sandbox has no direct access to audio devices in /dev.

Dbus is also necessary to display tray icons, but you should never grant direct access to it because it is almost like giving the root password. I use xdg-dbus-proxy [2] which I had to patch because originally it only supported running the sandboxed app under the same user. You can still find my patch in open pull requests.

I also did some experimentation with passing through a camera through a fake video4linux device, so that the app cannot know the real camera model, but it is not working great, for example, Gnome Cheese app cannot see it, because it needs not only a kernel device, but something more to detect cameras.

The sandbox cannot use hardware acceleration. It would be not easy to add because every GPU vendor uses its own directories and device files, /sys entries to interact with the hardware and I think you can get the full list only by reverse engineering. Furthermore, I am not sure if it is safe.

This setup is not perfect, and looks like a bunch of random utilities glued with shell scripts (which is not uncommon in Linux world). If I had more time, I would write something better, that can dynamically add and revoke privileges, can provide fake serial numbers and even emulate a working network which sadly loses 100% of sent packets.

I looked into using Flatpak, but they seem to grant full access to /sys, /proc and generally I don't feel that they care much about protection from malware and fingerprinting by legitimate software. Also, as I understand, they run the app as the same user which is not secure. Probably their primary goal is making installation easier but not making the use of software safer. I am not going to use Docker because it officially says that it is not a security tool.

[1] https://github.com/swiftlang/swift-corelibs-libdispatch

[2] https://github.com/flatpak/xdg-dbus-proxy

comment 1y ago · link · parent

Well, writing obfuscated code like ["e" + "v" + "a" + "l"]() is already a huge red flag for sending the package to manual review. While it might be impossible to detect all methods of obfuscation, we could start with known methods.

Also, detecting obfuscated code sounds like an interesting and challenging task.

comment 1y ago · link · parent

And what was the original, Chinese name of the city, may I ask?

comment 1y ago · link · parent

Nowadays, are large ships well protected from small unmanned underwater ships? Are they worth building?

comment 1y ago · link · parent

Hire an antivirus company to provide a safe and verified feed of packages. Use ML and automatic scanners to send packages to manual review. While Halting problem prevents us from 100% reliably detecting malware, at least we can block everything suspicious.

comment 1y ago · link · parent

My code editor works in a sandbox. It's difficult because Linux doesn't provide it and one has to write it manually using shell scripts, random utilities. For example, I had also to write a limited FUSE emulation of /proc to allow code editor work without access to real /proc which contains lot of unnecessary information.

And if it's a "professional" setting, the company could hire a part-time developer for writing the sandbox.

comment 1y ago · link · parent

Does NPM use any automatic scanners? Just scanning for eval/new Function/base64 and other tokens often used by malware, and requiring a manual review, could already help.

Also package manager should not run scripts.

comment 1y ago · link · parent

It is possible if you write a custom program for that, but not by simply configuring X. If you configure Shift to switch layouts, you won't be able to use it as a modifier.

For comparison, in Windows you can use Ctrl+Shift or Alt+Shift to switch layouts and use shortcuts (like Ctrl+Shift+A) with these modifiers. In X, you cannot.

comment 1y ago · link · parent

This is only because there are only 0.001% of people using anonymizers. If you are a minority with specific requirements, you are shown the door almost in any case, not only on the Internet.

comment 1y ago · link · parent

You can determine user's language from IP address location. Of course, there are users with VPNs, but they probably are used to seeing foreign content. For example, Youtube shows me advertisement in a language I don't understand despite my language header saying I only understand "en-US" and "en" languages. So this header is unnecessary, even Youtube ignores it.

Also, when using VPN, Google typically uses a language based on IP address, not my language header. I assume the header is only useful for fingerprinting today.

comment 1y ago · link · parent

You can change the header, but browser developers are not that dumb and they added properties like "navigator.platform" which do not change and immediately give you away. Consider also writing a browser extension to patch these properties. Also, I think that DRM module (widewine), that is bundled with browsers, also can report the actual software version. Sadly it is undocumented so I don't know what information it can provide, but I notice warnings from Firefox about attempts to use DRM on various sites like Yandex Market.

comment 1y ago · link · parent

You don't need to hire American expensive, but not so productive, engineers, there are lot of other countries. Also, there are ML models.
1
282930
185