Nothing happens until demand zones get confirmed and nothing happens to the upside until supply zones get confirmed as well. And if you look at today's setups versus yesterday's setups kind of going into today's session, it's night and day. Welcome to Access a Trader, the number one community for those who are committed to taking control of their trading in order to achieve success, profitability, and longevity. Thank you for joining us. Here's Dan Shapiro to help you find your edge, master your process, and own your future. And just like that, the world is good again. Guys, good evening, everybody. Welcome to another edition of the Access a Trader.com Nightly Wrap Up Show. Hope everybody is doing well. So let's kind of back up 24 hours. I had a very, very specific plan today. Again, big disconnect, a lot of beta names to the overall market strength, especially in the small cap space. We've kind of been noticing that for several weeks. And I wanted to give every opportunity for the market to kind of play itself out today. And even though the market didn't do, at least these stocks didn't do what I thought they were gonna do, at least it's showing there's definitely growth involved as far as being a trader. If this was 15, 20 years ago, I would have been shorting these stocks on anticipation of the move, trying to forecast that this was gonna happen. And 15, 20 years ago, I would have gotten absolutely killed. And this is why we always say every single day, again, have a plan, right? Have an opinion, have a bias, but that bias is only a setup until it confirms. And for a while there, take the first two, three hours, we started seeing really good small cap and mid cap action move to the upside, kind of what we talked about in the video. I believe going into this week, we were gonna see weakness and beta to start the week and strengthen everything else. And that's the way everything played out. But again, this is why we wait for things to confirm. I was watching all these stocks this morning and I wanted to give the sellers the benefit of the doubt. And if you traded the market this morning, you saw Apple, right? Apple got very, very weak and never got below Friday's range. Amazon got very, very weak, went red several times, right? Never got below Friday's range. Square actually got hit at some point, right? But you could see these really, really big areas of weakness all over again. And I said, well, if they're not gonna go today, they're definitely, right? They're definitely gonna go to tomorrow. Same thing with Microsoft. Microsoft got to the bottom of Friday's range and never confirmed. And it really does show you how strong this market is. It's the most amazing part. And again, it really does show you how really patient you have to be and kind of let your process work out and let your plan work out.  And again, you gotta give the bulls phenomenal kudos. They could have easily, easily gave up this bottom range here and went down to this 305 level that we talked about. But again, they didn't. And that is why this is the most hated bull market probably ever. Because again, they're always trying to reach for things. They're trying to talk about an auguration, the COVID, everything, everything, including the kitchen sink to make the sell-off finally a reality. Unfortunately though, before a sell-off starts in place into fruition, demand zones need to be confirmed. We talked about that over the weekend. Nothing happens until demand zones get confirmed and nothing happens to the upside until supply zones get confirmed as well. And if you look at today's setups versus yesterday's setups, how to going into today's session, it's night and day. You could have made a huge argument around 10, 11 o'clock in the morning that we were a day away, you know, didn't come today, but we were a day away from really big technical breakdowns. And I said, you know what? Let me take some cash flow today on the upside on a couple of things that look pretty decent and let's leave everything alone. We're only a day away because God knows what's gonna happen with Netflix. And again, Netflix came, Netflix went, huge move after hours of 13% subscriber growth. I believe they talked about a possible buyback. Does this finally kind of pull up beta? You know, I don't know, but I tell you, we definitely went from the outhouse, not saying necessarily to the penthouse, but the market did, the queues did reclaim the five, 10 day moving average again, which is incredibly bullish. And if you go through kind of the queues thing, members of the queues, names like Google, right? Google looks really good, right? Maybe one more day to confirm. I know there's gonna be a big earnings for next week on a lot of these names, but Netflix kicked off earning season. Maybe Google, if it confirms today's prices, look at ZM, right? Maybe ZM reclaims the 50 day moving average. Maybe a stock like FSLY, okay? Took out Fridays this whole section from last week's supply, the highest close. Maybe it continues into the hundreds. So there's definitely a lot of possibilities going into tomorrow's session. Even if you look at, for example, the smaller names that have nothing to do with beta, some good looking charts for tomorrow. You have INSG, maybe a day away. You have XPEV that had a really, really big move, right? A Chinese EV name got rejected three times in the same area. And again, who knows? Maybe this thing reclaims and explodes tomorrow. You have names like Cyber, right? You have Cyber Security, you all eyes gonna be on the inauguration tomorrow. Who knows what's gonna happen, right? This stock looks like maybe a day away. So slowly but surely one day can make such a big difference in sentiment, but more important, one day can make such a big difference in the way that you are structuring your game plan for tomorrow. Now again, we still know the levels for the downside. The key is they never got there. More important is we didn't anticipate like we talked about before. And now we're looking on the bullish side. And this is exactly what we talk about on every single video. Don't be tied into a corner. Don't be tied into an opinion. The markets flow it. The market moves around. You have so many different variables for the market to go from up to down to down to up and vice versa. And this is a type of situation can earnings be a catalyst to the next leg up? We're hoping so, right? You know, baited game has been dead for such a long periods of time, but slowly but surely, and this is again, only one day, but slowly but surely they're starting to wake up. Doc, you again got rejected at supply, but maybe it starts reclaiming the levels here. TDOC, another member of the stay at home group. Again, maybe not for tomorrow, but at least you're getting some semblance of hope from these things to kind of wake up and start taking out this whole orange juice. Banks, right? We're very, very strong. Goldman had a big, big run. They reported earnings. They got sold. JP Morgan, again, the banks were been on fire. And there's rotation out of money flow, out of financials into technology. I think all of us will definitely sign up for it. The key right now is to sustain some sort of, some sort of traction in these names. Now again, Zoom, Google, Dock U, TDOC, they're on the cusp, they're not there yet. But the key is for Netflix to hold up, right? Netflix after hours is absolutely exploding as you see here, 561. Is it gonna start taking out the October 14th highs? Maybe, I mean, that's probably not where the value is. Maybe on dips into rising 60 minutes of support. But the key is now for all the dead money to finally wake up. Apple, again, holding the bottom range here, doesn't really scream like it's going higher. But again, baby steps, right? You have to believe in something. Microsoft held the bottom of the range. We talked about this on the weekend video. Held this to 12 level five times. Guess what? It held it again today. Baby steps. Maybe it starts reclaiming this 10 day moving average. So, you know, going into tomorrow's session, beta is still not out of the woods again. There's some names I really do like. But I think there are going to be a bunch of names that are non-bater that look pretty, pretty good. This WWR had a pretty big run. Maybe it gets a day to any wash out on the 60 minute channel. Maybe red to green above today's highs as well. Bunch of SPACs woke up today. Cure's of the world. Maybe it starts reclaiming today's highs. The Savas of the world, right? Had a big, big run three, four days ago reclaimed. And maybe again, if it starts reclaiming about this $14 level, maybe it'll go higher as well. So remember, folks, and this is especially for the new traders. I'm wrong every day. Remember that, whether it's on a premise, you're going to be wrong. If you're going to be thin skinned and you're there strictly to be right and look for the shares and the likes and the favorites and the retweets, you're in the wrong business, okay? You're going to be wrong a lot. The key is don't be wrong financially.  I'm going to let this all play out. No, you're going to go bankrupt. The key is have an opinion, yes. Have a bias, yes. But if that bias quickly changes and price action tells you we're going to go the opposite way and levels start reclaiming, you have to be an adult about it and go right with it. So guys, have a great night everybody. Oh wait, I'm sorry about that. Didn't share the pivots. We didn't talk about the pivots yet, I apologize. So if you look at today's pivots, I apologize, I was way ahead of myself. If you look at today's pivots, it kind of played out we talked about over the weekend. You had stocks that were not beta, the BCRXs of the world, the ACORs of the world, the Esgens of the world. They did it very, very well today. The names like NVIDIA that we were watching, NTS, Amazon, so forth and so on, they held their channels. So again, bullish sentiment going into tomorrow. So let's talk about some of the pivots for today. BCRX was my first trade of the day, $9 got rejected twice, needs to build. They get not a big move at all. Really not a big move, but what's considered a big move these days on a $7, $8, $9 stock? You take away 20, 21 price action. It's a 30, 30, 20, 30, 40 cent move big on a $9 stock. I don't know, right? But again, it's a pretty decent scalp. It traded up to the 935 area. A little disappointed that it didn't go more, but this was definitely the highest close in this whole formation. NVIDIA obviously traded right to that 513 level and bounced, perfect hold of the range again. Laser, not a big move, 30 held three times of builds below can flush, right? Here's laser. It took out that $30 traded down to like 2950. Again, this is the lowest close in this whole formation. Maybe it still goes lower. So we have to actually keep an eye on that for tomorrow. ACOR was huge. We kind of covered this a little bit on the video. ACOR 720, 730 needs to build. And this is another case of non-beta speculation money rolling in. It took out the 720, 730 and it went to 840. Huge, huge move on ACOR. Seattle Genomics 186, 75, 187 needs to build. Here was Seattle Genomics, right? It traded all the way up to the almost 191 area. And TS never got down to the 103 area. And this was kind of my, and these were kind of my notes for all you guys in the Twitter feed. Stay patient. I really don't like anything here at the open. We're waiting for these channels. Most likely I'm gonna start my day at 10 o'clock. Ironically, I started my day below 10 o'clock, before 10 o'clock on BCRX, but that was kind of the thing. I wanted to give sell buys every opportunity to work and they just couldn't confirm Friday's levels. Apple held 126, 20, 126, it held that range again. Peloton got killed. Congratulations for all you guys who did catch Peloton. They got rejected today. 153, 50, 153 for builds below can flush more. 150's potential. And here was Peloton. You can see here, it held here. You see this three, four times in a row. One, two, three, four, five times, right? Five times it held 153, 50 at the open just got absolutely murdered. Went all the way down to 144. If you did catch that, great job there. BCRX take on the way up. Peloton got smashed. TTO, I still like, never got there. A nice spike on ACOR. XPV, I still like a lot. Laser and new lows. So that was basically it. Also, we caught a nice little trade here.  I'm actually still holding a little bit as I'm recording here. Here are the place here, 220's potential high. Went into the 230's. I'm still holding some. Hopefully the stock can rip up to the days high here. So that's it. That's it, everybody. So I think tomorrow is gonna be a very important day. Obviously the 46th president of the United States is being sworn in. The key is hopefully the event will go nice and smooth. There's going to be a lot of military presence. There's going to be a lot of people with guns. So if you are watching this broadcast and you're thinking about going to Washington tomorrow, think again. Guys, stay safe, God bless. I love you all and I'll talk to you all tomorrow.


A meeting between the leadership of the National Association of Resident Doctors and the federal government ended at a deadlock yesterday. This means the strike by the association continues and the doctors are still staying off work. Both parties are returning to the negotiation table today and there is even another meeting between them and the House of Representatives Committee on Health. The doctors are protesting over agreements on welfare which the government has breached. Hello, hope you enjoyed the news. Please do subscribe to our YouTube channel and don't forget to hit the notification button so you get notified about fresh news updates.


Welcome to today's PostgreSQL World Webinar, Aggregates in PGX and Adventure. We're joined by James Blackwood Sewell, Senior Developer Advocate at Timescale TV, who will discuss why PostgreSQL's functionality to create custom aggregates, why creating and maintaining a performant aggregate function in C can be a high barrier for many would-be contributors, and how PGX can help with creating, testing, and deploying aggregates using Rust. My name's Lindsay. I'm one of the PostgreSQL Conference organizers, and I'll be a moderator for your webinar, a little bit about your speaker. So as I said, James is currently a Senior Developer Advocate at Timescale DB based in Sydney. Before that, he meandered through the PostgreSQL, Kubernetes, and Prometheus landscapes as the chief architect at GiroTech. Welcome, James. And with that, I'm going to hand it off. Take it away, James. Thank you. Yeah, so as Lindsay said, this is called Aggregates in PGX, and it's loosely structured as a bit of an adventure, which we'll talk about a bit later. My name's James Blackwood Sewell. I'm the Principal Developer Advocate for Timescale. I live in Sydney in Australia, although at the moment, you might notice there's quite a bit of light in the background. I'm a Frenchy in France and on T. I love to talk about Postgres and Rust and Kubernetes and lots of other things, like observability and open telemetry. I work at Timescale. I've actually been there for maybe three and a half months, so it's not long at all. And being a developer advocate is quite a new thing for me. As Lindsay said, I used to be the chief architect of a company. So I'm kind of learning as I go over the past few months. And you can find me on Twitter as James Sewell. You can find me on the Timescale DB Slack, the Community Slack energy in the Timescale DB Forum. And you can find me on LinkedIn as James Blackwood Sewell. So jumping straight into it, what is PGX? So PGX is a relatively new framework that lets developers extend Postgres. So you would use PGX when you would normally be extending Postgres by using C. PGX would let you do that using the Rust language instead of the C language. So if you want to write a Postgres extension, we want to write a new Postgres aggregate. We want to write a Postgres background worker. You could do that in PGX using Rust. I suppose the million dollar question is, why would you do that? C already exists. And that's because PGX makes things safe. It makes things fast and it makes things easy. So what PGX actually does is exposes the C API via a safe Rust code. So it removes many of the opportunities you'd have for crashing or breaking your database. And that's quite an important thing when we're talking about interfacing with Postgres via C because there are many chances to crash or break your database. You could do that via calling functions in the wrong way if you were doing things correctly. If you're doing things incorrectly, you could do that via managing your memory incorrectly. It could cause a seg file. That kind of stuff can be destructive for your database. You can bring it down. PGX is also fast. So because it's compiled Rust code, it runs really close to the speed of C and many, many times faster than code in like a PL language, like PL or PG SQL or PL Python or PL Java or anything like that. I say close to the speed of C code, which we'll look at later. Obviously because Rust is providing some extra safety guarantees, there's a little bit of over here, but it's a very small amount. And I think a pretty good trade-off in this case. And PGX is also easy. So it helps out with the development process. So it can auto create SQL objects. It can help you run your code, to test your code, to package your code. It can actually even help you get started with some template kind of options. And that's not something, as far as I'm aware, that really exists in the Postgres C where different developers who code for Postgres and C have their own ways of doing things, which is great once you know what you're doing. But for people that don't know what they're doing, PGX is a great way to get into being able to write low-level code for Postgres in a safe, fast and easy manner. So why Rust or I suppose, what is Rust without knowing about it? It's a modern general purpose compiled programming language. People used to say it was a systems programming language, but in reality, it's just a general purpose language that can be used effectively for systems because it's compiled. It's blazingly fast. So it's memory efficient. It doesn't have any runtime or garbage collector. You can run critical services in it and you can write it on embedded devices and you can easily integrate with other languages, one of which is C through FFI. It's got a rich type system. So it's strongly typed. It's got an ownership model guarantee. Guarantees memory safety and thread safety are probably a bit more interesting. The memory safety for Postgres and it basically enables you to eliminate many classes of bugs at compile time. So you compile your code. The Rust compiler comes along. It looks at your code. It works out if your code is safe. So it works out if you're writing code which is unlikely to cause any problems or isn't gonna cause any problems and then it will compile it. So if you were to do something like try and use an object after you've dropped it, then Rust won't be able to compile that code. It's got really great documentation, a really great compiler with really easy, friendly user error messages. So when you compile and it comes back, we'll actually tell you what to do, direct you some documentation and it's got really great tooling. The number one thing that it's got is a package manager called Cargo, which I mean, I'm not a professional developer but Cargo is the best package manager for any language that I've encountered. And it's got all the usual things like multi-edit to support, auto completion, type inspection, auto format, all that kind of stuff you'd expect from a modern language. A lot of which C has of course as well. Why do I personally use Rust? So I use Rust to program because I think it makes me a better programmer. So, well, first of all, I come, I suppose, from an architecture background and I suppose before that I came from a DBA background. So I wouldn't at least in a room full of developers or programmers call myself a programmer. I definitely write lots of code. I've got a lot of background in writing shell scripts. I then moved on to Python and wrote a lot of Python code, some of which runs in production today still. But I probably wouldn't describe myself as a professional developer.  It's made me think about the way I write my programs in a much more critical manner. As an example, perhaps in Python, I might not have been catching all of the errors which could have happened in Rust, Rust will come up and say, you're not catching this error, you need to do something with it. And I find it fits my mind and see it really well. I suppose as someone who hasn't had years and years of working with C, it makes it possible for me to easily switch into a domain where the rigorous memory management is needed. So I know lots of people who work with Postgres are completely comfortable managing their own memory with C. I am not one of those people, so that's why I use Rust and VGX. So basically it allows me to be confident that I'm doing the right thing while removing as much of the mental load of having to do it as possible. So what do we mean we say safe?  The main ones are we're translating Rust panics into Postgres errors. So if something goes wrong in Rust, something panics, we're going to abort the Postgres transaction, but we're not going to terminate the process. We're going to maintain Rust's dropped semantics maybe we can even in the face of panic and error. So if we've got an object or a variable in Rust, when it gets dropped, Rust is going to do the things it's meant to do, even if there's been a panic in Rust or there's been an error in Postgres. And when code is called from Rust, which isn't safe, so you can actually call all of this the API from Rust if you want to directly. But you'd need to do it with an unsafe block. So you need to specifically put a block around it that said, hey, this code's unsafe, I know what I'm doing, and then you can run it. So I suppose the inverse of that is there's a lot of code that has been wrapped where the API has been wrapped. You can run it without that and we can guarantee that code's going to be safe as you run it. So basically, if you do it wrong, it won't compile. So where did PGX come from? There's a person and a product called ZomboDB. So ZomboDB is an extension for Postgres, which is very good, which enables you to use Elasticsearch as an index from within Postgres. It was written by a guy called Eric, who goes by the name of ZomboDB online. He wrote that in C, and it was great. It was really performant as far as I understand, but he decided that he basically didn't want to, didn't want to maintain C anymore, didn't really want to write C anymore, wanted to try going in a new direction. So he started using Rust. It was actually a sort of project that came before this one called PGX 10.js. So here now we're in that community at the same time. And then he decided he wanted to rewrite ZomboDB using Rust code. And he created it because he didn't, actually he decided that he was doing that so quickly that he wanted to create his own new framework to do it. So he created this thing called PGX in 2019. And things took off from there. He's now got ZomboDB completely implemented in Rust. PGX is really stable at this stage. It wraps a large amount of the Postgres API. I mean, obviously not everything, but it's getting there. And in fact, since then, PGX has now become owned by TCDI, which is a company that's a new custodian. So Eric now works for TCDI as part of that move. He's working on some stuff for them, but he's also bought PGX under their ownership. The product's staying open source. So from my perspective as someone who doesn't work at TCDI, but is a contributor to PGX, the main difference is now an All-Star team who have been paid to work on PGX, whereas before it was just Eric and one of the other people. So I think the move's been a really positive thing. And at timescale and obligatory link back to my employer, we use Rust and PGX in a couple of places. So we have a thing called hyperfunctions, which are functions that we make that wrap up I suppose time series functionality that you might want to use like statistical analysis or something like that. They're written in Rust with PGX and also the prom scale database extension, prom scale is one of our observability products and the prom scale database extension is written using PGX as well. Personally, I contributed the background worker code to PGX and the shared memory code to PGX. So what can PGX do? What can it help you with? I suppose it's apart from being safe, fast and easy, what are you gonna get from using it? So you can develop functions in Rust, including stuff like aggregates and triggers. You can map between Postgres and Rust types, including storing Rust types in the database. You can access the database through SPI, which is a server programming interface, which is I suppose the main way that C functions access the database. You can create new Postgres config options, which are called gux, you work with Postgres. So you can create new ones for extension. You can work with Postgres memory context or actually a lot of the time, PGX will work with memory context for you, so you don't have to worry about Postgres concept of memory context. So Postgres uses something called a memory context to store variables in different amounts of memory that are cleared at different times. So one particular variable might be free to transaction end. You don't really have to deal with that stuff when you're using PGX. You can create background workers, which run and then run code. You can create executor, planar hooks and transactions of transaction callbacks. So you can implement something like PGStat statements if you wanted to, or re-implement PGStat statements. You can read and write Postgres shared memory. You can read and write some types of objects into Postgres shared memory. And most of all, you can remove some of the mental load which comes for writing C code, which is going to be run in Postgres. And I asked Eric for a quote when I first did this presentation and he said, our goal is basically to make Postgres and Rust easy and fun. So on top of that, PGX can help you develop too. So you can quickly create new extension templates with cargo PGX new. You can create the SQL files needed to install your extension. So the days of manually coding up SQL files to install an extension are gone. It does that for you.  You can install, configure, compile and initialize all the versions of Postgres that you need for your particular project. So I think it's like the last five versions, five major versions with cargo PGX in it. It'll install those into your home directory, compile them, configure them, get them ready for you to inject your extension code in so you can do testing. You can run your extension inside one of those Postgres versions and interactively test it with cargo PGX run, which will drop you into a PSQL prompt. And you can unit and test your extension across multiple Postgres versions with cargo PGX test. Then right at the end, if you want to deploy it, you can create installation packages for your extension with cargo PGX package. So it's really helping you from creating an extension right through to pushing it out to production. So if we just look at a really basic example, we're actually gonna, the second half of this talk is the adventure part. So we're gonna be doing some live coding. But if we just look at a really basic example, so we're implementing a max, I know this is just implementing a sort of hello world. So basically from line five to line eight is the payload. So that's creating a new function, which is gonna return a hello tester. And then when I create this extension in Postgres, I'm gonna be up to run select hello tester, open bracket, close bracket and that functional run. And then that's some test framework stuff down the bottom, which we'll look at a bit later. We wanted to implement the max aggregate. It's a bit more complicated, but still pretty easy and definitely a lot easier than it would be if we're writing in C. We'll definitely look at that a bit more later because that's what we're gonna be talking about, aggregates and PGX. And if you want to implement a background worker, which is a Postgres process that runs in the background and is able to do things like connect to the database by SPI and when you're using Rust, you can actually do anything that you want to do. We've gotten this much code. So it's still sort of like 30 lines of code, not much and it's fairly easy to see what it's doing. So I talked about an adventure before. I suppose let's start the adventure part. So as I said, I've been at timescale for, I keep on wanting to say three months, but maybe it's been a bit longer between three and four somewhere. So first thing, the first few things I did in my days at timescale was one, meet the team, virtually of course, and marvel at how everyone's really nice and actually we're hiring at the moment if you're looking for employment. Number two was get up to speed on the products and tools that we use and start thinking about some content ideas. And number three was browse the timescale, get repo to have a closer look at the code bases and find issues people have been reporting, which is always a pretty solid idea when you join a company. And one of the things that I saw sort of first off the bat was this person who I have no idea who this person is, Max her tramp. I'm actually not sure if they're a he or a she, but it's a person that created an issue in the timescale get hub repo. And if we actually open it up. So they're saying they want to add min time and max time aggregate functions. They say, dear, dear, first of all, thank you for your work on timescale for VB. In our application, we can calculate a minimum maximum value. We also want to know what, which time it happened is the first occurrence or the last occurrence of the extreme value. So basically they're saying that they want to have an aggregate where I can run the aggregate and it'll do, let's say a max, but it won't hand me back just the maximum temperature. It'll hand me back at the time at which that first, that maximum temperature first occurred. So they've actually got some SQL code to create a test for this. Oh, we've got some SQL code here that's implemented. What they've actually done is they've implemented a custom aggregate function in PLPGSQL here. And if we go down the bottom, it says, but it turns out the custom aggregate functions way slower than the solution above. I read that writing it in C would greatly improve performance. So I thought that maybe timescale DB users need this kind of calculation and maybe the timescale devs could help. Personally, they're not sure if they want to take the effort and risk of writing it in C, but you guys are surely more proficient. So I suppose the point of this talk is to show that with PGX and Rust, you don't actually need to be super proficient to write this kind of aggregate and it's actually fairly straightforward. So hang on a second, there's someone asking for help in our public GitHub. The problem that they're asking about is not being able to be solved with PGX and Rust. It's got the potential to be the topic for a talk and also the potential to allow me to make my first talk or one of my first talks a live coding disaster. So I thought, let's go for it. So now we're just gonna go through the steps of what this person would need to do or what we would need to do to implement the aggregate. So we're gonna call it max timed and just to make sure on the same page, if I run max timed on some data, it's gonna return the maximum value from the data but also the time stamp of that maximum value. If we actually have a look at the code that they've provided, they're creating a type here. So it's gonna be returning a custom type, instant value, which is an instant and a value. So the time and the maximum value. PGX can't actually use custom types at the moment. So for our test case, we're gonna be returning JSON B with those two values in the JSON B. So first of all, we're gonna set up PGX. So we're gonna have a terminal and we're gonna run through this but we're gonna install cargo PGX. If you wanna install Rust first, which you'd obviously need to do to get PGX working, I've got command down there but I'm not gonna run that as it would take quite a while to compile and install Rust. Once you've got Rust installed, this will give you the cargo package manager and you can run cargo install PGX. Then you can initialize all your Postgrease instances with cargo PGX, isn't it? And then we can go on to creating a new project. So actually, before we dive into a console, I might just ask if there's any questions here. Yes, there are, is. We have one question so far and it is, are PGX and PGXS, which has been part of PostgreaseQL for a long time related. No, they're not. And in fact, one thing I actually got to say at the start is there's actually another framework for PGX as well to further confuse matters, which is the Go one, which is like a connection kind of allowed you to connect to Postgrease, but no, there's no relationship between the Rust PGX, the Go PGX or PGXS. Okay, so then I have a question. How did they all get named? Like how did that happen given that it is so confusing? That's a good point. I can't answer that question because I'm not the one that named them, but I believe Eric just really liked the name PGX and went for it. It is a little bit confusing at times, but they are quite different use cases being that one is written in Go and is about a client side connection and one's on the server side and in Rust. But yes, it's always a bit upsetting when things have multiple names for different things. Sure is. That's all the questions we have for now. This is a great reminder for attendees to get your questions in as they come to you and James back to you. Cool. So if we open up the terminal. So this is just a terminal. I've installed Rust already. Rust gives me the cargo package manager and then I'm just going to run cargo install cargo PGX. So cargo PGX is actually a plug-in for the cargo package manager. So I'm going to run that. It's going to have a think about it. It's going to see it's already installed in this case and say you don't need to install it. Then I'm going to run cargo PGX in it. So doing that previous command gave me this PGX sub-command of cargo. I'm going to run that and you can see what it's going to do is it's going to download Postgres from five different versions. So 10, 11, 12, 13 and 14. The newest dot revision of each of those. It's going to download that code. It's going to unpack that code. It's going to configure that code and compile that code, then install it as a vision that I can run into my dot PGX home directory. While that's happening, because obviously that's not going to happen in the blink of an eye, if we switch over to our other tab, what we can do here is explore some of the other functionality we've got. So we can do cargo PGX new and then give it a name so we can say hello world. It will create a hello world directory for us. Inside here in the source directory, we will have a hello world function. So this is exactly the same as we saw before, but it's just showing that you can create a template if you want to. Unfortunately, what you can't do is create a template of an aggregate. I've actually got a PR open to get that going at the moment, but it needs a bit more work before we can put it into production. But in the future, I'm hoping if the PR gets accepted that you'll be able to do something like cargo PGX new dash dash template aggregate, hello world aggregate and it'll create an aggregate example and you can just jump in there and make minimal changes rather than having to write the whole thing from scratch. At the moment, you can do cargo PGX new dash B for background worker and it'll make a background worker, but at the moment it's background worker or bare function. So if we flick across into an editor, we can have a look at now is this weather.sql file. So this is just showing some of the sample code that we've got to do some testing once we get our aggregate up and going. So basically we're just making a weather data table. It has an instant a temperature in a city. We're creating an instant value, which we're going to be using for the demo type that the GitHub user created. And then we've got the implementation or the aggregate implication that the GitHub user created which we're going to benchmark against. And then we're copying a whole bunch of data into the weather data table. So this is a whole bunch of cities. I want to say in America, but I'm not a hundred percent sure about that.  Oh, for a particular hour, it turns out. And then if we go into this max time directory, which is what I created earlier, we have our aggregate code which we'll go through. So at the top, we're always going to have to use PGX. So that's Rust's way of just saying we want to use the PGX library. We've got online three PG module magic, which is just a macro that sets up the Postgres environment and enables it to talk to Postgres. Then we're defining our state for aggregate. So we've got a struct and we've got a max and a timestamp inside there. In Rust, this option then just means that it can either be an i32, so an integer 32 value or it could be nothing. So value none, and we're doing the same for timestamp. So those values could either be none or they could be an i32 with timestamp. And then we're going to define our actual aggregate. So we've got this PG aggregate attached to this implementation. So we're basically saying this is an aggregate, PG aggregate, we're implementing the aggregate code and we're going to be saying we want our aggregate to be called max time to PGX. The state of the aggregate, so that's the state that the aggregate passing round is using the Postgres internal model. And the arguments for the aggregate are a timestamp named timestamp and an i32 or integer 32 value called max. And then finally, we've got a finalized value which is saying when we finish trying the aggregate, we're going to pass out JSON B. And if you remember the reason for that is because we can't make it composite type with PGX at the moment. There's actually a bunch of work to make that possible at the moment. So I think if you check back later on this year, maybe even in a month or two, then that should be implemented. And then we've got our state function. So this is the function that gets called every time our aggregate runs. So for people who aren't super familiar with aggregates, you create an aggregate and it's got a state function. You give it a bunch of rows and then it runs the state function for each row to do some sort of comparison to work out what's going to happen. So in our case, this is our payload for the aggregate here. If the maximum value that's coming in from our argument is greater than the one which is in our internal state, then set the maximum value to max and then set the timestamp to timestamp. Obviously the second time it finds that value is not going to be greater, it's going to be equal. So it's not going to set the timestamp again. And then we've got a finalized function which is just taking our internal state and pushing it out to JSONV. Once we get composite types going, you won't actually need that function at all. But then what we can do is jump back into our terminal. Actually, are there any questions before I move on to actually running the code? Yeah, so two questions, two and a half questions, shall we say, have come in. The first is, can this patch into existing Postgres installs? So I think that question is saying, can I install PGX managed extensions into existing Postgres installs? So we're not really hatching, I suppose. It's not like we're changing the Postgres code. We're using the Postgres extension mechanism. We're extending Postgres by putting .iso files into it. And the answer is yes. So we've actually got, I'm not talking about it in this talk, so I don't use it very often, but we have install. So you can actually install it into a Postgres that is defined by the PG config in your path. And that will install it into that version of Postgres rather than installing it into the .pgx Postgreses. Whether or not you should be compiling code and injecting it into a running Postgres process probably depends on this as a development machine or a production machine, but definitely the ability's there. Great. And then someone else followed up that question where, if so, what is the earliest Postgres QL version? All right, okay. So if we jump back over to the other terminal, actually the earliest Postgres version at the moment is 10.21. So we don't go early over that. So we're just supporting the current major version and fire four below that for a total of five versions. So yes, you can't get PGX to push into 9.6 or something like that at the moment. To do that, we would actually be non-trivial because you'd have to go and pull in all the 9.6 header files, it's definitely possible, but it'll be a bunch of work in the PGX side. Awesome. And then a little bit of a broader question came in. Every experience with a different programming language has a cost. How long do it take you or others to learn Rust at various levels of proficiency? It's a really good question. And I suppose that is kind of the hidden iceberg of my talk, which I normally mentioned at the end. So obviously what we're doing here is we're trading, well, so I would say the target audience for PGX is people who are familiar with Postgres have at a time in their career, I wanted to extend Postgres, but haven't been able to do it because they can't code and see. And obviously you have two options, used to have one, but now you have two. So you can either learn how to code and see and then implement the code yourself. If you do that, then that's great. That's really noble of you. It's probably pushing the Postgres project forward more than otherwise might be because you can then go on commit to Postgres and you can contribute code to Postgres or you can use PGX to do it. Personally, because of the way that I know I write code, I find it very comforting knowing that the PGX is removing many classes of areas which can cause critical problems at compile time. So I like PGX for that reason, but obviously I had to learn Rust to get that. So that's a very good question. Rust isn't the easiest language to learn, although I would say probably Rust isn't the easiest language to learn if you're coming from something else similar to Rust. So I've seen people pick it up very quickly. I've seen some people who are in a season program and struggle with it for a long time. My hope would be that to write a Postgres extension with PGX, you need to know Rust, but you don't have to be an expert in Rust. Obviously, that becomes less true, the more complex your extension is though. So yes, that's actually a really good question and you do obviously have to learn this new language if you don't know Rust to use PGX. Awesome, thank you. That's all the questions we have for the moment. Cool, okay, let me jump back into this other tip. So we can now do Cargo PGX Run. So what that's going to do is that it's going to say to PGX, oops, right, you're in the wrong directory. So we're going to go back. So we're going to go into the MaxTime directory, which is the one that includes the source code that we looked at before. So if we look at this as the code we were looking at, just before, Cargo PGX Run, and it's going to compile that code.  So you can see there it's discovered three SQL entities. So two functions and one aggregate. It will make the SQL code that we need to create that extension. It'll inject all of that into a PostgreSQL instance. So in this case, it's using PostgreSQL 13 because that's the default. And it'll create a database. In this case, it's using an existing one. And it will dump us into the PSQL. And then we can do, I'm going to show that it doesn't exist. So we don't have any extensions. I've got a max one, which is installed just some of the benchmarking later on. And if we do a D, we've got nothing here. We look at the functions. We've got the ones that came from max. We create extension, max timed. And then we've got this max timed underscore PGX aggregate. Then what I'm actually going to do is I'm going to load the weather data that we talked about earlier by loading that weather.sql file. Now we've got this public weather data table. Select. We'll get back the max value and the timestamp, which happened in this case as J-Sombie. Any questions there? Nope. Just one observation. That 144 pages of C code extending PostgreSQL compiles in less than three seconds. Yeah. So that's that. I think that's comparing the compilation time of C to rust. Is that correct? If so, then yeah. I mean, C does compile a lot faster than rust. If I was to compile all of this stuff from scratch, it would have been a lot slower. But when I say a lot slower, I'm talking like 30 seconds, which isn't that slow on a new Mac, but it's enough time that I'm going to be sitting here twiddling my thumbs looking at you while it's happening, which is why I didn't show it. Okay. So now we've got this max timed PGX aggregate installed. What else can we do? So we can actually run cargo PGX schema. So that's actually going to show us the schema that it's going to create. So this is what's getting injected into our Postgres instance. So it's showing the functions that it's creating. It's showing the aggregate that it's creating.   But you don't have to do that with PGX. It just does it for you, which is really great. And another thing that we can do, which is pretty neat is we can do cargo PGX test. This is taking a bit longer because it's having to recompile something for some reason, maybe invalidate something. So probably get a more accurate representation of how long it's going to take here. So as I said, it's enough time. They have to sit here watching it, but it's not really that much time almost there. So what this is actually going to do is we'll jump in and have a look at the code in a second when it's run. That's actually going to fail this first time, which we're going to have a talk about. So it's actually running some tests against our code and then telling us what the outcome was. We're going to test our tests have failed. If we jump back into Visual Studio and we go right down the bottom, we'll see we've got these tests down here. So inside our tests, we're creating a table called test table, which is similar to the test data we've got. We're studying some values and then we're running our function and saying what we think we should get back. So we're testing our aggregate from within our code and then we get the ability to run that. So this fits in really well into deployment pipelines, that kind of stuff. I suppose the first question that anyone's going to ask is, why on earth is that failing? And the reason it's failing is because it's actually in the Australian time zone, so it's not comparing the times again correctly because all JSON time zones, time stamps are in UTC. And the point of that is just the show that you can do neat things like have configuration options that will be used for your test harness. Then we can jump back here. We can run KajaPGX test again, take a bit longer and then it will come back and say hopefully that it's been successful. Cool. And then other things which we can do. I'm just telling you how much time I've got left, about 20 minutes. So one of the things you might be wondering is how fast does this stuff run over here? Okay, this is something I didn't show before. So this is just the finishing of compiling everything up. We will run PG bench, which I really thought I had a command for it somewhere. It seems I don't. I wouldn't actually run PG bench because it's going to take me a while to work out the command again. But I've got some stuff here. So this is just what we've done. We've run the project. We've tested the project. We're going to talk about packaging it in a second. But we've got some benchmarking. So if I run the PostgreSQL C function over a thousand times with PG bench, that table 21k records, then it runs in about 10 milliseconds. PGX, if I just implement the max function that we saw before, so not max time, just the max, that runs in about 11 milliseconds. If I do the SQL version, so max time average, but implement an SQL, that runs in about 19 milliseconds. If I use max time average with the PGX, that runs in about 13 milliseconds. If I do grouping with max time in SQL, it's about 650 milliseconds. So it goes right out there. And if I do grouping with the PGX version, it groups down to 35 milliseconds. And if I use the PL-PGSQL version that was submitted by the GitHub user, that runs in about 115 milliseconds. So we're running fairly close to what the C code would be. I've no doubt that if I implement this in C, then the C version of max time average would be slightly faster than the PGX one, maybe like 12 milliseconds versus 13 milliseconds. But the point isn't that we're better, is that we're very close to the C code. And obviously this aggregate is not really doing anything. So the more stuff you have inside the aggregate, probably the less overhead is going to be noticeable. Any questions there on the benchmarking stuff? Nothing has come in. Okay. So one final thing which we can now do is we can run cago-pgs. So if I do, I've actually got Postgres installed out of place on the system. It's there. cago-pgs package. That's up here. Minus C. And what that's going to do, is it's still going to compile the code, but it's going to use that PG config that's located from a different instance. So not a PG managed Postgres instance. It's going to compile the code. It's not going to drop me into a PSQL. What it's going to do is inside the target directory, inside the release directory. It's going to create this max time time average. And then it's going to run this max time to PG-13 directory. I'll do a tree on there. So it's going to create an installation tree that I can then use to copy that code onto that server. That PG config could have come from a different server. It could have come from this server. Obviously they have the same architecture. So I'm running a Mac M1 here. I'm compiling for Mac M1. If I want to push it up to an x86 server, I need to have a Linux x86 server. But once I had that, then I could then tar up that directory, copy it to the root of that other server where the PG config came from and then untar it and it would install my max time SO object and my max time SQL and control file which make up the extension into that machine and have it available for use. So just to recap that, we've created a PGX environment from scratch. We've created a new PGX project. We've edited some code. We ran the project manually. We packaged the project for deployment. We packaged the project for deployment. I think that it's safer, faster and easier. At least from my historical DBA point of view where I'm not a person who's been working with C in Post Hoops for a long time, then it would be using C. Will we put this aggregate into time scale? Probably not. Because if you add the correct index to work with, then we see something pretty strange happening. We're not strange. We're pretty expected happening. So the Postgres max time average goes all the way down to 0.3 milliseconds. And the post PGX one stays at 13 and the Postgres max time average group goes down to 17 milliseconds. This is 35 milliseconds. So obviously creating the right indexes is probably better than writing it. You can see. But having said that, when I gave a similar talk to this in Prague quite recently, there were I think 150 people there and afterwards, four secret people came up and said, that's the exact aggregate that we want because we're trying to do this with a lot of grouping. And we just need an aggregate because of the way we're writing queries. So it's definitely something that's useful. Probably won't be going to time scale, but the demo code is actually in a GitHub repo if anyone wants to download it and play with it, which I will pass on afterwards. So what are some real world examples of stuff we've made with PGX? In my previous job, before timescale at Jiratec in Sydney, we were a Postgres consulting and support company and we actually had a bunch of times we use PGX in production, but things that we would never have been able to do. We never have wanted to do. We would have gone anywhere near doing it with C. We had an extension which helps implement oracle synchronous replication semantics. I would suggest that people don't need those, but this particular customer is adamant that they wanted them. So it's things like maximum availability, maximum performance and maximum protection, which are really marketing constructs, but there are ways of sort of backing up on synchronous replication when machines go down. So rather than saying, if my synchronous replica goes down and I'm just not going to do any writes, it allows you in some circumstances to back off and keep allowing rights to the master. An extension that spawns a background worker which wakes up on load and hubs. So the next slide looks at the postgres configuration settings and sends any chain settings to an external postgres interface, which can then be logged in Grafana as an annotation. So you can be looking at your database throughput in Grafana, and then you can see a vertical line when a config setting has changed. You can see what the config settings change from and what you change to. So that was implemented for some of us doing a lot of testing. We had another one that uses a custom guck setting to specify rules for reducing the OS priority of some database sessions. So it essentially re-nices database sessions which was a hard requirement for this customer. I mean, it's probably not the absolute best way of doing that, but it worked out for them. And another one which tracks sub-transaction counts to work out when you're headed for the 64 limit per transaction, which isn't really any way to track explicitly in postgres. So if you've got a postgres connection and it starts up 74 sub-transactions, which is almost universally happening because using an ORM that's not working very well, that's really bad and those we've written to disk and it will slow down your whole system.  So we implemented a way of turning on this extension which would then tell you which commands or which escale statements or which sessions were causing that to happen. Cool. That's about all I've got, I think. Any more questions? Awesome. Thank you so much. No other questions have come in. I think we give folks one moment if anything pops up, you're getting clap emojis which I can only assume means great job. While we're waiting I'll just flick this up. So timescale's actually got a state of postgres survey open at the moment, it's open till June 30th. So if you're interested in helping us understand the postgres landscape, you know, really appreciated if people could fill out the survey. All the data is going to be anonymized and available to download if I have a wantson also prevented in a whole bunch of, I think at this stage, Grafana panels. One last one and then we'll go. What was the nastiest surprise you ran into? The nastiest surprise I ran into when using PGX was when I was implementing the shared memory support and I sort of understood how the postgres model for shared memory worked in principle but I found it was really hard to map that back to working in a safe way because you're fundamentally talking about something that's not really done and a lot of products these days, it was quite hard to talk to Rust experts about how it worked and be just quite a hard thing to do here around trying to safely encapsulate Rust objects and put them into shared memory in such a way they can be read back by Rust in another process. Awesome, thank you so much. So with that thank you so much. Thank you to all of our attendees for spending some time with us. Thank you James for taking us on this little adventure and I hope to see everyone at future postgres conference webinars. So with that, have a great morning afternoon evening and we will see you soon. Thank you.


I am from IIT Madras studying in Electrical Engineering. I took a course on wireless, which is principles of OFDM, CDMA, MIMO systems. Because a good course it covered the subject really well. But only thing is the type of questions, the difficulty of the questions could be slightly increased and the examination was also very well organized. And I look forward to having more such courses. Thank you. We are from IIT Raj College in Chennai. I am Manastha. I am studying. In the NPTEL courses both of us have chosen the infrastructure economics. The course was kind of good. It was really good. The way they have given us all the NPTELs and the video presentation we was clear about what he was explaining the professor. Our professor was an alum in NPTEL. And how did you know about NPTEL? Actually one of our seniors had recommended this to us. So we liked the way it was being done, teaching online and then giving us the tips. We had a few assignments in between so it was very helpful for us to prepare for this. How was the portal? Was it easy to handle? The online courses were NPTEL. We didn't have the online course. Oh, you were talking about the video and all. No, where is the website where you all were going and seeing the assignments. Was it easy to use? Yeah, it was very easy to use. There was no problem with the registration also. Discussion for announcements. Whatever questions we were asking we were getting back with clients. How was the exam today? The exam was good but we get the good results. And where do you think you will use this certificate? Will your father recognize this? Yes, and plus we are both economics students we are doing business economics so since we have taken up infrastructure economics it will give us more idea about what is going on and we have just specified with what we are doing.


time here for more systems and I'm wearing a shirt from CrowdSec and Fold is Closure up front. Yes, I'm a CrowdSec partner, but no, this video is not paid for and endorsed by CrowdSec. I want to bring this up because, well, everyone has an agenda, right? Everyone wants to know the biases and why people like something. And I want to explain how CrowdSec works and talk about in this video here, the concept of it. Now, this is not going to be the most technical video I do in CrowdSec. I plan on future technical videos and demos with it. And this will be my reference back to what is CrowdSec video that I share because this is, you know, how I build on topics. We'll start with what is the topic, what is the product, in case of CrowdSec here or the project, I should say. And I want to talk about how it works. Now, one thing interesting about CrowdSec is it is a actively participating firewall, if you will, for public-facing servers. Now, you're probably thinking if I'm giving them some data, I must be the product because that's how business models work on the internet. If you are getting something for free, somehow you must be the product. You're not the product in this case.  And I think that's a really important distinction with the way CrowdSec works. It is a two-way street. I want to talk about how that system works. And I'm also scratching my head that how no one came up with this sooner. It's a great idea that I love seeing come forward. It gives us better threat intelligence data through the active participation of people in an open source project here and an open source threat intelligence feed. And it's just fascinating to me how it works. We're going to dive into some of the details of it. But first, are you an individual or company looking for support on a network engineering, storage or virtualization project? Is your company or internal IT team looking for someone to proactively monitor your system security or offer strategic guidance to keep your IT systems operating smoothly? Not only would we love to help consulting your project, we also offer fully managed or co-managed IT service plans for businesses in need of IT administration or IT teams in need of additional support. With our expert install team, we can also assist you with all of your structured cabling and Wi-Fi planning projects. If any of this piques your interest, fill out our Hire Us form at laurancesystems.com so we can start crafting a solution that works for you. If you're not interested in hiring us but you're looking for other ways you want to support this channel, there's affiliate links down below to get your deals and discounts on products and services we talk about on this channel. And now back to our content. All right, so let's start right here on their front page and it says outnumbering cyber criminals all together. CrowdSec is a free open source collaborative intrusion prevention system or IPS, analyzes behaviors, responds to attacks and shares the signals across the community. This is why I said you are a participant in it because the sharing back and forth of these signals is what makes CrowdSec so effective at what they do. And this is one of the things I really want to make sure is clear. When you look at indicators of compromise put together by people who are working in security, by people who work for these SOC teams, by people who are putting sensors out on the internet or specifically companies that do, they put honey pots out there, they look for attacks, they look for the indicators of compromise, they analyze this data and they update their intelligence feeds that they sell to you. Now why do they sell them to you? Well, because collecting all that data is really expensive. Collecting via honey pots and managing 100, 1000, 10,000 honey pots out on the internet is a labor intensive. Hopefully no one notices their honey pots. Hopefully you made them look real enough to collect that data. The methods of collecting data have a pretty high cost associated with them to get really good threat intelligence data. That being said, CrowdSec is doing it a little bit different by you installing the CrowdSec tool and allowing it to, and they're very transparent with how this works, parse the logs on your system to look for different attacks. The attacks seen can then be added to the collective to the CrowdSec server and then sent back to the Bouncer module on there to block those attacks. This really distributes the labor differently because you're not really having to do much labor. They just had to write the tool, write the CrowdSec tools, the API and set up the servers and then you are sending the data back. Now they do have plans in the future to monetize this and some of their business model is for companies and grant that this is actually going to be a pretty popular business model and positive is for people that don't want to participate. They only want the intelligence feed. That's where they are selling data, but for you, person who wants to participate, there's no fee. That is always how they're going to do this. They have their whole system open sourced and if you don't like it, you can fork it. That's actually an attitude they've taken in a position they've taken on the market. They think this data should be out there. They think the collective behavior of all these threat actors should be public knowledge and they want to be the facilitator of that public knowledge. If you really take the time, listen to podcasts, dive into their different write-ups, you'll see where they're aligned. I've had my own conversations with their tech teams and this is why I really like them as a company and as a project. This is the two things I think are really important to understand is their commitment to security and commitment to being open source. And of course, this is critical if you're saying, wait a minute, didn't you just say they're going to have a tool loaded on my server that looks through my logs? And this is where the open source component is absolutely critical because you can look at it, you can see what data is being sent, you can understand it, you can vet it, you can verify it. That is a absolute important component to the way CrowdSec works is through pure transparency. And we're going to get into a little bit about that bouncer and how those work. Let me explain that a little bit better. CrowdSec is essentially two pieces. We have the agent that does all the log parsing. And then we have the bouncer that actively does things like modify firewall rules or any other rules and WordPress or rules in different devices. This is where it's really interesting the way they have it set up because I made firewall Debbie and Ubuntu Red Hat Debbie and custom AWS engine X WordPress. And if you notice on the front page, as of today in April of 2022, they were running some betas for Windows servers as well. The goal here is you first install the agent, which does all the collecting and parsing and then the bouncer interacts with the agent. Having these two things separate may be very helpful from a structure standpoint when you're setting things up. And all this is API driven and very scriptable. It's important to understand they've created these very clear separations here. So you can understand which each component does and you only need to load the components and modules necessary for your particular use case. And let's talk about a demo system I set up. Now here's a WordPress site I set up that I did not advertise tweet or do anything to draw attention to. I just put hello world. That's it. And the world did say hello back specifically all the different probably automated bots that come out and start looking and poking and wondering if it's configured properly. And as they're doing this are generating logs. I didn't do anything to have any of these logs generated other than throw it on here. Now, when I threw this on some of my production servers, there's a whole lot more logs where, you know, people are hitting my main website and things like that. But I wanted to focus on just how much background noise comes from these different bots and things that are hitting this. And here are the parsers of the different logs that was going through and the different data that it was parsing. Then you have the alerts and the API metrics and you go down here and we have the firewall bouncer and how those decisions are made. And then we have the WordPress bouncer right here to say which ones were bounced on WordPress because I use that plugin for this. It's pretty simple to install. But like I said, this is not going to get that technical in there. Now, in addition to the things you see right here, they also have a dashboard with the crowd sex servers. Now this particular dashboard is something you enable from the command line to send data back to them to get to the visualizer right here. This is still a beta feature, but please note, yes, you can export and it does have full exporting of all of their data and metrics. So if you can put this into your own visualizations, if you want, it's very open and very flexible with the way they do this. And here's some of the IP addresses that are hitting my site. And I'm not sure what made it so popular this particular day. I mean, granted, there's only 14 alerts from this particular IP. But it gives you breakdowns on here for where this data is coming from, the hits that I'm getting from these. And I want to scroll down here to this alert right here, because a lot of people ask about geo IP blocking and is that effective. And I've mentioned it before and I don't think it's a bad idea to geo IP block, especially if you don't have customers in that region, you want getting to the things you have public facing. But of note, I'm in the US and this servers in the US and most of these alerts are coming from the US. There's no geo IP blocking at all on this particular server. But you can see 73 alerts came from the US. And for some reason Luxembourg is a popular attack factor right here from where they came from in terms of different origin countries. And China is the lowest number of alerts. Apparently they're not that interested in this particular WordPress server. Now, while my server wasn't that interesting, not many logs and that demo server I set up, the log for J tracker they set up is still pretty relevant here in April of 2022. Because as we know, anyone who's worked in security for any length of time, people are slow to patch if ever. And that means there's a lot of active servers looking for log for J exploits. And they set up this cool tracking board. Now, the whole crowd sec blog is actually really interesting, because they've taken the time to do a lot of write ups and a lot of comparisons of how their tool works. And of course, you're going of course, they're saying nice things about themselves. But no, they're actually highlighting a lot of developers and talking about how it can be integrated and sharing with the community and highlighting community members who are making contributions back. Because the goal of all this being an open source tool is for that two way community engagement kind of the whole purpose of this product and project is to make sure that we raise the bar for security. Now, a few final thoughts, someone may ask like what makes this different than tools like Saracota, for example, which I've talked about here on my channel a few times. And Saracota is still another tool in your toolbox. This is not the only tool you should use that being crowd sec, but also other tools. It's all about having as you may have heard repeated a lot, but it's still true layered security approaches, all the different methodologies that you can apply that you can get working together. And Saracota being among them as well. Saracota is going to process things differently because it's looking at patterns of the data coming through versus crowd sec is parsing your logs and creating these block list. So these two tools are not competing with each other. Matter of fact, they can complement each other along with any other tools you may throw in there. You may have other web application firewalls. You'll have to really dive into the details of how you want to integrate something because that's a broader topic. But having each one of these tools work at different levels is important for security orchestration and overall, you know, creating that layered security model. Now I do recommend checking out their FAQ because they do answer things like, yes, they are GDPR compliant. And yes, we do go through logs and what exactly they parse out. They've got a pretty extensive FAQ that you can read through to understand better any of the questions you might have about the product. My overall feelings are, I'm partner for a reason. And I wanted to make this video to talk about what it is, why I believe in it. And of course, that I'm going to be making future videos because I'm excited they're working on some PF sense integration, which of course is a video that I am excited to see how it will integrate into the future of really lots of other firewalls, but specifically one of my favorites, PF sense. All right, links to the things I talked about are down below. Check out the crowd sec website and everything else I mentioned and thanks. And thank you for making it all the way to the end of this video. If you've enjoyed the content, please give us a thumbs up. If you would like to see more content from this channel, hit the subscribe button and the bell icon. If you'd like to hire a sure project, head over to laurancesystems.com and click the hires button right at the top. To help this channel out in other ways, there's a join button here for YouTube and a Patreon page where your support is greatly appreciated. For deals, discounts and offers, check out our affiliate links in the description of all of our videos, including a link to our shirt store where we have a wide variety of shirts that we sell and designs come out well randomly. So check back frequently. And finally, our forums. Forums.LauranceSystems.com is where you can have a more in-depth discussion about this video and other tech topics covered on this channel. Thanks again for watching and look forward to hearing from you.


We are going to go over the reasons I became very sick after nearly eight years of following a carnivore diet. Now, these are obviously things I realized after the fact, otherwise I wouldn't have stuck to the diet so long. And if I had adhered to these principles, I should have been okay for a much longer period of time. Certainly not feeling like I was on death's door. I do still have my carnivore meal plan available on frank-defano.com if you sign up. And that is pretty close to correct and far better than anything else I've seen. If that's not enough, you can check out the carnivore diet course as well. But all of this information is available freely on my channel. Overall, I think a carnivore diet can be done if you were using indigenous cooking methods with the entire animal. And I don't mean a bite of liver once per day, having a couple of organ pills. The consumption of the entrails, especially intestines, and organs that aren't typically accessible is what is key to nutrient balance. Those are much higher in copper, antagonistic to zinc, which tends to be way too high on most carnivore muscle-meat diets. So unless you're gutting a sheep in your backyard, you'll have to do a few things differently. And these are in order of typical occurrence on a carnivore diet journey, such as this will show up first, then this, then that, and finally, nutrient imbalances. So number one is low vitamin C. Although the carnivore diet does contain some vitamin C and you certainly won't develop scurvy following it, the amount is nowhere near ideal. Without enough vitamin C, you won't be able to optimize your antioxidant capacity. Imagine you're getting all of these B vitamins from steak for glutathione. Your vitamin E is good and not oxidized because you're consuming high-quality pasture-raised eggs, grass-fed dairy, grass-fed beef. But you're falling short on the vitamin C cycle, especially considering we're in a high inflammatory environment compared to our ancestors. There's a reason I wear a silver shirt all day. It's not because I want to sweat my guts out. Without higher amounts of vitamin C, your body will have a difficult time regulating certain nutrients, especially copper, iron, magnesium, and vitamin A, which we will touch on later. Even initially on a carnivore diet, people do feel energized when supplementing or consuming high vitamin C foods. One of the things you can generally look at for low vitamin C is low energy and poor collagen metabolism, as well as stretched skin. Someone's looking older, wrinkled, gaunt, not as good as they should. That's related to antioxidant cycles as a whole, not specifically vitamin C. If the person wasn't sleeping enough, didn't exercise, was in a super high-wifi environment, maybe they drink a lot of alcohol. That can inhibit the antioxidant cycles, which vitamin C may or may not help with. Number two, we have dysbiosis, which is simply an imbalanced gut microbiome. Too much of certain bacteria, not enough of others. And I've heard many carnivores say, oh my God, it's perfectly healthy. Yet they're pooping out of rock every three days.  It can't even have a bite of bread, typically occurring just a few months into the diet. And there's a reason all of our ancestors had certain dietary habits. In the past, all of us consumed a variety of cooked, raw, and fermented foods to feed different types of gut bacteria, as well as nourish our bodies. I've referred to this several times as a triple presence, raw, cooked, and fermented. Most also had carbohydrates in the diet. The few exceptions that weren't consuming carbohydrates consumed much larger amounts of fermented foods. And this is key because only carbohydrates can feed your gut bacteria. In that natural indigenous diet, which I wrote a book on, The Ancestral Indigenous Diet, you can check that out on my website as well. We have the consumption of fermented foods to repopulate the gut, such as high meat, beer, wine, yogurt kefir, various natural fermentations to keep the microbiome balanced, as well as the presence of carbohydrates to feed that gut bacteria. The probiotics and the prebiotics, the actual bacteria itself and something to feed the bacteria. That rare exception of the First Nation Alaskans in Udescomos consumed much larger amounts of fermented meat, rotten fish, on a consistent basis to make up for their diet's lack of carbohydrates. Instead of physically feeding the gut bacteria with starch, sugar, whatever it may be, they consume the bacteria itself to keep the gut consistently populated. Now, each of those things can cause dysbiosis on their own. Too much cooked food in the diet, stressing the organ systems, no consumption of fermented foods, which means you're not getting good bacteria in the gut frequently enough, and a lack of carbohydrates. So the gut bacteria that consumes carbohydrates dies off, and the other becomes dominant. Incorporating raw dairy and honey might help temporarily for some people, but it tends to blanket the problem, although yogurt and kefir are definitely excellent additions to the diet and some of the best probiotic sources that exist. As carnivore dieters brag about their low bowel frequency, they also brag about not having fiber in the diet, which leads us to number three, a lack of gut motility. The volume and food balance on a normal diet allows food to pass through digestion at a certain rate.  Too much food volume, not enough nutrition. Too low food volume, very high nutrition. When you go carnivore, the food tends to sit and be hyperabsorbed. So whatever is in that food, it's really getting sucked in by the liver, small intestine, those initial parts of digestion. When you don't have plant matter to dilute all of that concentrated meat, fat, organs, cholesterol, you could argue that anti-nutrients, especially in grains, might improve some issues. And this is even more concerning with feedlot processed conventional meats, because any chemicals, herbicides, pesticides, fungicides, insecticides, things used in processing the meat are also going to get hyperabsorbed. Fatty liver, SIBO, candida, all things related to dysbiosis are common here. It seems like every single person, after following a carnivore diet for six months to two years, gets something of the sort. Iron overload can easily cause this. The high iron content of red meat being hyperabsorbed near your liver, impairing its function. And then since the food is sitting there, you know, if you consume that sugary dairy, honey with the red meat, it's a recipe for SIBO, small intestinal bacterial overgrowth, CFO, fungal overgrowth, low gut motility, plus sugar, plus iron equals very happy bacteria. It's the perfect concoction to grow bacteria in a place it's not supposed to be your small intestine, at least in incredibly large amounts. And this is something that can take a little bit longer to show up, usually a year or two into the diet. For number four, we have nutrient imbalances. And yeah, you could have had some nutrient imbalances before the carnivore diet, but the ones specifically relating to carnivore happen severely in two to three years. And as I said, yes, most people do have nutrient imbalances, they're deficient in certain things, but the life-changing symptoms from nutrient imbalances on a carnivore diet take a little while. You know, lack of copper and magnesium are two big ones that you should definitely supplement. Selenium that is normally higher in seafood and some of the trace minerals that are higher in certain plants. If these mineral imbalances are out of whack, you might experience some head pain initially, mild digestive problems in the mid to long term. You have histamine intolerance, causing mast cell activation after a year and a half to two years of being copper deficient. Iron overload after that leading to liver dysfunction, headaches, especially insomnia. Dairy and honey can help a little bit here as well. Calcium kind of counters the high zinc and phosphorus content of a carnivore diet, which does help quite a bit, but in reality, you probably have to donate blood to reduce iron and supplement quite a few things to make a carnivore diet work. So we touched briefly on each of these problems, and I have very in-depth videos explaining these. So we mentioned that antioxidant video earlier. I also have a video on vitamin C. For dysbiosis, I have a video on how to fix your gut microbiome. That's also covering the low gut motility and related to nutrient imbalances. I have a three-part video series that I did on iron overload. The first one was explaining, I think, like how I almost died on carnivore. The second was how to fix iron overload on a carnivore diet. And the third was the iron pandemic, which is my belief that most people in the United States have some type of iron overload in their liver. And you could also watch a video I did, Why Steak is Good for You, where I cover the nutrient density of muscle meat and what you could potentially be missing. So definitely, you know, if you're new to the carnivore diet or you're new to any diet, really, definitely spend a couple of hours watching the educational videos on my channel to get a view of how to incorporate high-quality animal foods into your diet. So thank you guys for joining me today. As I mentioned, you can check out wi-fi-shielding.com as well as frank-de-strafano.com for all of my other businesses. Frankie Syringe Meat, Frankie Syringe Foods. We have a lot going on, and hopefully, Frankie Boy doesn't have to launch too many more businesses to make people as healthy as possible. I think it's just a matter of working with what we have now and expanding that. Thanks again for joining me, guys. If you have any questions, please let me know down in the comments below. And I'll see you guys for tomorrow's video.


Hey, Psych2go fam, welcome back to another video. Before we start, we would like to thank you all for the support that you've given us. Psych2go's mission is to make psychology and mental health more accessible to everyone and you help us do that, so thank you. Now, back to the video. Have you ever felt as if you're making no progress and becoming the best version of yourself possible? The road to self-improvement can be daunting and seemingly never-ending. Making yourself better is a slow and sometimes frustrating and uncomfortable journey. Whether it happens naturally over time as you get more mature or you make a conscious effort to improve, the results can be subtle and this may make you feel as if all your efforts are going to waste. To help you feel more encouraged, here are eight signs that you are becoming a better person. Number one, you're self-aware. Do you know what you want? Answering the big questions in life like what your purpose is and what kind of person you want to be can take a lot of thought and maturity. As hard as these questions are to answer, figuring out your character, feelings, motives and desires is key to gaining a deeper understanding of yourself. This self-awareness means you are able to recognize and reflect on your past actions to find ways to improve. Number two, you're conscious of your effect on other people. Like understanding yourself, understanding how you affect the world around you is a huge part of being the best version of yourself. You have the power to affect other people, which is great, but as Uncle Ben from Spider-Man said, with great power comes great responsibility. Understanding how much you can either help or hurt people means you have to make the active choice to be polite, tell the truth and try to control your reactions to things that may upset you. Number three, you accept your shortcomings and mistakes. Do you feel like there's a lot of pressure to be flawless from seeing gorgeous actors on screen all day to hearing about everyone else's greatest achievements? You may feel like you're not good enough, but it's important to realize that you're not an impeccable character in a book, nor is your life like a K-drama.  Number four, you're okay with being vulnerable around others. Are you afraid to open up to people or are you okay with letting others know how you feel? A part of becoming a more mature person is realizing that it's okay to be vulnerable and that it doesn't make you weak or inferior. Whether it be a fear of getting judged or a fear of showing weakness to others, being vulnerable can be mortifying. However, suppressing your feelings and refusing to ask for help can become very unhealthy for your mental wellbeing in the long run. Number five, you find the actual causes of your problems. Do you have a tendency to avoid your problems? While it's easier to distract yourself from why you're upset or frustrated, it doesn't really solve the problem. Finding the root of your problem and facing it head-on can actually help you learn and grow in the long run. It may take time and some getting used to, but figuring out the whys and hows of a problem instead of just trying to fix its symptoms is a sign that you're becoming a better person. Number six, you're more selective with the people you spend time with. Did you go out of your way to make friends with the popular and cool kids at school when you were younger? As you mature, your taste in friends may change. You might find that you want closer friendships with people who are more understanding, conversational and supportive. Wanting people who support you and who are truly good for you means that you're becoming more mature and thinking about your own needs more. Number seven, you make your own decisions. Do you always ask others what to do? When you're making a big decision, it can be easy to get swept up into what others want and expect. Of course, it's okay to take advice from other people, but it's also important to stay strong and true to what you want and believe in as well. Being a better person means learning to trust yourself and the decisions you make. Number eight, you ask more questions. Have you become more curious lately? Getting to know more about the world around you is a great way to learn about different people, places and more. Instead of following the crowd, you may start to question the things you don't understand or want to know more about. This is not only a sign of you becoming a better and more engaged person, but it can also help you become more versed and knowledgeable about the world. Do you relate to any of these signs mentioned here? Are you trying to become a better person? Tell us about it in the comments below. If you enjoyed this video, please like and share it with others who might find it helpful too. Don't forget to subscribe to Psych2Go and hit the notification bell icon for more psychology and self-help content. All the references used are also added in the description below and thanks for watching. We'll see you in our next video.