Can I be hacked just by watching a stream from a youtube channel that is being hacked?

A few days ago I joined a stream on a youtube channel that I later discovered was being hacked.
That got me thinking. Is it possible to have been infected with some type of virus just by accessing the stream (By this I mean that I didn’t click on links or add. I just opened the stream on the youtube page)?

apache 2.4 – PHP Warning: failed to open stream: HTTP request failed

I have two web servers:

www.example.com.ar and eventos.example.com.ar

I get the errors such as:

(Wed Sep 16 12:11:30.872792 2020) (php7:warn) (pid 17125) (client xx.yy.226.234:48896) PHP Warning: file_get_contents(https://eventos.example.com.ar/eventos/api/events?month=9&year=1999): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Requestrn in /var/www/www_example_com_ar/wp-content/plugins/example-plugin/mlc-plugin.php on line 340

The line 340th has:

$rest = file_get_contents('https://eventos.example.com.ar/eventos/api/events?month='.$month.'&year='.$year, true);

I’ve tested with curl on the same host that runs www.example.com.ar and I don’t get such an error:

curl -I "https://eventos.example.com.ar/eventos/api/events?month=9&year=1999"
HTTP/1.1 200 OK
Date: Wed, 16 Sep 2020 19:26:05 GMT
Server: Apache/2.4.39 () OpenSSL/1.0.2k-fips
X-DNS-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 37027
ETag: W/"90a3-gzipB01lW17JrEb0GD0k0g2zFow"

I have installed:

  • Apache: httpd-2.4.6-90.el7.centos.x86_64
  • PHP: php73-php-7.3.15-1.el7.remi.x86_64

By the way, I have:

php73 -i | grep allow_url_fopen
allow_url_fopen => On => On

On CentOS 7.7

So, the question is: what does it cause that error?

amazon web services – What is the most cost effective way to stream audio files in the cloud?

I’ll be launching an audio streaming app soon, the files are 10-30 min long mp3s (can potentially be other formats if that will be better). Some of the audios are short 30 second clips that will be played on a loop.

I’m using Firebase for the backend, I’d like to use a similar cloud solution that’s managed for me. What is the cheapest way to stream these audios? I don’t expect to be making much money from this app so it would suck to have to pay too much out of pocket for this..

Would something like a S3 bucket with a cdn in front like Cloudfront be the way to go or is there something something better/cheaper?

Thanks in advance!

google apps – How to shared a video in Full Screen on GoogleMeet stream, without showing my picture on the side

I am part of the Helpdesk of a big corporation, and we are having a big meeting tomorrow, and as part of it, we will share a video through Google Meet stream.

Soon I realized it is not that simple, since Google Meet shows me on the side as long as I am part of the meeting (and it is obviously impossible to share a video without being part of it).

Is there a way to share the video as fullscreen?

This is how viewers see it on the stream

g suite – How to share a video in Full Screen on GoogleMeet stream, without showing my picture on the side

I am part of the Helpdesk of a big corporation, and we are having a big meeting tomorrow, and as part of it, we will share a video trough GoogleMeet stream.

Soon I realized it is not that simple, since GoogleMeet shows me on the side as long as I am part of the meeting (and it is obviously impossible to share a video without being part of it).

Is there a way to share the video as fullscreen?

This is How viewers see it on the stream:

https://i.stack.imgur.com/Chsle.png

Bellator 246: Archuleta vs Mix Live $ how to watch Juan Archuleta vs. Patchy Mix Live Stream, start time

Bellator-MMA-246 | How to watch Juan Archuleta vs. Patchy Mix Live Stream,

Main Link – https://bit.ly/3iq8TA0 (for live stream)

Fight card:

  • Juan Archuleta vs. Patchy Mix, bantamweight championship
  • Jon Fitch vs. Neiman Gracie, welterweights
  • Deanna Bennett vs. Liz Carmouche, women’s flyweights
  • Derek Campos vs. Keoni Diggs, lightweights

c# – Creating a CSV stream from an object

Let’s do some performance tweaks.

I will measure the time simply with Stopwatch and first of all I’ll cleanup your code to generate proper CSV (without reduntant empty lines as initial).

List<string> headers = typeof(Lead).GetProperties().Select(x => x.Name).ToList();
string s = string.Join(",", headers) + Environment.NewLine;

foreach (Lead lead in leads)
{
    List<object> values = typeof(Lead).GetProperties().Select(prop => prop.GetValue(lead)).ToList();
    string ss = string.Join(",", values);
    s += $"{ss}{Environment.NewLine}";
}

Environment.NewLine returns rn on Windows and n on Linux.

Output will be

FirstName,MiddleName,LastName
Joe,M,DiFabio
Dave,,Palacios
Andy,A,Nevers

Looks like CSV 🙂

Then to measure performance I’ll imagine that you have very large amount of data e.g. 30000 lines. I’ll run the test in a loop of 10000 iterations.

TestOriginal

private static string TestOriginal(List<Lead> leads)
{
    List<string> headers = typeof(Lead).GetProperties().Select(x => x.Name).ToList();
    string s = string.Join(",", headers) + Environment.NewLine;

    for (int i = 0; i < 10000; i++)
        foreach (Lead lead in leads)
        {
            List<object> values = typeof(Lead).GetProperties().Select(prop => prop.GetValue(lead)).ToList();
            string ss = string.Join(",", values);
            s += $"{ss}{Environment.NewLine}";
        }
    return s;
}

Let’s run.

Stopwatch sw = new Stopwatch();
sw.Start();
string s = TestOriginal(leads);
sw.Stop();
Console.WriteLine("Original: {0}ms", sw.ElapsedMilliseconds);
Original: 3162ms

Ugh. 🙂

Almost everyone knows that Reflection is slow. Let’s somewhat optimize that.

ReflectionTweak

private static string ReflectionTweak(List<Lead> leads)
{
    PropertyInfo() properties = typeof(Lead).GetProperties();
    List<string> headers = properties.Select(x => x.Name).ToList();
    string s = string.Join(",", headers) + Environment.NewLine;

    for (int i = 0; i < 10000; i++)
        foreach (Lead lead in leads)
        {
            List<object> values = properties.Select(prop => prop.GetValue(lead)).ToList();
            string ss = string.Join(",", values);
            s += $"{ss}{Environment.NewLine}";
        }
    return s;
}

Go go go

sw.Restart();
string sr = ReflectionTweak(leads);
sw.Stop();
Console.WriteLine("Reflection tweak: {0}ms, match: {1}", sw.ElapsedMilliseconds, s == sr);

Output with matching the string to original one

Reflection tweak: 3040ms, match: True

Better but still slow

One more idea – StringBuilder. Afaik, it’s the fastest way to build a string (maybe except some unsafe/unmanaged code).

StringBuilderTweak

private static string StringBuilderTweak(List<Lead> leads)
{
    StringBuilder sb = new StringBuilder();
    PropertyInfo() properties = typeof(Lead).GetProperties();
    sb.AppendLine(string.Join(",", properties.Select(x => x.Name)));

    for (int i = 0; i < 10000; i++)
        foreach (Lead lead in leads)
        {
            sb.AppendLine(string.Join(",", properties.Select(prop => prop.GetValue(lead))));
        }
    return sb.ToString();
}

Interesting…

sw.Restart();
string sb = StringBuilderTweak(leads);
sw.Stop();
Console.WriteLine("StringBuilder tweak: {0}ms, match: {1}", sw.ElapsedMilliseconds, s == sb);

Output

StringBuilder tweak: 24ms, match: True

WOW!!!


Result

StringBuilder sb = new StringBuilder();
PropertyInfo() properties = typeof(Lead).GetProperties();
sb.AppendLine(string.Join(",", properties.Select(x => x.Name)));

foreach (Lead lead in leads)
{
    sb.AppendLine(string.Join(",", properties.Select(prop => prop.GetValue(lead))));
}
string s = sb.ToString();

The whole code to reproduce and play more

internal class Program
{
    public static void Main(string() args)
    {
        List<Lead> leads = new List<Lead>();
        Lead lead1 = new Lead();
        lead1.FirstName = "Joe";
        lead1.MiddleName = "M";
        lead1.LastName = "DiFabio";
        leads.Add(lead1);

        Lead lead2 = new Lead();
        lead2.FirstName = "Dave";
        lead2.MiddleName = "";
        lead2.LastName = "Palacios";
        leads.Add(lead2);

        Lead lead3 = new Lead();
        lead3.FirstName = "Andy";
        lead3.MiddleName = "A";
        lead3.LastName = "Nevers";
        leads.Add(lead3);

        Stopwatch sw = new Stopwatch();
        sw.Start();
        string s = TestOriginal(leads);
        sw.Stop();
        Console.WriteLine("Original: {0}ms", sw.ElapsedMilliseconds);
        sw.Restart();
        string sr = ReflectionTweak(leads);
        sw.Stop();
        Console.WriteLine("Reflection tweak: {0}ms, match: {1}", sw.ElapsedMilliseconds, s == sr);
        sw.Restart();
        string sb = StringBuilderTweak(leads);
        sw.Stop();
        Console.WriteLine("StringBuilder tweak: {0}ms, match: {1}", sw.ElapsedMilliseconds, s == sb);

        //MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(s));
        Console.ReadKey();
    }

    private static string TestOriginal(List<Lead> leads)
    {
        List<string> headers = typeof(Lead).GetProperties().Select(x => x.Name).ToList();
        string s = string.Join(",", headers) + Environment.NewLine;

        for (int i = 0; i < 10000; i++)
            foreach (Lead lead in leads)
            {
                List<object> values = typeof(Lead).GetProperties().Select(prop => prop.GetValue(lead)).ToList();
                string ss = string.Join(",", values);
                s += $"{ss}{Environment.NewLine}";
            }
        return s;
    }

    private static string ReflectionTweak(List<Lead> leads)
    {
        PropertyInfo() properties = typeof(Lead).GetProperties();
        List<string> headers = properties.Select(x => x.Name).ToList();
        string s = string.Join(",", headers) + Environment.NewLine;

        for (int i = 0; i < 10000; i++)
            foreach (Lead lead in leads)
            {
                List<object> values = properties.Select(prop => prop.GetValue(lead)).ToList();
                string ss = string.Join(",", values);
                s += $"{ss}{Environment.NewLine}";
            }
        return s;
    }

    private static string StringBuilderTweak(List<Lead> leads)
    {
        StringBuilder sb = new StringBuilder();
        PropertyInfo() properties = typeof(Lead).GetProperties();
        sb.AppendLine(string.Join(",", properties.Select(x => x.Name)));

        for (int i = 0; i < 10000; i++)
            foreach (Lead lead in leads)
            {
                sb.AppendLine(string.Join(",", properties.Select(prop => prop.GetValue(lead))));
            }
        return sb.ToString();
    }

    public class Lead
    {
        public string FirstName { get; set; }
        public string MiddleName { get; set; }
        public string LastName { get; set; }
    }
}

java – How to visualize a Stream object (and some other data types)?

I want to make a small programming tutorial which will have a number of images visualizing various data types, but I am not sure how to draw these images of the data types.

Assume that I have a FileOutputStream object that writes to the file 1.txt.

How can I think of this FileOutputStream object, do I think about it as a container of the stream of data (i.e. a pipe), for example:

enter image description here

Or do I think about it as the stream of data only, for example:

enter image description here

I think the term “stream of water” in real life only means the flowing water (without having a container that contains the flowing water).


My question also apply to other data types, for example do I think of a Stack of integers as the container of the stack of integers, for example:

enter image description here

Or do I think about it as the stack of integers only, for example:

enter image description here

I think the term “stack of books” in real life only means the stacked books (without having a container that contains the stacked books).


Same thing for the int data type, do I think of an int as the container of the integer, for example:

enter image description here

Or do I think about it as the integer only, for example:

enter image description here