8 – How to get drupal to check for a twig template in the active theme folder before checking the module folder?

I’m developing a contrib module for Drupal 8 that sends email notifications to group members when new content has been posted in groups they have subscribed to. The module defines some new view modes for nodes and comments. It then uses these new view modes to render the contents of the emails it sends out. The module defines a theme hook suggestion for each view mode and supplies a twig template for each view mode.

It works fine as is. The twig templates from within the module are utilized without a problem. What I’m not understanding is why copies of these templates placed within the active theme are not utilized. I’m familiar with the process of copying an existing twig template into a theme to be modified. But no matter what I do the template from the module is always used in this case. It was my understanding Drupal searches for suitable twig templates in the theme first and then works backward but perhaps my module is missing something.

Here are code samples for more details.

Define the view mode for comments – in modules/contrib/group_subscription/config/install/core.entity_view_mode.comment.group_subscription_immediate

langcode: en
status: true
dependencies:
  module:
    - comment
id: comment.group_subscription_immediate
label: 'Group Subscription Immediate (comment)'
targetEntityType: comment
cache: true

Define the theme hook suggestion – in modules/contrib/group_subscription/group_subscription.module

/**
 * Implements hook_theme()
 */
function group_subscription_theme($existing, $type, $theme, $path) {
  return (
    'comment__group_subscription_immediate' => (
      'base hook' => 'comment',
    )
  );
}

/**
 * Implements hook_theme_suggestions_comment_alter()
 */
function group_subscription_theme_suggestions_comment_alter(array &$suggestions, array $variables) {
  if ($variables('elements')('#view_mode') == 'group_subscription_immediate') {
    $suggestions() = 'comment__group_subscription_immediate';
  }
}

Please let me know if there is anything else I can provide to help me figure this out. I’ve been working with Drupal for years but am still relatively new to D8 and this is my first attempt at creating a module to give back. Thanks in advance!

ubuntu 16.04 – How to check what users can possibly access and control my server?

I have recently got access to a legacy server previously manage by someone else.
Access control and password changing is the priority by now.
I have some shell base knowledge but definitely not a senior sysadmin. And need some guidance and general suggestion about his topic.

So I have root access and I can check the list of users.

I wonder if there’s a way to understand immediately from /etc/passwd contents what are the unix user that could possibly access the system, filtering out the standard user.
System is Ubuntu 16

And I can see from passwd that root is the only user having “/bin/bash”:

root:x:0:0:root:/root:/bin/bash

Other users seems more related to installed services..
So maybe no other users apart root were used before to access the system
Is there a way to check it?

I’m supposing that all users having the last row token like:

:/usr/sbin/nologin
:/bin/false
:[void no chars]

should be system’s service users

Aren’t they?

Thanks for any advice

Can someone please check the flight history of FR7326

i’m doing a little history dig into a flight between Dublin and Prague of the above nr and just curious if someone with an access to some of the popular features could check if this flight existed in May 2018 and what were the times of landing and departure.

Thank you all for help

check if one expression can be transformed into another

My question is how to use Mathematica to check if one expression can be transformed into another:

Example 1:
$ax^2+bx+c$ into $Kcdot(x+alpha)^2+beta$, and then show me $K(a,b,c)$ and so on.

Example 2:
Say I have the Maxwell equations:

$nabla cdot mathbf{E} = frac{rho}{varepsilon_0}$, $nabla times mathbf{E} = -dot {mathbf{B}}$, $nabla cdot mathbf{B} = 0$, $nabla times mathbf{B} = mu_0 (varepsilon_0 mathbf{j} + dot{mathbf{E}})$.

Can I follow from this an expression of the form $alpha ddot {mathbf{E}}+beta mathbf{E}=0$?

Example 3:
$c_1 cos(omega t) + c_2 sin(omega t)$ into $A cos (omega t + delta)$. How do I mark the dependencies, so that $A$ is $A(c_1, c_2)$ but not $A(t)$?

How do I check the hardware of my iMac?

I have a late 2012 iMac that I suspect has something failing in terms of disk or USB.

This is what is happening:

  1. Some programs freeze from times to times. Once that happens, there is no way for the program to run again. Just a restart of the iMac will solve that.
  2. WHen #1 happens the computer fails to shutdown. I have to force shutdown.
  3. I have 4 USB external drives connected to a USB HUB that is connected to the Mac. From times to times, all these disks disconnect.
  4. I am unable to boot in diagnostic mode. Restarting the computer with D pressed makes the computer reach a white page that does not go anywhere. Restarting the computer with Option D (diagnostics over internet) shows a screen that appears to be loading something. It takes centuries for the progress bar to advance 1/100 of a pixel. For the pace of that progress bar I estimate 8 hours just to show the diagnostic screen, if anything is loading at all.
  5. Restarting the computer in recovery mode over internet, shows the spinning globe. Same thing, slow as hell. I estimate 2h just to show the recovery screen.

I am suspecting the disk is failing. That late 2012 iMac uses a spinning disk that I suspect is going bad. All fsck to that disk shows two, what I think is bad sectors. The SMART screen shows nothing wrong with the disk.

But, running smartctl shows me this for the Macintosh HD.

=== START OF INFORMATION SECTION ===
Device Model:     APPLE HDD WDC WD10EALX-408EA0
Firmware Version: 07.01D03
User Capacity:    1,000,204,886,016 bytes (1.00 TB)
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        Not in smartctl database (for details use: -P showall)
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Thu May 28 00:34:24 2020 WEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (16800) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 194) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0xb037) SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       1
  3 Spin_Up_Time            0x0027   181   173   021    Pre-fail  Always       -       3933
  4 Start_Stop_Count        0x0032   091   091   000    Old_age   Always       -       9305
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   100   253   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   065   065   000    Old_age   Always       -       26100
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   091   091   000    Old_age   Always       -       9284
192 Power-Off_Retract_Count 0x0032   192   192   000    Old_age   Always       -       6185
193 Load_Cycle_Count        0x0032   199   199   000    Old_age   Always       -       3115
194 Temperature_Celsius     0x0022   095   093   000    Old_age   Always       -       52
195 Hardware_ECC_Recovered  0x0036   200   200   000    Old_age   Always       -       0
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       18

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Aborted by host               10%     21652         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

and for the Macintosh HD - Data:

=== START OF INFORMATION SECTION ===
Device Model:     APPLE HDD WDC WD10EALX-408EA0
Firmware Version: 07.01D03
User Capacity:    1,000,204,886,016 bytes (1.00 TB)
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        Not in smartctl database (for details use: -P showall)
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 3.0, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Thu May 28 00:33:11 2020 WEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82) Offline data collection activity
                    was completed without error.
                    Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                    without error or no self-test has ever 
                    been run.
Total time to complete Offline 
data collection:        (16800) seconds.
Offline data collection
capabilities:            (0x7b) SMART execute Offline immediate.
                    Auto Offline data collection on/off support.
                    Suspend Offline collection upon new
                    command.
                    Offline surface scan supported.
                    Self-test supported.
                    Conveyance Self-test supported.
                    Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                    power-saving mode.
                    Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                    General Purpose Logging supported.
Short self-test routine 
recommended polling time:    (   2) minutes.
Extended self-test routine
recommended polling time:    ( 194) minutes.
Conveyance self-test routine
recommended polling time:    (   5) minutes.
SCT capabilities:          (0xb037) SCT Status supported.
                    SCT Feature Control supported.
                    SCT Data Table supported.

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       1
  3 Spin_Up_Time            0x0027   181   173   021    Pre-fail  Always       -       3933
  4 Start_Stop_Count        0x0032   091   091   000    Old_age   Always       -       9305
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   100   253   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   065   065   000    Old_age   Always       -       26100
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   091   091   000    Old_age   Always       -       9284
192 Power-Off_Retract_Count 0x0032   192   192   000    Old_age   Always       -       6185
193 Load_Cycle_Count        0x0032   199   199   000    Old_age   Always       -       3115
194 Temperature_Celsius     0x0022   095   093   000    Old_age   Always       -       52
195 Hardware_ECC_Recovered  0x0036   200   200   000    Old_age   Always       -       0
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       18

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Aborted by host               10%     21652         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

But I am not sure if I understand these enigmatic reports.

Do these numbers make sense as a failing disk?

simcard – How can you check if a phone number was recently moved? (To mitigate SIM swapping)

I know never to use phone number as a sole or backup authentication factor. But if a customer forgets their password, and I want to use information they know about their account alongside access to the phone number as a potential avenue to recover their account, is there a way to check if their phone number was recently moved?

For example, is there an API or database I can query for recent historical SIM or IMEI numbers associated with a given phone number?

This would be useful information because it is my understanding that after being hit by a SIM swapping attack, victims usually notice that their phone has stopped working and generally are able to regain access to their phone number within days.

Again, this would not be used as a sole or backup authentication factor, I won’t be vulnerable to Twitter-style fully automated SIM-jacking. If the phone number has indeed been associated with the current SIM and IMEI for many months, that would still just be one piece of information among many that would be taken into account in deciding whether to authenticate them.

Check out my tech site

Advertising

y u no do it?

Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

Starts at just $1 per CPM or $0.10 per CPC.

How to check and remove key-value pair from one json object present in other json object in same request. Code in java

From the first JSON object, if value against serviceRequestType and accountNumber key is found in another JSON object, then remove that object from request. So please help me to solve this issue. PFB JSON request for your reference. The solution must be using GSON object

    {
  "header": {
    "authToken": "ec90b3e00fa3dd1289699ca88ac26df27ced29e5c6a78ef8859e85566d99e6fd"
  },
  "body": {
    "serviceRequest": [
      {
        "header": {
          "productFamily": "tchfl",
          "serviceRequestType": "moratoriumEmiOptin"
        },
        "body": {
          "accountNumber": "TCFPL0485000010111379",
          "description": "kush.ashar@teknopoint.us",
          "gcid": "242524523"
        }
      },
      {
        "header": {
          "productFamily": "tchfl",
          "serviceRequestType": "moratoriumEmiOptin"
        },
        "body": {
          "accountNumber": "TCFPL0485000010111379",
          "description": "kush.ashar@teknopoint.us",
          "gcid": "242524523"
        }
      },
      {
        "header": {
          "productFamily": "tchfl",
          "serviceRequestType": "moratoriumEmiOptin"
        },
        "body": {
          "accountNumber": "TCFPL0485000010111379",
          "description": "kush.ashar@teknopoint.us",
          "gcid": "242524523"
        }
      }
    ]
  }
}

hyperlink – How do I check the all the links my desktop application is connecting to?

In chrome, in More tools> Network, I can see all the links I am connected. Is there such a thing for desktop based programs? Say for example, I open up “Microsoft Store”, is there such a way that I can see what links that that program is connected to?

Essentially I want to see all the links “insert any desktop program” is connected to.

Super Fast Dedicated Server in Thailand, check thaihosting.asia special deals! | Proxies123.com

Thaihosting.asia is an IT service company and has since 1995 dealt with the Internet, operation and development. Our product areas include commercial web hosting, server hosting, domain registration, shopping systems, payment solutions, content management systems and IT outsourcing. Thaihosting.asia have always, and will always be known for service, quality and stability. It is our mission to provide quality services at reasonable prices, as well as provide our customers with a personal and unique service. We will not just be an anonymous supplier, but a professional partner.

Get a dedicated server in Thailand, hosted in a modern data center in Bangkok. Choose between Intel Core i3 and Xeon processors and get up to 32 GB of RAM – with no monthly traffic limit on your connection. We use the latest generation Supermicro hardware to deliver dedicated servers here in Thailand, which enables us to deliver dedicated servers with excellent performance and reliability. Bandwidth for our Thai servers is provided by a number of different domestic and international ISPs. This means you get a fast and stable connection 24/7. Our Danish and Thai team will help you get your Thai server up and running fast. We provide 24/7 support for all of our dedicated server products. Read more about our Hostingcenter in Bangkok.

Features of our Dedicated Servers in Thailand:

  • Supports all popular operating systems such as CentOS, Ubuntu, Debian and Windows
  • All Thai servers come with IPMI interface for remote management and console access
  • Directly connected to the biggest Thai ISPs for blazing fast national transfers
  • Full Root or Administrator access
  • Support is available 24/7 by chat and e-mail.
  • Gigabit Ethernet support

30-day money back guarantee on all Thai servers!

Server Thai Basic
฿3,900/ mo
Intel Core i3-6100 @ 3.70GHz 2 cores
100 Mbps network
1 TB SATA3 HD
Unlimited Bandwidth
8 GB RAM
Configure

Server Thai Business
฿4,900/ mo
Intel Xeon E3–1240v5 @ 3.50GHz 4 cores
100 Mbps network
2 TB SATA3 HD
Unlimited Bandwidth
16 GB RAM
Configure

Server Thai RAID
฿5,900/ mo
Intel Xeon E3–1240v5 @ 3.50GHz 4 cores
100 Mbps network
2×2 TB SATA3 HD
Unlimited Bandwidth
32 GB RAM
Configure

– Add 1 Extra IP Address for 150 Baht / month
– Upgrade to 1 Gbps shared line for 1,000 Baht / month

Strong hosting services in green data center:

  • Free support, daily backups and effective protection against viruses and spam.
  • We build your server, manage your IT and keeps technology running.

What you see above are the servers we always have in stock. However, should you have any special hardware requirements, you are more than welcome to Contact us. You can also catch us on the live chat (bottom of every page) around the clock. You are never alone if you choose Thaihosting.asia as your partner.