ubuntu – Re-configure new sshd to work properly with old Putty?

I have a quite non-standard question 🙂

To work with MySQL I’m using SQLyog GUI v12.3.2. I like it a lot, but due to the licence I can’t update to the latest version. My version uses plink 0.64 undercover for SSH connections. And it’s impossible to update the plink separately.

I have 3 ubuntu servers: 19.04, 19.10 and 20.04. All with pretty regular config.

SQLyog properly connects over SSH to the first two servers but when connecting to the 3rd one it fails with this message:

SSH Error: FATAL ERROR: Couldn't agree a key exchange algorithm

(SSH Error: FATAL ERROR: Couldn’t agree a key exchange algorithm)

I tried to check the key exchange algorithms via ssh -Q kex. 19.10 (which works) and 20.04 (which doesn’t work) output the same:

diffie-hellman-group1-sha1
diffie-hellman-group14-sha1
diffie-hellman-group14-sha256
diffie-hellman-group16-sha512
diffie-hellman-group18-sha512
diffie-hellman-group-exchange-sha1
diffie-hellman-group-exchange-sha256
ecdh-sha2-nistp256
ecdh-sha2-nistp384
ecdh-sha2-nistp521
curve25519-sha256
curve25519-sha256@libssh.org
sntrup4591761x25519-sha512@tinyssh.org

I tried to compare /etc/ssh/ssdh_config‘s but they are also the same. So perhaps SSHD on Ubuntu 20 has some newer version and some default options have been changed there. Any ideas how to easily fix SSHD on the newer Ubuntu server so that the old plink properly connects to it like to older servers?

PS newer versions of Putty or ssh don’t have any issues connecting to Ubuntu 20

unity – How do I properly initialize UDP SDK?

When uploading my game to Unity Distribution Portal (UDP), I kept on receiving this message about sandbox testing:

It seems your game was never tested in the UDP Sandbox environment, as no UDP Initialization call was found on the UDP back-end.
Launch your APK in the UDP Sandbox environment to ensure it initializes properly. You must complete this step to release your game.

Now, I initially thought that Unity sandbox testing was enabled as soon as you installed the UDP plugins, but I have read that you need to make a script like this for the testing procedures to pass:

public class InitListener : IInitListener
{  
     public void Initialize()
     {
          StoreService.Initialize(IInitListener listener);
     }
     public void OnInitialized(UserInfo userInfo)
     {
          Debug.Log("Initialization succeeded"); 
     }
     public void OnInitializeFailed(string message)
     {
          Debug.Log("Initialization failed: " + message);
     }
}

However, I kept on encountering a syntax error that said

InitListener.cs(9,49): error CS1003: Syntax error, ‘,’ expected

…Even though there’s no need for a “,”. Even then, what am I supposed to do with this initialization script? Where do I assign it?

Thank you for reading.

date – dateRange filter can not properly parse format

I have a datetime column for custom made listing, where date filter calendar can not process given date format.

<column name="ticket_time" sortOrder="150" class="MagentoUiComponentListingColumnsDate" component="Magento_Ui/js/grid/columns/date">
  <settings>
    <filter>dateRange</filter>
    <dataType>date</dataType>
    <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
    <timezone>true</timezone>
    <label translate="true">Event time</label>
  </settings>
</column>

While column value is displayed properly, filter input values look like this when selected – “2020-10-23 HH:10:ss” and with such value filtering does not work anymore, so i can not ignore that

It would be even OK in my case to have to have only dates in filter, but this dateFormat is also tied with column value, there I need to have time also displayed.

So either I need the daterange to understand the format or either specify different format for filer only with date.

comparison – How to properly implement a “compare” operation for Range data type?

Say you have an object that represents a range of numeric values, Range<T>, where T is a numeric type.

It has a T upperBound, a T lowerBound, a bool lowerBoundExclusive, and bool upperBoundExclusive, which represent the lower bound of the range, the upper bound of the range, whether the lower limit is inclusive or exclusive, and whether the upper limit is inclusive or exclusive.

Implementing an equality test on this kind of object is very simple; you just test every value against the other instance’s values.

However, how should one implement a relative ordering of Range<T>s? I thought of the following ways of doing this:

  • Compare the upper bounds of both instances. If they’re different, return the sign of that comparison. If they’re the same, compare the lower bounds and return the sign of that comparison:

    int cmp = upperBound.compareTo(other.upperBound);
    
    return (cmp != 0) ? lowerBound.compareTo(other.lowerBound) : cmp;
    
  • Compute the median of both ranges, and compare those:

    T median = lowerBound + ((upperBound - lowerBound) / 2.0);
    T otherMedian = other.lowerBound + ((other.upperBound - other.lowerBound) / 2.0);
    
    return median.compareTo(otherMedian);
    
  • Compare the magnitude of the ranges:

    return (upperBound - lowerBound).compareTo(other.upperBound - other.lowerBound);
    

Is there an ‘accepted’ way to order ranges?

Using Bootstrap’s thumbnail feature / How to use them properly?

I have made some google search and could not find a clear explanation for a complete beginner like me.

bootstrap’s page provides the following HTML to create a clickable thumbnail:

<div class="row">
  <div class="col-xs-6 col-md-3">
    <a href="#" class="thumbnail">
      <img src="..." alt="...">
    </a>
  </div>
  ...
</div>

but it does not tell me where to put it. For example, I am trying to create a homepage where there will be like 220×220 pxs images which will send the visitor to another page of the site when any of them is clicked.
I have accomplished this using the code below inside the content’s body field that I have created and placed them horizontally using Views Module in table & grid setting.

<p>
 <a href="/plant-nutrition">
  <img alt="Responsive image" class="img-responsive" data-entity-type="file" data-entity-uuid="948cd381-a04e-499e-95fb-e3e8704418fa" src="/sites/default/files/inline-images/picture.jpg" />
 </a>
</p>

What is the best practice of achieving my goal here? Should I use bootstrap’s grid and then use the html provided by the bootstrap above? If I do so I end up with a clickable thumbnail inside an unclickable thumbnail (which is created by the View’s page)

entities – How to properly manage field types for a content type created by a module for Drupal 9?

I’m a bit confused about two different errors I get, which seem to contradict each other. I guess I didn’t register my field types properly. The first one appears when I try to uninstall my module.

DrupalCoreFieldFieldException: Attempt to create a field field_example that does not exist on entity type node. in DrupalfieldEntityFieldConfig->getFieldStorageDefinition() (line 312 of coremodulesfieldsrcEntityFieldConfig.php).

The second one appears as an error message within the UI when I try to fix it by introducing another module which should only create the field type.

Unable to install Helper, field.field.node.content_type_example.field_example already exists in active configuration.

In general, the module calls an external API and fetches data which is then used to create nodes with several fields. These are defined inside the config/install directory. Furthermore, inside src/Plugin/Field there are FieldType, FieldFormatter and FieldWidget classes, more or less as described here.

I used this module when I tried to fix the first error without a helper module. With its help, I removed the field types created by my module in the first place. Unfortunately, I don’t know a lot about drush, which seems to be capable of solving the issue. On the other hand, it would be great if it was possible to “reset” the content type and the field types programmatically whenever the module is installed or uninstalled. So far, I tried the following code, without much luck:

<?php
// mymodule.install file
use DrupalfieldEntityFieldStorageConfig;

function mymodule_install() {
  if (FieldStorageConfig::loadByName('node', 'field_example')) {
    FieldStorageConfig::loadByName('node', 'field_example')->delete();
  }
}

Does someone know how I can fix the error and how I should manage these fields in the future? Thanks!

nikon – Recovering a video file that was never closed properly?

The situation has happened a few times now. My Camera a Nikon d5600 will occasionally give me a message about the battery not being being a Nikon battery and shut down the power. (It is an OEM Nikon battery) and another time when I was plugged in with the camera and accidentally pulled the plug. Anyway power went off in the middle of shooting a time lapse and the file was lost.

So I have looked around at recovery software and it seems all the stuff I can find is for recovering deleted files. While there maybe something that works to recover a file that was not deleted but not saved properly, I cannot find it with the free stuff. I don’t mind paying for software but it is not clear if the software will work in my situation and I don’t want to put cash out for a none solution. If you have been able to recover a file in this kind of situation I would appreciate knowing the software you used. I hate to be picky about an answer but if you have not actually had and fixed this particular problem you might be mudding the solution with conjecture.

internal sd – SDcard not mounted properly in device

I have an Android 8.1 device (encrypted, not rooted) that is configured to use an SD card as internal storage. That SDcard broke down and needed to be replaced.

After inserting a fresh replacement card, the device recognized it and asked how it should be formatted. I chose “internal”, and the format went though without issues. The card shows up under “Storage” with the correct capacity, just as the old one did.

However, using this card is not possible. All apps that try to access it (like camera, browser downloads, file managers) show “SD card not available” errors.

When I connect to the device through adb shell to check how the file systems are mounted, I can see a difference. This is what shows up when the old card is inserted:

bbb100:/ $ mount
(...)
/dev/block/dm-3 on /mnt/expand/beb7cb3c-0c09-43cf-83b8-ce1eac90a92b type ext4 (rw,dirsync,seclabel,nosuid,nodev,noatime)
/mnt/expand/beb7cb3c-0c09-43cf-83b8-ce1eac90a92b/media on /mnt/runtime/default/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid)
/mnt/expand/beb7cb3c-0c09-43cf-83b8-ce1eac90a92b/media on /storage/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=1015,multiuser,mask=6,derive_gid)
/mnt/expand/beb7cb3c-0c09-43cf-83b8-ce1eac90a92b/media on /mnt/runtime/read/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=23,derive_gid)
/mnt/expand/beb7cb3c-0c09-43cf-83b8-ce1eac90a92b/media on /mnt/runtime/write/emulated type sdcardfs (rw,nosuid,nodev,noexec,noatime,fsuid=1023,fsgid=1023,gid=9997,multiuser,mask=7,derive_gid)
bbb100:/ $

and this appears when the new card is inserted:

bbb100:/ $ mount 
(...)
/dev/block/dm-3 on /mnt/expand/49d563a3-0905-4173-a1b3-8c29e3917d2c type ext4 (rw,dirsync,seclabel,nosuid,nodev,noatime,data=ordered)
bbb100:/ $

So it seems the new card is not initialized correctly and/or several directories do not get mounted for whatever reason.

Things I tried to no avail:

  • re-formatting the card
  • eject, mount
  • reboot the device
  • ran sm partition disk:179,64 private in adb shell just to see if there are any errors on the console (via) – there is no error
  • tried with different SD card (also brand new) – same behavior

What’s going on here and what else can I do to make the card work?


Additional info: There seem to be permission problems on the new card:

bbb100:/ $ df -h
Filesystem            Size  Used Avail Use% Mounted on
rootfs                1.1G  3.3M  1.1G   1% /
tmpfs                 1.3G  816K  1.3G   1% /dev
/dev/block/dm-0       4.2G  3.3G  973M  78% /system
tmpfs                 1.3G     0  1.3G   0% /nvram
tmpfs                 1.3G     0  1.3G   0% /mnt
/dev/block/dm-1       496M  393M   93M  81% /oem
/dev/block/mmcblk0p17  96M   74M   22M  78% /firmware
/dev/block/mmcblk0p47  12M  8.3M  3.1M  73% /dsp
/dev/block/mmcblk0p55 992M  8.6M  967M   1% /cache
/dev/block/mmcblk0p34  27M  596K   26M   3% /persist
/dev/block/mmcblk0p52  16M  156K   15M   1% /bbpersist
/dev/block/dm-2        22G   13G  8.8G  61% /data
/dev/block/dm-3        58G   52M   58G   1% /mnt/expand/ff86c4d9-5828-4ca5-9f6e-f4e5b02b7dd9
bbb100:/ $ mkdir /mnt/expand/ff86c4d9-5828-4ca5-9f6e-f4e5b02b7dd9/media
mkdir: '/mnt/expand/ff86c4d9-5828-4ca5-9f6e-f4e5b02b7dd9/media': File exists
1|bbb100:/ $ cd /mnt/expand/ff86c4d9-5828-4ca5-9f6e-f4e5b02b7dd9/media
/system/bin/sh: cd: /mnt/expand/ff86c4d9-5828-4ca5-9f6e-f4e5b02b7dd9/media: Permission denied
2|bbb100:/ $

Camera application or driver or some other thing is not working properly

Except for Skype Application on windows 10, Camera feature is not working on any other application, browser or microsfts official camera application. Updated Apps, Driver but that didn’t work. Also tried to find Rsproviders folder in C:Program FilesRealtek but that was missing over there.
Here is link what displays on screen. Additonal Info: DELL Inspiron, Windows Home V 20H2, Insiders program enabled.
https://youtu.be/BcSSIvH9WA8

Why does Google Sheets Conditional Formatting not apply properly to all cells?

Alright, so I’ve been having this issue for a few hours now and am confident to say that I can’t fix it by myself.

I’ve been playing around with Google Sheets trying to apply Conditional Formatting when another referenced cell is not empty.

Here’s an image of the issue, it will definitely help you understand what I’m trying to do.

However, here’s what happens when I do the following two things (using an IF function to determine the state and then parse the true or false state towards the Conditional Formatting rule), here’s where the broken magic comes into play.

When I set it to =IF(ISBLANK(B2), false, true), this happens.
But when I reverse it and set it to =IF(ISBLANK(B2), true, false), this happens again.

I am lost to why this happens as from what you can see in the screenshots, B2 is never empty.

EDIT: For whatever reason, when I set it to =IF(ISBLANK(B2), true, true), it works as expected, as seen here. I would still like to hear an explanation if anybody has one.