Posts

Showing posts from April, 2020

Get the domain part of the email address

SELECT SUBSTRING(email, LOCATE('@', email) + 1) AS domain FROM contacts;

Google Meet is going free for everyone.

Google Meet tackles Zoom by going completely free for all Meet is one of several video chat apps Google offers : The company's Duo and Hangouts are free, but come with a fair number of limitations. Hangouts only supports up to 25 participants Duo only supports up to 12 participants.  Google also recently added several new features to Meet, including a Zoom-like grid view with support for 16 participants at once, as well as a low-light mode and a noise cancellation feature. Meet was formerly only available as a part of Google's G Suite business-oriented service package, which starts at $6 per month per person, but now it will be free to anyone with a Google account.

aptitude test

aptitude test

The Glassdoor Job Market Report provides a real-time view of job and hiring trends and wage growth based on jobs and salaries

Use checkip.amazonaws.com to retrieve public IP address

Use checkip.amazonaws.com to retrieve public IP address 

Deleting UFW rules

Deleting UFW rules by rule number sudo ufw status numbered Removing UFW rules by specification sudo ufw delete allow 2222

Protecting multiple SSH ports with Fail2ban

In /etc/fail2ban/jail.local : [ssh] enabled  = true port     = ssh,sftp,1234,2222

UDPTunnel is a small program which can tunnel UDP packets bi-directionally over a TCP connection.

UDPTunnel's primary  purpose  (and  original  motivation)  is  to  allow  multi-media        conferences to traverse a firewall which allows only outgoing TCP connections. USAGE        UDPTunnel  can  be  run  in  two  modes:  a client mode and a server mode. The client mode        initiates the TCP connection before  relaying  UDP;  the  server  waits  for  an  incoming        connection  before  doing so. After the TCP connection is established, the behavior of the        two modes is identical. If you are using UDPTunnel to traverse  a  firewall  as  discussed        above,  the  client  would be run inside the firewall, and the server would be run outside        it.

Quebec moves forward with plan to begin opening schools

WireGuard vs OpenVPN

Factors WireGuard OpenVPN Speed Fast Moderate Compatibility Windows, Android, Linux, iOS All devices P2P File Sharing Yes Yes Ease of Setup Yes No Security Strong Strong

Canadian Federation of Students chairperson Sofia Descalzi said students will choose to work and gain experience if jobs are available.

Prime Minister Justin Trudeau has temporarily expanded the Canada Summer Jobs Program (CSJP) to employ up to 70,000 more people

WireGuard® is an extremely simple yet fast and modern VPN that utilizes state-of-the-art cryptography.

WireGuard® aims to be faster, simpler, leaner, and more useful than IPsec, while avoiding the massive headache. It intends to be considerably more performant than OpenVPN. WireGuard is designed as a general purpose VPN for running on embedded interfaces and super computers alike, fit for many different circumstances. Initially released for the Linux kernel, it is now cross-platform (Windows, macOS, BSD, iOS, Android) and widely deployable. It is currently under heavy development, but already it might be regarded as the most secure, easiest to use, and simplest VPN solution in the industry.

Adding your SSH key to the ssh-agent

# start the ssh-agent in the background $ eval $(ssh-agent -s)   $ ssh-add ~/.ssh/id_rsa Or  $ ssh-add to add your default key

The Canadian Shield has won a contract from the federal government to manufacture 10 million reusable face shields

Apple is delaying production of its new 2020 iPhone models due to a slump in demand

Remove Docker Images

docker rmi image_id_1 image_id_2 image

Install Docker From a standard Ubuntu Repository

sudo apt install docker.io

Fixed Unit docker.service could not be found on Ubuntu installed by snap

Temporary solution: Run the command export PATH=$PATH:/snap/bin Permanent solution: Edit /etc/environment and add /snap/bin in the list then restart your system. From $ docker.help Docker snap: Docker Linux container runtime. Due to the confinement issues on snappy, it requires some manual setup to make docker-snap works on your machine. We'll take you through the steps needed to set up docker snap work for you on ubuntu core and ubuntu classic. On Ubuntu classic, before installing the docker snap, please run the following command to add the login user into docker group.     sudo addgroup --system docker     sudo adduser $USER docker     newgrp docker On Ubuntu Core 16, after installing the docker snap from store, you need to connect the home interface as it's not auto-connected by default.     sudo snap connect docker:home :home Then have fun with docker in snappy. ubuntu@ip-172-31-8-122:~$  sudo docker run hello-world Unable to find image 'hello-world:latest' locally

Reload /etc/environment without rebooting

Either the following two ways: ubuntu@ip-172-31-8-122:~$ for env in $( cat /etc/environment ); do export $(echo $env | sed -e 's/"//g'); done ubuntu@ip-172-31-8-122:~$ sed 's/^/export /' /etc/environment > /tmp/env.sh && source /tmp/env.sh

Canada lost 1,011,000 jobs in March, unemployment rises to 7.8%

Statistics Canada reports the economy lost 1,011,000 jobs in March as the COVID-19 crisis began to take hold

US temporarily suspends immigration

Canada lost more than one million jobs in March, StatsCan reports

AWS M5 is meant for workloads that have consistent behavior, with a balance of CPU, RAM and storage.

For a normal application server workload, M5 is often the best choice, and many companies run their production applications on M instances.

Install Docker Compose on CentOS/Fefora

[ec2-user@ip-172-31-5-206 my]$ sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current                                  Dload  Upload   Total   Spent    Left  Speed 100   638  100   638    0     0   3112      0 --:--:-- --:--:-- --:--:--  3112 100 11.1M  100 11.1M    0     0  9560k      0  0:00:01  0:00:01 --:--:-- 13.2M [ec2-user@ip-172-31-5-206 my]$ sudo chmod +x /usr/local/bin/docker-compose [ec2-user@ip-172-31-5-206 my]$ docker-compose --version docker-compose version 1.23.1, build b02f1306

Docker Compose is a tool that allows you to define and run multi-container Docker applications.

With Compose, you define the application’s services, networks and volumes in a single YAML file, then spin your application with a single command. Compose can be used for different purposes such as single host application deployments, automated testing, and local development.

Language Go help

$ go help Go is a tool for managing Go source code. Usage:         go <command> [arguments] The commands are:         bug         start a bug report         build       compile packages and dependencies         clean       remove object files and cached files         doc         show documentation for package or symbol         env         print Go environment information         fix         update packages to use new APIs         fmt         gofmt (reformat) package sources         generate    generate Go files by processing source         get         download and install packages and dependencies         install     compile and install packages and dependencies         list        list packages or modules         mod         module maintenance         run         compile and run Go program         test        test packages         tool        run specified go tool         version     print Go version         vet         report likely mistakes in package

Language Go Hello World

package main import " fmt " func main () { fmt. Println ( " hello world " ) }

Finding Your Windows Version

Open the Run dialog box. Type winver and hit ↵ Enter or click OK. Check your version.

Make a MySQL session read-only.

SET SESSION TRANSACTION READ ONLY;

Serverless computing extends the abstraction of infrastructure in the cloud.

You focus on the code for your applications.

AWS meets high-availability and fault tolerance standards. They offer more than 165 services and more then 50 security and compliance certifications.

Amazon GuardDuty is a threat detection service that continuously monitors for malicious activity and unauthorized behavior to protect your AWS accounts and workloads.

 With the cloud, the collection and aggregation of account and network activities is simplified, but it can be time consuming for security teams to continuously analyze event log data for potential threats. With GuardDuty, you now have an intelligent and cost-effective option for continuous threat detection in the AWS Cloud. 

Digital transformation services, like Machine Learning and Artificial Intelligence, are top priorities for customers

AWS hybrid architecture

Customers may want to run a hybrid architecture of both on-premises and in the cloud.  Almost every AWS customer with on-premises infrastructure is running a hybrid architecture. AWS customers are able to use a seamless experience between their existing on-premises investments while obtaining the benefits of the AWS Cloud. AWS doesn’t require additional on-premises investments by customers to run a hybrid architecture.

Jenkins X extends Jenkins further by adding comprehensive Kubernetes integration.

Jenkins X Pipelines are built on Tekton Pipelines, which aid in running CI/CD pipelines on Kubernetes. You can configure your pipeline using a jenkins-x.yml file (compared to a traditional Jenkinsfile). Jenkins X also provides build packs, which can help package source code into images that can then be deployed to Kubernetes.

Azure DevOps is Microsoft’s all-in-one service for project management, source code management (SCM), and CI/CD.

Azure Pipelines provide the platform’s CI/CD service.  Azure DevOps allows you to control nearly every stage in the DevOps lifecycle while offering many advanced container-specific features, including private container registries and integration with Azure Kubernetes Service (AKS). 

Read from STDIN in Groovy

print " What is your name? " def name = System . in . newReader() . readLine() println " Your name is " + name Exmaple: $ groovy hello.goovy What is your name? Goyun Your name is Goyun

Hello World in Goovy

Inside: hello_world.groovy print "Hello World!\n" Run $ groovy hello_world.groovy

Groovy: “Unable to locate package” while trying to install packages with APT

Run sudo apt-get update Example: root@2d91134ff240:/# groovy -v bash: groovy: command not found root@2d91134ff240:/# apt -y install groovy Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package groovy root@2d91134ff240:/# apt -y install groovy Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package groovy root@2d91134ff240:/#  apt-get update

Reset User Password in Windows Subsystem for Linux (WSL) Ubuntu

Open a command prompt or PowerShell. Then change the default user to root for the WSL Ubuntu  ubuntu config --default-user root Use the following command to change the former default user's password: passwd <username> Switch back your former user: ubuntu config --default-user <username>

Setting Windows File Associations to Open .JNLP Files Properly

Close any Collaborate session or recording windows. Open the Windows Control Panel and go into Programs and Features. Check the list of programs to ensure that Java is already installed on the system. If it isn't installed, please download and install Java from www.java.com before proceeding. Download a new Collaborate meeting or recording file but don't launch the file yet. Locate the meeting or recording .jnlp file in your Downloads folder. Right-click on the file and choose Open with then click Choose another app. If you see Java (TM) Web Start Launcher in this list (you may need to click More apps to expand the list), select it and check the box that says Always use this app to open .jnlp files then click the OK button. If Java (TM) Web Start Launcher is not in the list, check the box that says Always use this app to open .collab files then click Look for another app on this PC. Navigate to the following location: c:\program files\java\jreXXX\bin XXX represents a number tha

Server-Side Configuration for SSH Port Forwarding

The AllowTcpForwarding option in the OpenSSH server configuration file must be enabled on the server to allow port forwarding. By default, forwarding is allowed. Possible values for this option are yes or all to allow all TCP forwarding,  no to prevent all TCP forwarding,  local to allow local forwardings, and  remote to allow remote forwardings. Another option of interest is AllowStreamLocalForwarding, which can be used to forward Unix domain sockets. It allows the same values as AllowTcpForwarding. The default is yes. For example:     AllowTcpForwarding remote     AllowStreamLocalForwarding no The GatewayPorts configuration option also affects remote port forwardings. Possible values were no (only local connections from server host allowed; default),  yes (anyone on the Internet can connect to remote forwarded ports),  clientspecified (client can specify an IP address that can connect, anyone can if not specified).

Fix “SSH Too Many Authentication Failures” Error

To fix this error, you need to add the IdentitiesOnly with a value of yes, which instructs ssh to only use the authentication identity files specified on the command line or the configured in the ssh_config file(s), even if ssh-agent offers additional identities. For example: $ ssh -o IdentitiesOnly=yes goyun Alternatively, if you want this to work for all ssh client connections, you can configure it in your ~/.ssh/config file. $ vim ~/.ssh/config Add the following configuration in the file, under the Host * section as shown in the screesnhot. Host *         IdentitiesOnly=yes

tmux shortcuts and cheatsheet

start new: tmux start new with session name: tmux new -s myname attach: tmux a  #  (or at, or attach) attach to named: tmux a -t myname list sessions: tmux ls kill session: tmux kill-session -t myname Kill all the tmux sessions: tmux ls | grep : | cut -d. -f1 | awk '{print substr($1, 0, length($1)-1)}' | xargs kill In tmux, hit the prefix ctrl+b (my modified prefix is ctrl+a) and then: List all shortcuts to see all the shortcuts keys in tmux simply use the bind-key ? in my case that would be CTRL-B ? Sessions :new<CR>  new session s  list sessions $  name session Windows (tabs) c  create window w  list windows n  next window p  previous window f  find window ,  name window &  kill window Panes (splits) %  vertical split "  horizontal split o  swap panes q  show pane numbers x  kill pane +  break pane into window (e.g. to select text by mouse to copy) -  restore pane from window ⍽  space - toggle between layouts <prefix> q (Show pane numbers, when the number

Show indexes for a MySQL table

SELECT COLUMN_NAME, COLUMN_KEY FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'db' AND TABLE_NAME = 'goyun' AND COLUMN_KEY != '' For primary key: SELECT COLUMN_NAME, COLUMN_KEY FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'db' AND TABLE_NAME = 'goyun' AND COLUMN_KEY != 'PRI'

MySQL LOW_PRIORITY

MySQL LOW_PRIORITY only affects storage engines which use table-level locking, like MyISAM and MEMORY. None of those engines support foreign key constraints.

semrush

Image

The most precious currency for digital marketer is time

Amazon EFS different than Amazon S3

Amazon EFS provides shared access to data using a traditional file sharing permissions model and hierarchical directory structure via the NFSv4 protocol. Applications that access data using a standard file system interface provided through the operating system can use Amazon EFS to take advantage of the scalability and reliability of file storage in the cloud without writing any new code or adjusting applications. Amazon S3 is an object storage platform that uses a simple API for storing and accessing data. Applications that do not require a file system structure and are designed to work with object storage can use Amazon S3 as a massively scalable, durable, low-cost object storage solution.

produce regular, high-quality content that's valuable to your niche.

Table of the prescribed northern or intermediate zones for Ontario

Zone A - Prescribed Northern Zones Zone B - Prescribed Intermediate Zones Angling Lake Attawapiskat Attawapiskat 91 Attawapiskat 91A   Bearskin Lake Bearskin Lake (reserve) Big Beaver House Big Lake (south of Winisk) Big Trout Lake Big Trout Lake (reserve)   Cape Henrietta-Maria Wilderness Area   Deer Lake (Northern Ontario)   Factory Island 1 Fort Albany Fort Albany 67 Fort Hope Fort Hope 64 Fort Hope, Eabamet P.O. Fort Severn Fort Severn 89   Galeton Ghost River (west of Moosonee)   Kasabonika Kasabonika Lake Kashechewan Keewaywin (reserve) Kingfisher 1 Kingfisher Lake   Lake River Lansdowne House Lingman Lake   Marten Falls 65 Moose Factory Moose Factory 68 Moosonee Muskrat Dam Lake   North Spirit Lake   Ogoki Old Fort Albany Wilderness Area Opasquia Opasquia Provincial Park   Peawanuck (north of Webequie) Polar Bear Provincial Park Ponask   Sachigo Lake Sachigo Lake 1 Sachigo Lake 2 Sachigo Lake 3 Sandy Lake Sandy Lake 88 Sandy Lake, Favourable Lake P.O. Summer Beaver Sutton Lake G

United Nations says virus could wipe out equivalent of 195 million jobs worldwide

Ledger to Accept Digital Currency Payments via Crypto.com’s App

Google Fi is an MVNO - mobile virtual network operator

Google Fi piggybacks on existing wireless networks to deliver service. The uniqueness of  Fi is that it switches between three wireless networks -- T-Mobile, Sprint and US Cellular -- instead of using just one. The idea is that it'll switch to the best-performing network wherever you happen to be.

Try to avoid words with multiple meanings.

Look for low-hanging fruit; long-tail keywords with specific intent and low competition.

Amazon DocumentDB implements the Apache 2.0 open source MongoDB 3.6 API

Amazon DocumentDB implements the Apache 2.0 open source MongoDB 3.6 API by emulating the responses that a MongoDB client expects from a MongoDB server, allowing you to use your existing MongoDB drivers and tools with Amazon DocumentDB. Updating your application is as easy as changing the database endpoint to a new Amazon DocumentDB cluster. 

Site Kit by Google

Site Kit Google's official WordPress plugin Get insights about how people find and use your site, how to improve, and monetize your content, directly in your WordPress dashboard https://sitekit.withgoogle.com/

Site Kit by Google

Site Kit Google's official WordPress plugin Get insights about how people find and use your site, how to improve, and monetize your content, directly in your WordPress dashboard https://sitekit.withgoogle.com/

MySQL ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

Change innodb_lock_wait_timeout Property Value Command-Line Format --innodb-lock-wait-timeout=# System Variable innodb_lock_wait_timeout Scope Global, Session Dynamic Yes Type Integer Default Value 50 Minimum Value 1 Maximum Value 1073741824 The length of time in seconds an InnoDB transaction waits for a row lock before giving up. The default value is 50 seconds. A transaction that tries to access a row that is locked by another InnoDB transaction waits at most this many seconds for write access to the row before issuing the following error: ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

Fixed: Failed to add the host to the list of known hosts

$ sudo chown -v $USER ~/.ssh/known_hosts

Sync iPhone using Wi-Fi

After you set up syncing with iTunes using USB, you can set up iTunes to sync to your device with Wi-Fi instead of USB. Connect your device to your computer with a USB cable, then open iTunes and select your device.  Click Summary on the left side of the iTunes window.  Select "Sync with this [device] over Wi-Fi."  Click Apply. When the computer and the device are on the same Wi-Fi network, the device appears in iTunes. The device 

Sync iPhone using Wi-Fi

After you set up syncing with iTunes using USB, you can set up iTunes to sync to your device with Wi-Fi instead of USB. Connect your device to your computer with a USB cable, then open iTunes and select your device.  Click Summary on the left side of the iTunes window.  Select "Sync with this [device] over Wi-Fi."  Click Apply. When the computer and the device are on the same Wi-Fi network, the device appears in iTunes. The device 

Google API multiple scopes

To set multiple scopes, set the scope parameter to multiple scopes, each separated by a single space. Example: private static final List<String> SCOPES = Collections.singletonList(BloggerScopes.BLOGGER+" https://www.googleapis.com/auth/indexing");

Job losses hit 1 million

Canada expects coronavirus deaths to soar;  Canada's coronavirus death toll is set to soar from more than 500 currently to as high as 22,000 by the end of the pandemic.

P.E.I. senators call on Ottawa to incentivise farming jobs during COVID-19

Griffin said even those that do make it to Canada will have to self-isolate for two weeks when they arrive.

Canada lost 1 million jobs in March

The COVID-19 pandemic decimated one million jobs in Canada in March.

ChromeDriver can't click a moving element

This is not a supported feature of ChromeDriver. If the element eventually stops, wait for that to occur. If the element never stops moving, ChromeDriver does not guarantee the click will be successful.

ChromeDriver can't click a moving element

This is not a supported feature of ChromeDriver. If the element eventually stops, wait for that to occur. If the element never stops moving, ChromeDriver does not guarantee the click will be successful.

Selenium IDE Common Commands

open assertTitle / VerifyTitle AssertForElementPresent / VerifyForElementPresent AssertForTextPresent / VerifyForTextPresent type / typeAndWait / sendKeys click /clickAt / clickAndWait waitForPageToLoad waitForElementPresent chooseOkOnNextConfirmation / chooseCancelOnNextConfirmation

Selenium IDE Common Commands

open assertTitle / VerifyTitle AssertForElementPresent / VerifyForElementPresent AssertForTextPresent / VerifyForTextPresent type / typeAndWait / sendKeys click /clickAt / clickAndWait waitForPageToLoad waitForElementPresent chooseOkOnNextConfirmation / chooseCancelOnNextConfirmation

Selenium IDE allows the user to specify a start point within a test script.

The start point points to the test step from where we wish to start the test script execution. Start point can be used at times when we do not desire to execute the entire test script starting from the beginning rather we customize the script to execute from a certain step.

Selenium IDE allows the user to specify a start point within a test script.

The start point points to the test step from where we wish to start the test script execution. Start point can be used at times when we do not desire to execute the entire test script starting from the beginning rather we customize the script to execute from a certain step.

Locators in Selenium

By CSS ID: find_element_by_id By CSS class name: find_element_by_class_name By name attribute: find_element_by_name By DOM structure or xpath: find_element_by_xpath By link text: find_element_by_link_text By partial link text: find_element_by_partial_link_text By HTML tag name: find_element_by_tag_name

Locators in Selenium

By CSS ID: find_element_by_id By CSS class name: find_element_by_class_name By name attribute: find_element_by_name By DOM structure or xpath: find_element_by_xpath By link text: find_element_by_link_text By partial link text: find_element_by_partial_link_text By HTML tag name: find_element_by_tag_name

There are two kinds of Selenium waits

Implicit wait - used to set the default waiting time throughout the program Explicit wait - used to set the waiting time for a particular instance only Implicit Wait It is simpler to code than Explicit Waits. It is usually declared in the instantiation part of the code. Explicit Wait Explicit waits are done using the WebDriverWait and ExpectedCondition classes. For the following example, we shall wait up to 10 seconds for an element whose id is "username" to become visible before proceeding to the next command. 

There are two kinds of Selenium waits

Implicit wait - used to set the default waiting time throughout the program Explicit wait - used to set the waiting time for a particular instance only Implicit Wait It is simpler to code than Explicit Waits. It is usually declared in the instantiation part of the code. Explicit Wait Explicit waits are done using the WebDriverWait and ExpectedCondition classes. For the following example, we shall wait up to 10 seconds for an element whose id is "username" to become visible before proceeding to the next command. 

Selenium locating elements

Variation Description Sample By. className finds elements based on the value of the "class" attribute findElement(By.className("someClassName")) By. cssSelector finds elements based on the driver's underlying CSS Selector engine findElement(By.cssSelector("input#email")) By. id locates elements by the value of their "id" attribute findElement(By.id("someId"))     By. linkText finds a link element by the exact text it displays findElement(By.linkText("REGISTRATION"))     By. name locates elements by the value of the "name" attribute findElement(By.name("someName"))     By. partialLinkText locates elements that contain the given link text findElement(By.partialLinkText("REG"))     By. tagName locates elements by their tag name findElement(By.tagName("div"))     By. xpath locates elements via XPath findElement(By.xpath("//html/body/div/table/tbody/tr/td[2]/table/   tbody/tr[4]/td/t

Selenium locating elements

Variation Description Sample By. className finds elements based on the value of the "class" attribute findElement(By.className("someClassName")) By. cssSelector finds elements based on the driver's underlying CSS Selector engine findElement(By.cssSelector("input#email")) By. id locates elements by the value of their "id" attribute findElement(By.id("someId"))     By. linkText finds a link element by the exact text it displays findElement(By.linkText("REGISTRATION"))     By. name locates elements by the value of the "name" attribute findElement(By.name("someName"))     By. partialLinkText locates elements that contain the given link text findElement(By.partialLinkText("REG"))     By. tagName locates elements by their tag name findElement(By.tagName("div"))     By. xpath locates elements via XPath findElement(By.xpath("//html/body/div/table/tbody/tr/td[2]/table/   tbody/tr[4]/td/t