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 7y ago · link · parent

Ctrl + Shift (or Alt + Shift) is what Windows uses so people migrating from Windows often choose this combination. It is actually a poor choice, because you have to remember which layout is selected and make mistakes, so you type something in the wrong layout, notice it and have to delete and retype it again.

A better solution is to use non-modal layout switching, when you have a dedicated key for every layout. On Windows I use left and right Control keys (with a help of a closed-source program), so I always start typing with pressing one of them. But on Linux I cannot use them (I tried to write a program that would listen to /dev/input but found out that you cannot switch layout in Wayland-based Gnome from an external program because there is no API for this).

Super + Space which is used on Macs, is also a poor choice. It is surprising that Apple, which manufactures it own hardware, was unable to just make dedicated keys for different layouts.

comment 7y ago · link · parent

> This is possible in Wayland, it's up to the compositor.

Typically compositor uses libxkbcommon which suffers from the same problems that X server had.

> Remote keyboards are just like physical keyboards. Just configure VNC's keyboard to use the correct layout.

It is inconvenient and I don't think it would work. There is no such thing as "VNC keyboard". VNC client sends keysyms over the wire, so the VNC server has to convert them back to a key number, switch to necessary layout if there are several of them, turn off modifiers like Shift if necessary. This is too complicated. For example, x11vnc server doesn't support non-latin input correctly.

> (BTW I'm not sure I understand what you mean by "Everything is broken")

That many VNC servers cannot handle non-latin input correctly.

> however in Wayland on-screen keyboards _can_ send unicode to the compositor via the standard text-input protocol

This looks like an extension for implementing IME. You can see that there is no key press or key release events. These events are defined in wayland protocol spec [1] and they still use a key number. So you cannot send key press/release events for characters not present in current keyboard layout.

[1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-...

comment 7y ago · link · parent

Actually, you don't need to read the driver's code to run it. Just provide the environment the driver needs. If you could provide an environment Windows provides for the drivers then you would be able to run Windows' drivers.

comment 7y ago · link · parent

Because people want their desktop to look nice like Android with smooth animations and not like Windows 3.1 with grey rectangular windows and buttons.

comment 7y ago · link · parent

Not being able to make a keylogger is actually bad thing.

Both X11 and Wayland have poorly designed keyboard events handling (which was defined in XKeyboard spec in 1995). For example, you want to use Ctrl + Shift keys to switch keyboard layouts on release. Simple thing that is working in Windows. You cannot do that in Linux, because:

- if you assign Ctrl + Shift to switch keyboard layout then when these keys are pressed, the event will be consumed and you cannot use combinations like Ctrl + Shift + F (this will be interpreted as Ctrl + F or Shift + F depending on what key you have pressed earlier)

- you cannot make a separate program that would monitor all key presses and releases and switch layout without breaking other programs. In the X server and extensions there is no such feature as "monitoring pressed keys"

The only way to do it reliably is to have a privileged program that would listen to events in /dev/input.

By the way this bug hasn't been fixed for 14 years [1], and instead of fixing it the distributions have been using different hacks and workarounds. Also, they don't warn user that using Ctrl + Shift to switch layout will break hotkeys using these modifiers.

Another issue is remote control programs like VNC. In both X11 and Wayland to emulate user input VNC server muss pass a key number to the X server or Wayland compositor. Not a keysym, not a unicode codepoint, but rather a number of the key on a physical keyboard. Now guess what happens if VNC client's machine has a keyboard layout with characters not present in layout on VNC server's machine? Everything gets broken. Typical solution for this is to find unused key number and patch current keyboard layout before sending a key press event to the X server.

Because of the same reason on-screen keyboards on Linux cannot produce characters not present in keyboard layout. Emoji, for example.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=865

comment 7y ago · link · parent

Then the price should be per document and not per page.

comment 7y ago · link · parent

10 cents per page is expensive. The paper and ink to print the document would probably cost less.

comment 7y ago · link · parent

That is only until you use your bank card online or connect your Google phone to your WiFi. Both card and phone number disclose your identity and allow to link your IP address with you. Phone's IMEI is also a good identifier you cannot change once leaked.

comment 7y ago · link · parent

How is blocking ads with software different from turning down the volume during commercials?

Also, nobody can be forced to listen to something.

comment 7y ago · link · parent

> Why is there even a setting? How many people would ever want to turn Javascript off?

Because without JS pages load much faster and browser takes less memory. Ad and tracking often doesn't work without JS. Why would anyone want to use JS?

comment 7y ago · link · parent

So inconvenient.

comment 7y ago · link · parent

It is very interesting, but how can people without an ID card vote, open a bank account or buy a ticket for a plane? How are they identified then? I guess there must be some equivalent of ID anyway. At least in Russia you need an internal passport even to exchange the currency if the amount exceeds $611 (which is great because earlier the threshold was about $250).

comment 7y ago · link · parent

In Russia you are not required to carry an ID, but if you don't have it then you can be taken to a police station and held for several hours to check your identity. Is not there a similar rule in UK?

comment 7y ago · link · parent

> If he politely refused to show ID, there is nothing the police can do

Is it really so? Why would then police ask for an ID if anyone can refuse and get away with it?

comment 7y ago · link · parent

It uses Openstreetmap and can work offline.

comment 7y ago · link · parent

It reminds me of Android 5 where every time you enable GPS, Google shows a popup asking you to share your location with them (very annoying). And besides, there is a checkbox "Don't ask me again", but if you tick it, the "Decline" button gets disabled to ensure that you don't make the wrong choice.

[1] https://android.stackexchange.com/questions/115944/how-to-pr...

comment 7y ago · link · parent

Aren't you doing anything weird with your cookies? For me recaptcha is almost always solvable from the first try. Regarding Youtube, usually reloading the page 2-3 times allows me to skip ads, but this trick doesn't work with all videos.

comment 7y ago · link · parent

That is correct. In an earlier comment [1] I have checked what options are enabled by default when registering or adding a Google Account to an Android Phone. For example, checkboxes "Backup to Google Drive" and "Save web and app activity" are enabled by default.

I suppose that many Android users might agree to these options without understanding completely what they mean or even without noticing because some of the options are hidden behind spoilers.

Android is an example of a case where you become a product although you have paid for the phone.

[1] https://news.ycombinator.com/item?id=18493084

comment 7y ago · link · parent

Almost every telecom company in the world has access to SS7 network so the attack surface is very wide.

comment 7y ago · link · parent

Also, you can bypass screen lock in Ubuntu by removing the HDD [1]. The bug still is not fixed.

[1] https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1777415

comment 7y ago · link · parent

The box with the feathers could be very tall but narrow so that the air resistance won't be large.

comment 7y ago · link · parent

The drones can also intercept GSM equipment identifiers (IMEI), WiFi points identifiers, recognise car plate numbers and their owners' faces and sell all those data. This can even be more profitable than delivery.

comment 7y ago · link · parent

First thing they should do is to cover propellers so that they don't hurt anyone. Most of the drones I've seen have no protection. The manufacturers and owners don't care about the safety at all.

Also, what if the drone flies into someone's window or a car? How do you identify the owner?

comment 7y ago · link · parent

I don't remember exactly, but I think Apache was started via systemd because there was no error like "Apache is not started". Systemd was reporting that it is stopping and starting Apache but in fact it did nothing.

comment 7y ago · link · parent

Interesting, I didn't know that Debian has a constitution.

comment 7y ago · link · parent

I had a similar issue with systemd in Debian. Restarting the service (Apache) via systemd actually had no effect, and calling init.d script worked.

By the way, I am not a fan of sysvinit: I read all those shell scripts.

comment 7y ago · link · parent

I think that putting a hard limit on alloca allocation size, somewhere around 1-10 Kb, could help prevent this type of exploits. Also, it is possible to write a function that would choose between alloca() and malloc()/free() depending on the size.

comment 7y ago · link · parent

Cannot these restrictions be lifted if you write that the user agrees to sharing all of their data for any purposes somewhere between the lines of a 20-page Privacy Policy?

comment 7y ago · link · parent

Android also had an issue where an app could deceive a user by requesting the permission to manage WiFi (CHANGE_WIFI_STATE) which is considered non-dangerous ("normal") [1] and is granted automatically without any prompts [2]:

> If your app lists normal permissions in its manifest (that is, permissions that don't pose much risk to the user's privacy or the device's operation), the system automatically grants those permissions to your app.

But the app could use it to determine user's location (by scanning for WiFI access points identifiers) without any notification. So the user wouldn't realise that the app now knows their location.

You can see it in the docs [3]:

> Android 8.0 and Android 8.1:

> A successful call to WifiManager.getScanResults() requires any one of the following permissions:

> CHANGE_WIFI_STATE

So this issue was fixed only on Android 9, and had been working for years. Any application could secretly determine your location. That's the state of privacy protection on Android. It is difficult to believe that Google developers who are very smart people couldn't foresee it for years.

I googled a little and found a confirmation that this method was working: [4]

[1] https://developer.android.com/reference/android/Manifest.per...

[2] https://developer.android.com/guide/topics/permissions/overv...

[3] https://developer.android.com/guide/topics/connectivity/wifi...

[4] https://blog.trustlook.com/2015/06/02/how-apps-tracking-your...

1
141142143
185