php – Making BuddyPress Activity Stream (Post Type) Featured Images Clickable

I’ve added woocommerce product postings as a post type to BuddyPress Activity stream via this code in bp-custom.php file:

    <?php

add_post_type_support( 'product', 'buddypress-activity' );
 
function customize_page_tracking_args() {
    // Check if the Activity component is active before using it.
    if ( ! bp_is_active( 'activity' ) ) {
        return;
    }
 
    bp_activity_set_post_type_tracking_args( 'product', array(
        'component_id'             => buddypress()->blogs->id,
        'action_id'                => 'new_product_page',
        'bp_activity_admin_filter' => __( 'Published a new product', 'custom-domain' ),
        'bp_activity_front_filter' => __( 'Pages', 'custom-domain' ),
        'contexts'                 => array( 'activity', 'member' ),
        'activity_comment'         => true,
        'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">product</a>', 'custom-textdomain' ),
        'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">product</a>, on the site %3$s', 'custom-textdomain' ),
        'position'                 => 100,
    ) );
}
add_action( 'bp_init', 'customize_page_tracking_args' );

?>

Further, I’ve managed to get the product’s featured images to display in the activity stream for the product post types via this code in my functions.php file:

function icondeposit_bp_activity_entry_meta() {
 
    if ( bp_get_activity_object_name() == 'blogs' && bp_get_activity_type() == 'new_product_page' ) {?>
        <?php
        global $wpdb, $post, $bp;
        $theimg = wp_get_attachment_image_src(  get_post_thumbnail_id( bp_get_activity_secondary_item_id() ), 'medium' );
        ?>
        <img src="https://wordpress.stackexchange.com/<?php echo $theimg(0); ?>" >
 
    <?php }
 
}

What I’m simply trying to do is make the product featured images shown in the activity stream clickable (link to the product post).

What the hell does “Live Stream on Blockchain” even mean?

Since Twitch is actively killing their service, I’ve been looking for alternatives. (There are none.)

https://dlive.tv/

Its slogan is “Live stream of Blockchain”. What does that mean? They have zero information about what they are or anything on the actual website, leading me to assume that it’s yet another pure scam that just uses a random word often used in “the news” but has actually zero to do with it.

Even if we assume that they mean that they are somehow storing all the video streams on a big blockchain, that makes zero sense. I can’t for the life of me figure out how it makes any kind of sense.

CentOS, RIP…Long Live CentOS Stream?!?

The CentOS project recently announced that CentOS is radically changing.  Let’s talk about what’s new with this Linux distro.

What is CentOS?

CentOS – “Community Enterprise OS” – is a downstream version of Red Hat Enterprise Linux (RHEL). RHEL is Red Hat’s premium enterprise Linux operating system, which emphasizes production-grade stability. For many years, the CentOS project took the same sources and patches that made up RHEL and recompiled them into CentOS, which was freely available. Thus you could obtain the same binaries that were used for RHEL for free. This was completely legal under the licenses used by RHEL (predominantly the GNU Public License). Many users appreciated the ability to “get RHEL for free” and benefit from Red Hat’s development work in bringing a very stable, well-tested Linux OS to the market.

In January 2014, CentOS announced it was joining Red Hat. In July of 2019, IBM acquired Red Hat.

What’s changed?

Previously, CentOS was downstream of Red Hat. CentOS announced recently they are moving to a position upstream of Red Hat and will now serve as a development test bed for RHEL. It will now be called “CentOS Stream”.

Additionally, CentOS’s 5-year long-term support timeframe was cut to 2 years. This changes CentOS 8’s EOL to 2021.

What is the impact?

For many users, this dramatically changes the value proposition offered by CentOS. Prior to this change, CentOS was regarded as being as good as RHEL, since it was the same binaries (in fact, the only difference was the name and trademarked art). Even shops that paid for RHEL for their production nodes would often use CentOS for their development systems.

Now, CentOS will be a different animal than RHEL entirely. Just because something works on RHEL no longer means it will also work on CentOS.

The change of EOL was also highly significant. Part of the RHEL/CentOS value was that you could deploy it and receive security patches for up to 5 years without having to upgrade the OS. Patching for security is usually trivial while upgrading major releases is not.

As an example consider Dreamhost, which used Debian for years on their thousands of servers. They switched to Ubuntu solely so they would not have to upgrade as frequently.   Companies with high uptime requirements and many systems often prize long maintenance lifecycles.

Probably those suffering the most are users who just upgraded to CentOS 8, thinking they had years of support left. Easy for them to feel the rug has been yanked out from under them.

Ironically, CentOS 7 will be supported until 2024 – three years after CentOS 8 is no longer supported.

Why was this change made?

I guess it depends on your perspective.

If you’re RedHat, it “provides a platform for rapid innovation at the community level but with a stable enough base to understand production dynamics. These changes and feedback can more quickly be channeled into productization, resulting in Linux platforms that meet the needs of an incredibly varied user base.”

If you’re more cynical, you might surmise that IBM – which paid $34 billion for RedHat – sees CentOS as a threat to RHEL sales. By changing the product into something that is markedly different from RHEL, they force users to choose between using non-RHEL or paying for RHEL.

Wait, isn’t Fedora a testbed for RHEL? How is CentOS Stream different?

It does seem confusing. Most likely, Fedora is “bleeding edge,” CentOS Stream will be “closer to polished”, and RHEL will continue to be “well-tested” but time will tell.

I hate this change!

You can certainly sign a petition to try and change IBM’s mind. But it’s their software and they can do what they want with it.

Is there any hope for going back to the way things were?

Probably not with CentOS but if you mean “RHEL for free,” then yes. There are three options to consider:

Of course, there are other quality Linux distros, including Debian and Ubuntu.

 

 

raindog308

I’m Andrew, techno polymath and long-time LowEndTalk community Moderator. My technical interests include all things Unix, perl, python, shell scripting, and relational database systems. I enjoy writing technical articles here on LowEndBox to help people get more out of their VPSes.

How do I add audio to my stream with ffmpeg -i hw:0,2 does not work

Im trying to stream my desktop with audio to icecast but Im getting this error

(alsa @ 0x561796555320) ALSA buffer xrun.

here is my command

ffmpeg -video_size 1680x1050 -framerate 25 -f x11grab -i :0.0 -f alsa -sample_rate 48000 -channels 2 -i hw:0,2 -f webm -r 25 -s 1280x800 -cluster_size_limit 2M -cluster_time_limit 5100 -content_type video/webm -c:v libvpx -b:v 1M -crf 30 -g 125  -deadline good -threads 4 icecast://source:hackme@localhost:8000/live.webm

here is my list of audo devices, I dont know how to select right one, I wont audio from my rear audio where I have my 2.1 audio setup

arecord -L

default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=Intel
    HDA Intel, ALC883 Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, ALC883 Analog
    Front speakers
dmix:CARD=Intel,DEV=0
    HDA Intel, ALC883 Analog
    Direct sample mixing device
dmix:CARD=Intel,DEV=2
    HDA Intel, ALC883 Alt Analog
    Direct sample mixing device
dsnoop:CARD=Intel,DEV=0
    HDA Intel, ALC883 Analog
    Direct sample snooping device
dsnoop:CARD=Intel,DEV=2
    HDA Intel, ALC883 Alt Analog
    Direct sample snooping device
hw:CARD=Intel,DEV=0
    HDA Intel, ALC883 Analog
    Direct hardware device without any conversions
hw:CARD=Intel,DEV=2
    HDA Intel, ALC883 Alt Analog
    Direct hardware device without any conversions
plughw:CARD=Intel,DEV=0
    HDA Intel, ALC883 Analog
    Hardware device with all software conversions
plughw:CARD=Intel,DEV=2
    HDA Intel, ALC883 Alt Analog
    Hardware device with all software conversions

webcam – How to stream an image into camera source?

This is basically the same question as:

How to stream an image into camera source trough ADB?

I am trying to stream an image into the camera source of an Android device.

This should ideally effect on all apps that use the camera source.

Doesn’t have to be by using ADB.

(Sorry my technical understanding is very limited. I was going to comment instead but didn’t have enough reputation. Thanks!)