How do I stop Android speaking my commands?

Suddenly (OK so I may accidentally have triggered a setting somewhere) my android phone (LG v20 Standard Android) has started speaking all the touch commands I do.

For example, if I start from a blanked locked screen and turn it on the device says “Screen on. the time” Then after a pause, “Screen Off” as it turns off the screen

If I type in characters it speaks every letter/character as I press the key (makes passwords tricky!!)

If I try to close an app with the X I press the x it says “Dismiss button. Double tap to activate” I double tap and it says ” app dismissed”

But worst of all swipe no longer works. So I cant swipe up to see what is on the bottom of a page; I cant swipe left to see other pages of apps etc etc

Please, how do I get back to a normal silent android! TFAI

Why using two cd commands in bash script does not execute the second command

So I have written a bash script which create series of directories and clone a project to selected directories. But for that I need to cd to each directory (project 1 and project 2) but script doesn’t cd to the second directory and execute the command. Instead, it stops after cd and cloning in theproject2 directory. Why it doesn’t call the cd_project1 function in following code?

   #!/bin/bash    #Get the current user name       function my_user_name() {             current_user=$  USER     echo " Current user is $  current_user"     }      #Creating useful directories      function create_useful_directories() {         if [[ ! -d "$  scratch" ]]; then       echo "creating relevant directory"       mkdir -p /home/"$  current_user"/Downloads/scratch/"$  current_user"/project1/project2       else          echo "scratch directory already exists"          :       fi     }  #Going to colsim1_utilities and cloning       function cd_project2() {        cd /home/"$  current_user"/Downloads/scratch/"$  current_user"/project1/project2 &&       git clone https://username@bitbucket.org/teamsinspace/documentation-tests.git       exec bash     }  #Going to colsim1 directory and cloning      function cd_project1() {        cd /home/"$  current_user"/Downloads/scratch/"$  current_user"/project1/ &&       git clone https://username@bitbucket.org/teamsinspace/documentation-tests.git       exec bash      }   #Running the functions       function main() {        my_user_name       create_useful_directories       cd_project2       cd_project1         }     main      #Terminal output             ~/Downloads$  . ./bash_install_script.sh         Current user is mihi     creating relevant directory     Cloning into 'documentation-tests'...     remote: Counting objects: 125, done.     remote: Compressing objects: 100% (115/115), done.     remote: Total 125 (delta 59), reused 0 (delta 0)     Receiving objects: 100% (125/125), 33.61 KiB | 362.00 KiB/s, done.     Resolving deltas: 100% (59/59), done.     ~/Downloads/scratch/mihi/project1/project2$   

Confused about commands, domain events and external events in event sourcing

I’m a little confused about

  • commands role in event sourcing
  • distinction between domain and external events

If my understanding is right

  • a command represents an action initiated by an actor in terms of the domain
  • a domain event is an event can be consumed and produced by aggregate roots
  • an external event is just like a DTO – a data contract and it needs to be translated to either a domain event or a command

Example

I have a Product aggregate root. A product can have multiple active special offers. In order to manage it’s SpecialOffers, the product accepts 2 domain events:

  • SpecialOfferActivated
  • SpecialOfferDeactivated

So it’s public interface is just 2 overloaded Apply methods:

class Product{     ...     Apply(SpecialOfferActivated){...}     Apply(SpecialOfferDeactivated){...} } 

1st case: The request comes form front-end to the api

So a Controller is first in the line. It basically translates caller intention from data contract (DTO) to the domain language (command):

class ProductController{     Post(SpecialOfferDto dto){         ActivateSpecialOfferCommand command = Map(dto)         _commandBus.Send(command)     } } 

Command sent, now we need a command handler

class ActivateSpecialOfferCommandHandler{     Handle(ActivateSpecialOfferCommand command){         SpecialOfferActivated domainEvent = Map(command)         _eventBus.Publish(domainEvent)     } } 

Event published, now time for the event handler

class SpecialOfferActivatedDomainEventHandler{     Handle(SpecialOfferActivated domainEvent){         var product = GetFromDatabase()         product.Apply(domainEvent)         Save(product)     } } 

Done.

2nd case: The process is initiated by an external event published to the service bus.

This time NewPromotionExternalEvent is the data contract (ExternalEvent) and again we need to translate it to the domain language (Command)

class NewPromotionExternalEventHandler{     Handle(NewPromotionExternalEvent extenalEvent){         ActivateSpecialOfferCommand command = Map(extenalEvent)         _commandBus.Send(command)     } } 

And then it falls back to the ActivateSpecialOfferCommandHandler from the fist case. So it’s the same case as the first one basically.

3rd case: Skip the domain events layer (variation of either the 1st or the 2nd case)

So either by an api or an external event a command was produced. We simply create a domain event in order to apply it to the aggregate root. We do not publish the event to the service bus.

class ActivateSpecialOfferCommandHandler{     Handle(ActivateSpecialOfferCommand command){         SpecialOfferActivated domainEvent = Map(command)          var product = GetFromDatabase()         product.Apply(domainEvent )         Save(product)     } } 

Done.

4th case: Skip the commands layer (variation of the 1st case)

We can easily skip the commands layer

class ProductController{     Post(SpecialOfferDto dto){         SpecialOfferActivated domainEvent = Map(dto)         _eventBus.Publish(domainEvent)     } } 

and fallback to the SpecialOfferActivatedDomainEventHandler

5th case: Aggregate root creation.

So either by an api or an external event a command CreateNewProductCommand was produced. And we need another handler:

CreateNewProductCommandHandler{     Handle(CreateNewProductCommand command){         var product = Map(command)         SaveToDatabase(product)          NewProductCreated domainEvent = Map(product)         _eventBus.Publish(domainEvent) // in case somebody is interested     } } 

In this case there’s really no place to stick the domain events layer.

6th case: Domain event produced by Product (aggregate root)

class Product{     Apply(SpecialOfferActivated domainEvent){         var specialOffer = Map(domainEvent)         _specialOffers.Add(specialOffer)         if(...){             // For simplicity sake, assume the aggregate root can access _eventBus             _eventBus.Publish(new ProductReceivedTooManySpromotionsDomainEvent(this.Id))         }     } } 

Questions

  1. The events layer is cool, it allows us to distribute jobs across multiple instances or other microservices. However, what’s the point of the command layer? I could easily produce domain events right away (in a controller or external an event handler – 4th case).
  2. Is 3rd case legit (create a domain event just to apply it to the aggregate root, without publishing it)?
  3. Does command layer only make sense in 5th case where it gives us the benefit of delegating product creation to another microservice while domain events layer is not applicable?
  4. Where is the line between external and domain events? Is NewPromotionExternalEvent from the 2nd really an external event or is it rather a domain event?
  5. Who can produce domain events? Aggregate root? Command handler? Domain event handler? External event handler? Another microservice? All of them?
  6. Can domain events be dispatched to another micro-service or would it become an external event then?
  7. What is the proper way of handling product creation and special offer activation when it the request comes form controller or external event?

Unable to purge PhpMyAdmin – Have tried many other delete commands

So, I’ve been trying to remove PhpMyAdmin for some time now, I’ve tried many other commands to try and remove it, but none are working. Here’s my output for sudo apt-get purge phpmyadmin

Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED:   phpmyadmin* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 25.0 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 161372 files and directories currently installed.) Removing phpmyadmin (4:4.6.6-5) ... /var/lib/dpkg/info/phpmyadmin.prerm: 5: .: Can't open /usr/share/dbconfig-common/dpkg/prerm.mysql dpkg: error processing package phpmyadmin (--remove):  installed phpmyadmin package pre-removal script subprocess returned error exit status 2 /var/lib/dpkg/info/phpmyadmin.postinst: 51: .: Can't open /usr/share/dbconfig-common/dpkg/postinst.mysql dpkg: error while cleaning up:  installed phpmyadmin package post-installation script subprocess returned error exit status 2 Errors were encountered while processing:  phpmyadmin E: Sub-process /usr/bin/dpkg returned an error code (1) 

Next, I tried: sudo apt-get purge phpmyadmin, which returned:

Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED:   phpmyadmin* 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 25.0 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 161372 files and directories currently installed.) Removing phpmyadmin (4:4.6.6-5) ... /var/lib/dpkg/info/phpmyadmin.prerm: 5: .: Can't open /usr/share/dbconfig-common/dpkg/prerm.mysql dpkg: error processing package phpmyadmin (--remove):  installed phpmyadmin package pre-removal script subprocess returned error exit status 2 /var/lib/dpkg/info/phpmyadmin.postinst: 51: .: Can't open /usr/share/dbconfig-common/dpkg/postinst.mysql dpkg: error while cleaning up:  installed phpmyadmin package post-installation script subprocess returned error exit status 2 Errors were encountered while processing:  phpmyadmin E: Sub-process /usr/bin/dpkg returned an error code (1) 

The following commands pretty much returned the same thing: apt-get remove --purge phpmyadmin

Also tried: sudo rm -r -f phpmyadmin– Which also didn’t work.

Running Drush commands on a given path

Instead doing:

drt="/var/www/html` domain="example.com" cd "$  drt"/"$  domdain" drush pm install redirect token metatag draggableviews elementor drush en language content_translation redirect token metatag draggableviews elementor 

If I aim not to navigate to the Drupal application directory with cd when running a Drush command for it.

Can something like this be done?

"$  drt"/"$  domain"/ drush pm install redirect token metatag draggableviews elementor  "$  drt"/"$  domain"/ drush en language content_translation redirect token metatag draggableviews elementor  

Commands apt-get, wget, and dpkg not found

I got a Chromebook this past Christmas and now my little sister wants to play Minecraft with me. Chromebook obviously does not run Minecraft, or at least my older Chromebook doesn’t, which led me down the rabbit hole of googling if there were any ways to get it onto the computer. I found this: https://platypusplatypus.com/chromebooks/get-crouton-on-chromebook-guide-tutorial/ — and it gets me up to step 8 before everything goes downhill. I can’t update Linux because when I try to use the apt-get command, it isn’t found. I googled solutions and tried wget and that’s nonexistent, as well. I’ve tried commands to locate them and used the /usr/bin bit, as well, but no such luck. I tried skipping past the updating part to the next step, but was met with the same issue, because the site is telling me to get this thing called Konsole, and I also need to use the apt-get command to do that. I already power washed my Chromebook once after screwing up really badly. I’ve done basically anything I could do to try and figure this out myself before coming to a forum to ask for help, but, it’s nearly 3AM, I’m sick, and I’m getting real frustrated.I’m not the type of smart I need to be for this coding stuff. Apt-get, wget, and dpkg commands are not found and I can’t find do anything without them. I’ve searched through forums asking the same question but all of the answers on those haven’t been able to help me.

Tl;dr– apt-get, wget, and dpkg commands aren’t working. very frustrated, very sick, very late at night. help?

Thank you for any help you can give based off of my explanation.

image of it telling me that commands weren’t found

difference between two quite-similar Terminal commands

I have a script that I run as part of my development (it’s the activation script for a Python venv environment). The way the documentation suggests that we run it is by going to the folder containing our venv folder and running . venv/bin/activate. This works properly (second command in my example).

However, what I would have expected to run is ./venv/bin/activate, i.e. providing a relative path to the activate script (first command in my example). This doesn’t work at all (although I am not surprised because the activate file doesn’t have “execute” permissions attached to it).

My-MBP:flask-tutorial stephendewey$   ./venv/bin/activate -bash: ./venv/bin/activate: Permission denied My-MBP:flask-tutorial stephendewey$   . venv/bin/activate (venv) My-MBP:flask-tutorial stephendewey$    

So my question is, what is the command that works (. venv/bin/activate) actually doing? I’ve never seen syntax like that before.

Accidental Unix Mac Terminal Commands

I accidentally used the following commands in terminal:

  1. In recovery mode: nvram boots-args="x"

  2. In a user profile in terminal: (a) sudo nvram boots-agr="" and (b) sudo nvram boots-args="", and then typed in the sudo password.

Will this affect the system at all, since these are misspelled commands? Usually the command is: nvram boot-args="", which has no “s” in boot, and “agr” is not used, but instead “args” is used.

Also, will it matter that a wrong command was used using the “sudo” command first?