What booking/appointments plugin can I use that supports multiple employees that are located in different timezones?

What booking/appointments plugin can I use that supports multiple employees that are located in different timezones?

I have a site I’m working on in WordPress for a multi-instructor live course/online lessons system.
I have been searching for booking calendar/appointment plugins and have not come across a single one that supports multiple staff/employees in different timezones. They all have the feature for customers to view the calendar in their own timezone, but don’t have the ability for a staff member to create a schedule for the week in their timezone.

For instance, let’s say Jerry lives in India. He wants to make his schedule for the week in Indian time since he lives in India. He adds availability Monday-Friday from 4pm (Indian time) – 8pm (Indian Time).

A student from the United States sees his profile and wants to book his class. The calendar on the customer end is displayed in Los Angeles, USA time and the student chooses an appointment that is available that Jerry set in Indian time. Does that make sense?

I haven’t found a single plugin that does this, and it’s extremely frustrating. My current timezone is Bangkok, and I want the site to stay in Bangkok timezone while each individual employee is able to set their own individual timezone depending on where they live.
I don’t want to have to build a timezone chart for each timezone possibility and have the employees adhere to Bangkok time and make mistakes on their availability and schedule due to bad math.

Can anyone help me? Where can I find a good plugin for this? Have I missed or overlooked something? Should I just use some 3rd party site for team scheduling and make the employee add the link to that site on their profile page? I’m kind of frustrated and lost at this point, and it’s very surprising to me that this feature isn’t included in the top, enterprise-level booking calendar plugins.

Go to Source
Author: Connor Smith

Maintaining Objects Across API Deployment Instances

Maintaining Objects Across API Deployment Instances

I am working on a web application as a hobby and trying to learn some concepts related to cloud development and distributed applications. I am currently targeting an AWS EC2 instance as a deployment environment, and while I don’t currently have plans to deploy the same instance of my API application to many servers, I would like to design my application so that is possible in the future.

I have a search operation that I currently have implemented using a Trie. I am thinking that it would be slow to rebuild the trie every time I need to perform the search operation, so I would like to keep it in memory and insert into it as the search domain grows. I know that if I only wanted to have one server, I could just implement the trie structure as a singleton and dependency inject it. If I do this in a potentially distributed application, though, I would be opening myself up to data consistency issues.
My thought was to implement the trie in another service and deploy it separately and make requests to it (this sounds like micro service concepts, but I have no experience with those). Is this common practice? Is there a better solution for maintaining persistent data structures in this way?

Go to Source
Author: jlat96

Use ACF Category Image for all Taxonomy Archive Views

Use ACF Category Image for all Taxonomy Archive Views

I’m wondering if you could help with some code I’m struggling with.

I’ve got an ACF Image Field on the Post Category Taxonomy. I need to add it into the post loop so the category image shows up instead of the featured image. Here’s the code that I have in:

$current_term = get_queried_object();
$author_image = get_field('author_image', $current_term );
echo do_shortcode('[image_shortcode id="'.$author_image.'" image_size="original"]'); 

It’s working on the Category Archive page, but not on the Tags Archive page. Let me know your thoughts.

Go to Source
Author: Jason

Change Font color and size when booting into CLI ubuntu 20.04 LTS

Change Font color and size when booting into CLI ubuntu 20.04 LTS

I was wondering if there was a way to increase font size and change font colour when booting into CLI.
The font is small and white on black, I want it to change the font colour.
If anyone can help, that would be great.
I am ready to provide any system details if needed.
Thanks

Go to Source
Author: Ammar

AWS LightSail OpenVPN + ASUS RT-3200 – TLS Error: Key negotiation failed

AWS LightSail OpenVPN + ASUS RT-3200 – TLS Error: Key negotiation failed

Using https://github.com/angristan/openvpn-install i have installed openvpn on AWS Lightsail Instance (Ubuntu 18.04 LTS). My server config file is as follows:

    port 33434
    proto udp
    dev tun
    user nobody
    group nogroup
    persist-key
    persist-tun
    keepalive 10 120
    topology subnet
    server 10.8.0.0 255.255.255.0
    ifconfig-pool-persist ipp.txt
    push "dhcp-option DNS 8.8.8.8"
    push "dhcp-option DNS 8.8.4.4"
    push "redirect-gateway def1 bypass-dhcp"
    dh dh.pem
    tls-auth tls-auth.key 0
    crl-verify crl.pem
    ca ca.crt
    cert server_VYtknmf1PC80WpTG.crt
    key server_VYtknmf1PC80WpTG.key
    auth SHA512
    cipher AES-256-CBC
    ncp-ciphers AES-256-CBC
    tls-server
    client-config-dir /etc/openvpn/ccd
    status /var/log/openvpn/status.log
    verb 3

And my client.ovpn is as follows:

client
proto udp
explicit-exit-notify
remote 35.173.69.115 33434
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_VYtknmf1PC80WpTG name
auth SHA512
auth-nocache
cipher AES-256-CBC
tls-client
setenv opt block-outside-dns # Prevent Windows 10 DNS leak
verb 3

I have added port ‘33434’ UDP in Firewall rule of AWS instance.

I added a new profile in VPN Client section of the asus router and uploaded the client.ovpn file. And clicked activate and get follow message in the log.

May 15 22:29:43 vpnclient1[17419]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
May 15 22:29:43 vpnclient1[17419]: Socket Buffers: R=[122880->122880] S=[122880->122880]
May 15 22:29:43 vpnclient1[17419]: UDPv4 link local: [undef]
May 15 22:29:43 vpnclient1[17419]: UDPv4 link remote: [AF_INET]35.173.69.115:33434
May 15 22:29:43 vpnclient1[17419]: TLS: Initial packet from [AF_INET]35.173.69.115:33434, sid=61d9df2d 1f97bdd0
May 15 22:30:02 rc_service: service 17718:notify_rc restart_letsencrypt
May 15 22:30:43 vpnclient1[17419]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
May 15 22:30:43 vpnclient1[17419]: TLS Error: TLS handshake failed
May 15 22:30:43 vpnclient1[17419]: SIGUSR1[soft,tls-error] received, process restarting
May 15 22:30:43 vpnclient1[17419]: Restart pause, 2 second(s)

Please suggest how to fix the issue. Thank you.

Go to Source
Author: Saad Bashir

vi: write relative range of lines to a file

vi: write relative range of lines to a file

I need to be able to write a range of lines from a file to another file, I’ve found the :<start>,<end>w <new file> solution but what I need is to be able to search for a string and write a a few lines to another file starting at the “found” location. Using .,. works to get one line but what if I want, say, 10 lines? Adding to the complexity is that I want to do this in a script. How do I do that (can I turn on Visual Mode in a script and then move the cursor)?

Go to Source
Author: Senior Geek

Plotting multiple confusion matrix side by side

Plotting multiple confusion matrix side by side

I am new here. This is my first question that I hope to get an answer from experts. I have 5 classifier models that I am trying to plot their confusion matrix.

from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
import collections

classifiers = {
    "Naive Bayes": GaussianNB(),
    "LogisiticRegression": LogisticRegression(),
    "KNearest": KNeighborsClassifier(),
    "Support Vector Classifier": SVC(),
    "DecisionTreeClassifier": DecisionTreeClassifier(),
}

and then

from sklearn.metrics import confusion_matrix
for key, classifier in classifiers.items(): 
    y_pred = classifier.fit(X_train, y_train).predict(X_test)
    cf_matrix=confusion_matrix(y_test, y_pred)
    print(cf_matrix)

which gives me

This

now I am trying to plot them with below code but no data is shown on the plots.

fig, axn = plt.subplots(1,5, sharex=True, sharey=True)
cbar_ax = fig.add_axes([.91, .3, .03, .4])

for i, ax in enumerate(axn.flat):
    sns.heatmap(cf_matrix, ax=ax,
                cbar=i == 0,
                vmin=0, vmax=1,
                cbar_ax=None if i else cbar_ax)

fig.tight_layout(rect=[0, 0, .9, 1])

Here is how it looks like

Can someone please help me get this done?

Regards,
Hadi

Go to Source
Author: hadi0815

MongoDB query to try multiple cases using aggregate, $group, $switch…returning error Unrecognized pipeline stage name: ‘$switch’

MongoDB query to try multiple cases using aggregate, $group, $switch…returning error Unrecognized pipeline stage name: ‘$switch’

Using MongoDB aggregate to see if a first field and/or a second field have value(s), and if so, to increment the NumberMatches by either 1 or 2 (depending on whether one or both exampleA and exampleB have values), and to increment MatchesTotal by the values of exampleA/exampleB. I am using Mongo’s $switch, as with this example from Stack Overflow, and $group.

However, I am getting the error message Unrecognized pipeline stage name: '$switch'. Right now the $switch is outside of $group. Previously I had tried using the $switch within MongoDB $group to try the query, but got another error message unknown group operator '$switch'. How can I use $switch and $group together in order to do this incrementation/sum ternary query in MongoDB?

$switch query with $group inside:

db.examples.aggregate([
  {
    "$match": {
      $or : [
        { 
          $and : [ 
            {"exampleField.exampleA": {$type: 16}},
            {"exampleField.exampleB": { $type: 16 }}
          ]
        },
        { 
          "exampleField.exampleA": {$type: 16}
        },
        { 
          "exampleField.exampleB": {$type: 16}
        }               
      ]
    }
  },    
  {
    $switch: {
      "branches": [
        { "case": 
          { "$eq": [ "$exampleField.exampleA", null ] }, 
          "then": { 
            $group: {
              _id: null,
              NumberMatches: { $sum: 1 },
              MatchesTotal: { $sum: "exampleField.exampleB" }
            }
          }
        },
        { "case": { 
          "$eq": [ "exampleField.exampleB", null ] }, 
          "then": {     
            $group: {
              _id: null,
              NumberMatches: { $sum: 1 },
              MatchesTotal: { $sum: "$exampleField.exampleA" }
            } 
          }
        }
      ],
      "default": {     
        $group: {
          _id: null,
          NumberMatches: { $sum: 2 },
          MatchesTotal: { $sum: "$exampleField.exampleA" + "exampleField.exampleB" }
        } 
      }      
    }     
  },  
]).forEach( function(myDoc) { print( myDoc) } );

Alternate $group query with $switch inside (also didn’t work):

$group: {
  _id: null,

  NumberMatches: {
      $switch: {
          "branches": [
              { "case": { "$eq": [ "$exampleField.exampleA", null ] }, "then": { $sum: 1 } },
              { "case": { "$eq": [ "exampleField.exampleB", null ] }, "then": { $sum: 1 } }
            ],
        "default": { $sum: 2 }

      }

  },      
  MatchesTotal: { $sum: "$exampleField.exampleA" + "$exampleField.exampleB" }
}

Go to Source
Author: maudulus

Trying to upgrade to a new release version, having trouble with /etc/apt/sources.list

Trying to upgrade to a new release version, having trouble with /etc/apt/sources.list

I am trying to upgrade to a new release version following the instructions of the accepted answer here.

Someone mentioned in the comments section of the OP’s question that you should change http://old-releases.ubuntu.com/ubuntu/ to http://us.archive.ubuntu.com/ubuntu/
so that’s what I did. The current state of my sources.list file is as shown below.

enter image description here
enter image description here

When I try to run sudo apt-get update && sudo apt-get dist-upgrade, I get

Ign:1 http://us.archive.ubuntu.com/ubuntu disco InRelease
Hit:2 http://packages.microsoft.com/repos/vscode stable InRelease                                                            
Ign:3 http://us.archive.ubuntu.com/ubuntu disco-updates InRelease                                                            
Hit:4 http://dl.google.com/linux/chrome/deb stable InRelease                              
Hit:5 https://repo.skype.com/deb stable InRelease                                         
Ign:6 http://us.archive.ubuntu.com/ubuntu disco-backports InRelease                       
Hit:7 http://ppa.launchpad.net/bit-team/stable/ubuntu disco InRelease
Ign:8 http://us.archive.ubuntu.com/ubuntu disco-security InRelease
Err:9 http://us.archive.ubuntu.com/ubuntu disco Release                            
  404  Not Found [IP: 91.189.91.39 80]
Err:10 http://us.archive.ubuntu.com/ubuntu disco-updates Release                   
  404  Not Found [IP: 91.189.91.39 80]
Err:11 http://us.archive.ubuntu.com/ubuntu disco-backports Release
  404  Not Found [IP: 91.189.91.39 80]
Err:12 http://us.archive.ubuntu.com/ubuntu disco-security Release
  404  Not Found [IP: 91.189.91.39 80]
Ign:13 http://ppa.launchpad.net/pmcenery/ppa/ubuntu disco InRelease
Err:14 http://ppa.launchpad.net/pmcenery/ppa/ubuntu disco Release
  404  Not Found [IP: 2001:67c:1560:8008::15 80]
Reading package lists... Done
E: The repository 'http://us.archive.ubuntu.com/ubuntu disco Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://us.archive.ubuntu.com/ubuntu disco-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://us.archive.ubuntu.com/ubuntu disco-backports Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://us.archive.ubuntu.com/ubuntu disco-security Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://ppa.launchpad.net/pmcenery/ppa/ubuntu disco Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

What should I do?

Go to Source
Author: An Ignorant Wanderer

Install driver rtl8814au on ubuntu 20.04

Install driver rtl8814au on ubuntu 20.04

Based on this

Install driver rtl8814au on ubuntu 18.04

I installed manually (make && make install) the driver when I had the kernel

$ uname -r
5.4.0-26-generic

Now, ubuntu 20.04 wants to install the new one:

linux-image-5.4.0-29-generic

I did it before (upgrade the system then, the kernel) and the driver stopped to work, even I installed thousand times, was impossible to up the driver which logical name is “wlx50c4ddcf488e”.

The installation I made:

$ sudo apt install build-essential
$ sudo apt install bc
$ sudo apt install linux-headers-`uname -r`
$ sudo apt install git

$ git clone https://github.com/aircrack-ng/rtl8812au.git

$ cd rtl8812au
$ make && sudo make install

Does anyone has idea about what can I do? Now, I cannot upgrade my system without losing the wireless connection.

Thank a lot.

Go to Source
Author: Ibringpies