[ Other – Society & Culture ] Open question: Why do men scratch their private space in PUBLIC?

[Other – Society and culture] Open question: Why do men scratch their private space in PUBLIC?

php – Adds key / value pairs to an existing array in a public function

I want to add key value pairs (advanced custom fields) to a table configured in the parent theme. The function and the table are configured as below (shortcut). I can add it here, but I prefer not to add it to the parent theme. You can see at the end that shortAddress is added. So, how could I add a key-value pair to the data array from say functions.php?

abstract class The_Listing {

/**
 * The associated WordPress post object.
 *
 * @since 2.0.0
 * @var WP_Post $post
 */
protected $post;

/**
 * Load a new instance of a listing.
 *
 * @since 2.0.0
 *
 * @param null|int|WP_Post $post Current object.
 */
public function __construct( $post ) {
    if ( ! $post ) {
        $this->post = get_post();
    } elseif ( is_int( $post ) ) {
        $this->post = get_post( $post );
    } elseif ( is_a( $post, 'WP_Post' ) ) {
        $this->post = $post;
    }
}

public function to_array() {
    /**
     * Allow plugins and themes to add data describing a listing. This data
     * is sent to the Javascript result output to be accessed via Javascript
     * template functions.
     *
     * @since 2.0.0
     *
     * @param array $data Data about the listing.
     * @param array $this The current listing.
     * @return array $data
     */
    return apply_filters(
        'listify_get_listing_to_array',
        array(
            'id'             => $this->get_id(),
            'object'         => $this->get_object(),
            'status'         => array(
                'published'      => 'publish' === $this->get_status(),
                'featured'       => $this->is_featured(),
                'claimed'        => $this->is_claimed(),
                'favorited'      => $this->is_favorited(),
                'businessHours'  => null === $this->is_open() ? false : ( $this->get_business_hours() ? $this->get_business_hours() : false ),
                'businessIsOpen' => $this->is_open(),
            ),
            'permalink'      => $this->get_permalink(),
            'title'          => $this->get_title(),
            'telephone'      => $this->get_telephone(),
            'location'       => array(
                'raw'     => $this->get_location( 'raw' ),
                'address' => $this->get_location_formatted(),
                'lng'     => $this->get_lng(),
                'lat'     => $this->get_lat(),
            ),
            'featuredImage'  => array(
                'url' => $this->get_featured_image(),
            ),
            'secondaryImage' => array(
                'url'       => esc_url( $this->get_secondary_image() ),
                'type'      => esc_attr( get_theme_mod( 'listing-archive-card-avatar', 'avatar' ) ),
                'style'     => esc_attr( get_theme_mod( 'listing-archive-card-avatar-style', 'circle' ) ),
                'permalink' => 'avatar' === get_theme_mod( 'listing-archive-card-avatar', 'avatar' ) ? esc_url( get_author_posts_url( $this->get_object()->post_author ) ) : null,
            ),
            'mapMarker'      => array(
                'term'   => $this->get_marker_term()->term_id,
                'icon'   => $this->get_marker_term_icon(),
                'target' => get_theme_mod( 'listing-archive-window', false ) && ! is_front_page() ? '_blank' : '',
            ),
            'styles'         => array(
                'featuredStyle' => get_theme_mod( 'listing-archive-feature-style', 'outline' ),
                'cardClasses'   => listify_get_listing_card_class( $this->get_id() ),
            ),
            'i18n'           => array(
                'featured' => _x( 'Featured', 'featured listing', 'listify' ),
            ),
            'reviews'        => array(
                'average' => $this->get_rating_average(),
                'count'   => $this->get_rating_count(),
                'stars'   => array(
                    'full'  => floor( $this->get_rating_average() ),
                    'half'  => ceil( $this->get_rating_average() - floor( $this->get_rating_average() ) ),
                    'empty' => $this->get_rating_best() - floor( $this->get_rating_average() ) - ceil( $this->get_rating_average() - floor( $this->get_rating_average() ) ),
                ),
                'i18n'    => array(
                    // Translators: %d Number of stars.
                    'totalStars' => sprintf( _n( '%d Star', '%d Stars', $this->get_rating_average(), 'listify' ), $this->get_rating_average() ),
                ),
            ),
            'json_ld'        => $this->get_json_ld(),

            // @todo figure out a better way to pass these conditionals
            'cardDisplay'    => array(
                'title'          => get_theme_mod( 'listing-card-display-title', true ),
                'address'        => get_theme_mod( 'listing-card-display-location', true ),
                'telephone'      => get_theme_mod( 'listing-card-display-phone', true ),
                'rating'         => get_theme_mod( 'listing-card-display-rating', true ) && ( listify_has_integration( 'ratings' ) || listify_has_integration( 'wp-job-manager-reviews' ) ),
                'secondaryImage' => get_theme_mod( 'listing-card-display-secondary-image', true ),
                'claimed'        => get_theme_mod( 'listing-card-display-claim-badge', true ),
                'target'         => get_theme_mod( 'listing-archive-window', false ),
            ),

            // @todo this probably should be added from somewhere else
            'currentUser'    => array(
                'id' => get_current_user_id(),
            ),
            'shortAddress' => get_field('short_address',$this->get_id()),
        ),
        $this
    );
}

}

Facebook to change groups in public or private

Facebook has stated that it is changing its public parameter groups, closed or secret for their group, in Public or Private only.

Globo.Tech | Based in Canada | Complete public cloud SSD | $ 5 credit | Try it now without risk

GloboTech Communications offers premium hosting services.

Rely on OpenStack's GloboTech Enterprise Cloud to drive your IT infrastructure and focus on growing your business. Launch cloud servers in seconds, adapt them as needed with ease and pay only for the resources used.

Globo 1
$ 0.0070 / hour
$ 5 / month
—————–
1 VCPU
768 MB of memory
15GB of SSD storage
2 TB bandwidth transfer
Get it now

Globo 2
$ 0.0140 / hour
$ 10 / month
—————–
1 VCPU
1GB of memory
40 GB of SSD storage
2 TB bandwidth transfer
Get it now

Globo 3
$ 0.0270 / hour
$ 20 / month
—————–
2 VCPU
2 GB of memory
80 GB of SSD storage
2 TB bandwidth transfer
Get it now

Globo 4
$ 0.0550 / hour
$ 40 / month
—————–
2 VCPU
4GB of memory
100 GB of SSD storage
2 TB bandwidth transfer
Get it now

Globo 5
$ 0.0820 / hour
$ 60 / month
—————–
4 VCPU
6 GB of memory
120 GB of SSD storage
2 TB bandwidth transfer
Get it now

Globo 6
$ 0.1100 / hour
$ 80 / month
—————-
4 VCPU
8 GB of memory
160 GB of SSD storage
2 TB bandwidth transfer
Get it now

Globo 7
$ 0.1370 / hour
$ 100 / month
—————–
6 VCPU
12 GB of memory
200 GB of SSD storage
2 TB bandwidth transfer
Get it now

features:
-Fast Cloud Server Delivery
-Super Fast All-SSD Storage
-Premium Connectivity
-Full access to the root
Cloud portal complete and easy to use
Security Group and SSH Keys
-Private network
-Pay only for the resources you use
-Powered by OpenStack

We offer on demand and fully managed options. Visit our website or contact our sales team for more information.

Here are some reasons why we choose:

• In business for over 19 years

We are not going anywhere! We have been helping companies around the world since 1999.

• 24/7/365 Support

Internal and continuous assistance is available to our client. Know that we will be there to help you when you need it the most.

• 100% network availability

Our network has been designed to be fully redundant and very robust. Do not waste money because of downtime. Connect to the GloboTech network now!

• Redundant network

All devices have been configured redundantly to ensure maximum availability.

• Network capacity

Our network is connected to a capacity of over 100 Gbps by Tier1 and Premium operators. We do not over-sell our network and we are constantly adding new uplinks to ensure capacity, speed and robustness.

• Optimized routing

GloboTech Communications has implemented an optimization system capable of delivering redundant Internet access of over 100 Gbps through leading bandwidth providers, ensuring ultra-fast network transit while meeting their service level agreement 100% Uptime.

• Support-oriented server management and optional
Customers with little knowledge of server administration can rest assured that our support team will be there to help them in case of a problem. No matter what you need, we will be there to help you.

Contact us
Sales: sales@globo.tech
Visit our website: https://www.globo.tech/

python – How to install dependencies that come in part from the local directory and the public repository?

I create a setup.py file for my project:

install_requires = [
    "rasa==1.0.1",
    "beautifulsoup4==4.7.1",
    "bs4==0.0.1",
    "pyowm==2.10.0",
    "flask-restful==0.3.7",
    "google-cloud-translate==1.6.0",
    "gensim==3.8.0",
]

And as a result, I have the requirements.txt:

rasa==1.0.1
beautifulsoup4==4.7.1
bs4==0.0.1
pyowm==2.10.0
flask-restful==0.3.7
google-cloud-translate==1.6.0
gensim==3.8.0

Then I want to install them in my local environment:

pip install -r requirements.txt
pip install -e .

One question I have is that in the 7 dependencies, all the others come from the public repository, while rasa == 1.0.1 is in my local directory. In such a mixture of dependencies, how can I install Requirements.txt and install them in my local environment?

Networking – Unable to connect with a public instance postgresql rds: connection expired

I created a PostgreSQL RDS test base instance in a VPC. This is a public security group and VPC. The security group whose configuration is as follows:
Incoming rule:
Type: PostgreSQL
Protocol: TCP
Port: 5432
Source: 0.0.0.0/0
outbound:
Type: All
Protocol: all
Port: all
Destination: 0.0.0.0/0

When I try to connect, it fails. Here is the error code I receive:
Can not connect to the server: the connection has expired
Is the server running on host () and is it accepting
TCP / IP connections on port 5432?

I am doing this for the first time so help me please. Any help would be appreciated.

ssh – The public key authentication on the GCP virtual machine no longer works

I have 3 Google virtual machines on which I can not use SSH. It worked but stopped and I can not for life to understand why.

I have confirmed permissions for .ssh and keys on both machines.
Keys added via GCP interface and verified in allowed_hosts

On the client side, here is the debug information I get

debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC:  compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC:  compression: none
debug3: send packet: type 30
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug3: receive packet: type 31
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
debug3: hostkeys_foreach: reading file "/home/XXXX/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/XXXX/.ssh/known_hosts:2
debug3: load_hostkeys: loaded 1 keys from XX.XX.XX.XX
debug1: Host 'XX.XX.XX.XX' is known and matches the ECDSA host key.
debug1: Found key in /home/XXXX/.ssh/known_hosts:2
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug2: key: /home/XXXX/.ssh/id_rsa2 (0x7fffd51f62c0), explicit
debug3: send packet: type 5
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 1
Received disconnect from XX.XX.XX.XX port 22:2: Connection blocked because server only allows public key authentication. Please contact your network administrator.

Looking at the auth.log on the server, I get:
9 Aug 20:48:31 XXXX sshd (18975): The connection was closed by authenticating the port 57813 of the user XXXX XX.XX.XX.XX (preauth)

So it seems that the two machines are pointing at each other and saying "they did it"

This is my configuration file:

Host XXXX
        User XXXX
        HostName XX.XX.XX.XX
        IdentityFile ~/.ssh/id_rsa2
        ServerAliveInterval 120
        ServerAliveCountMax 30

I am short of ideas, someone help you please?

public transport – What are the telephone companies in Moscow on 8/2019?

We are a family of 5 traveling to Moscow this summer. It seems that sometimes renting a 6-seater cabin is cheaper and much more convenient than using tedious public transport.

Which mobile phone companies are present in Moscow and are there differences in their services and prices?

Is it a security risk to give the ssh key and one or both public and private keys to my web hosting provider?

My web hosting provider needs my ssh password and either private or public ssh key to configure ssh access. This seems to be a security risk. Are not private keys supposed to stay on your machine? If I gave my ssh password, could not they just create my public and private keys themselves? Would that not allow them to access my machine? Or am I wrong?

For clarity, it is on the website of the hosting providers that they request the ssh key and one or both public and / or private ssh keys in a Web form, and not a connection error of one openssh terminal or human interaction. They have two text boxes that you can choose one or both and they are for your public and private keys. Then they have a mandatory text box for the ssh key.

I'm used to accessing sites that allow ssh by giving only my public key, which seems suspicious.

Also hope that this falls under risk management, because I try to understand if there is a risk for my machine.

What should a developer know before creating a public website?

What's a programmer to implement to implement the technical details of the address of a website before making it public? If Jeff Atwood can forget about HttpOnly cookies, sitemaps and forgeries of inter-site queries in the same site, what important thing can I forget too?

I think about it from the point of view of a web developer, so that someone else creates the actual design and content of the site. So while usability and content may be more important than the platform, programmers have little to say. What concerns you is that your implementation of the platform is stable, works well, is secure and meets all other business objectives (for example, not costing too much, taking too much time to build, and rank as well with Google content supports).

Think of this from the point of view of a developer who has been working on intranet-type applications in a fairly reliable environment and who is about to embark on and create a potentially popular site for the whole world.