Welcome to the homelab show episode 63 Troubleshooting tips and tricks and I'm joined here by Jay. How you doing Jay? I'm what I'm doing really really well How are you probably a little tires? You've been editing a lot. I know that I am yeah I've been editing a lot of content, but it's uh, you know, I'm getting so caught up now that it just feels great I always complain on behind on behind, but you know what that's not the case now So it feels great to have a content flow. I think by next week Totally be back to my normal content schedule Awesome. Yeah, we've done 63 episodes or 63rd episode which means with all the projects and all the things we talked about We probably should talk about how to troubleshoot some of those things. That's when we know we were talking about doing it on the earlier Podcasts episodes and we're like now let's push it back a little further because now we can discuss some of the troubleshooting things Which is gonna be kind of fun But before we jump into this let's quickly think our sponsor of this show and that is Linode They've been a sponsor for I'm you know I should probably count but I think it was but only one or two episodes They didn't sponsor so pretty much all of the shows but it probably 60 episodes or so And we like to thank them for being a sponsor and these troubleshooting tips We will cover today will pretty much reply to even things you host in Linode so if you need one of these projects that we talked about hosted somewhere on a public IP address external from you and There's gonna be more videos coming where that'll become applicable as well Linode is the place to host it You know just not everything or especially if you're behind CG Nat is easy to host yourself in your homelab Even though yes We may consider Linode extension of your homelab that public-facing thing Maybe you want people to poke at it. I'll let them poke at their IP address instead of years We have an offer code to get you started with Linode and we thank them for being a sponsor of the show Oh, and it's Linode slash the homelab show. I should probably make sure I say that They could be your ultimate DMZ you think about it. Yeah. Yeah, put it out there. Let's let their cloud deal with it Alright, what's the first tip on our list? Where do we want to start? Is it the before you buy? Yeah, I would think so. All right It makes sense to start here now I do concede that this only probably benefits a I don't know 25% or less I'm not really sure the percentages are now a lot of times if people buy equipment for homelab It's mail order at sea bay things like that. You don't have you don't you can't touch it until you actually get it But with things like fake Facebook marketplace I'm not advocating for Facebook, but it exists and you know, we have to acknowledge that it exists They have a marketplace and a lot of people are buying servers there So it is the case that sometimes you actually can touch what you're about to buy before you buy it And one of the first things that you can do because what I've seen is that People just assume everyone else is running windows even people that are selling secondhand equipment They might load windows, you know, I don't know what version maybe windows server or something Anyway, if they You know will allow you to see it running which you know if it's an in-person buy Why not you really want to see that it works? The first thing you should do is go to the windows event viewer immediately because There's actually a serious hardware problem windows is going to be complaining Now keep in mind though that the event viewer likes to complain So there's never going to be a situation where you'll go to the event viewer and not see some critical errors Okay, so the presence of critical errors or whatever windows just calls everything that Now you might get lucky and not see any errors, but you probably will But there's always something in event log unless the event log is completely broken Which is even worse, um, but or suspicious if it's completely cleared before you arrive Hmm But if you look at it and you see like hardware errors about You know a device failing don't buy it That that's that's gonna you're gonna have some trouble with that device. So just say no, thank you And you know, I've done this myself There were like two laptops that I bought for a linux on old laptop series I really need to get back to that because it was a lot of fun But both of them I bought if I remember correctly off of facebook marketplace at least one And I remember, you know, he brought it out He put it on the back of his trunk and powered it on And I just went right to the event viewer and i'm like, um, yeah, I need to see if this thing works And the only thing suspicious I found is that he put an apple hard drive because it actually said in, um The most hardware devices, but it's it's it's it's it's it's you know It is an ssd legit and it's made by name brands. I didn't really care But anyway, the point is you could see some hardware errors And if you do Then don't buy the device ignore the driver errors that doesn't really affect you at all That just means the person didn't install the driver for something. Um You'll probably see errors about a non-clean shutdown. It happens But if you again hardware errors, you definitely want to check that out But but that's only if you can get physical access to it before you buy it like, um There's a server store in ohio. I wish I could remember the name of it but I've actually driven all the way down there because Um, the guy will just let me you know power on whatever before about I buy it He didn't even know I had a youtube channel. So it wasn't special treatment. Um And you can also ask people to send some pictures of it powered on Put something in the message so you know the pictures were doctored and I doubt they'll take the time to really photoshop it But like, you know, right today's date on a post-it note stick it to the monitor and take a picture and Yeah, little things you can do to try to verify It is an aggravation because there are scammers out there. That's a lot of why we're mentioning this Don't blindly buy things now. There are reputable places you can buy from You can of course look on ebay and things like that and I not saying ebay is reputable But you can at least try to make some determinations about the reputation of the particular person Of note when you look on ebay, uh, look at the person's selling history And if they made a fortune uh in a great rating selling socks and next, you know, they're selling servers Someone may have taken over that account and use that reputation to convince you that they were a great place to buy from So just do a little bit of due diligence on the buying part. Um, when you're building out your home lab It's one of those little things. It's you know, you get excited. You're like, that's a great deal and it has 128 gigs of ram Then maybe it's not another thing to check too if what you're buying is a physical server And if you can get pictures of this even better, I kind of feel like they need to Take pictures of this like look at the capacitors if because if it's a server you can just easily open up The case and look at it You want to make sure none of the capacitors are bulging or leaking especially not leaking, but they're bulging. They're about to leave Yeah, so I will admit that's a little bit less of a problem now because they Most things have the more the better capacitors now, but years ago. That was a huge problem It's not the problem hasn't gone. We completely uh, the good news is it's just less of an issue here in 2022 I think that even is more to my point though because a lot of the Equipment that circulates when it comes to homelab is the older stuff before they fixed it And there was a certain Dell power edge. I wish I could remember the model number Or this was so common and I remember Going online and there was like somebody who is literally making money by Say hey, send it to me and I'll redo the capacitors for you that he made a business out of it at the time Because of how many there were and those models are going to circulate Yeah, you're right.  They're not going to let you do that That's going way too far. Um, so of course everything I'm saying is situation specific But then the next thing though is What you should do before you put it into production So you have this device and you know everything checked out for you And it's time to get it going now. This is the hardest thing for me because when I buy any device I want to get it going right now. I don't want to wait. I mean, I'm it's like a kidney candy store I want to just dive in and start munching on it I'm so much from your servers, right? But I just want to get going on it but it is better to spend some time and Do some more troubleshooting because it's possible you could have Like memory errors you can run mem test on it You should run mem test on anything before you put it into production. Unfortunately that does take a long time But it's a lot less time than building the server Finding out everything You can't even trust the data at this point because you don't know what data went through bad ram and what's corrupted I mean, that's a way worse situation. Just spend the time be patient run mem test And also run spin right on level two. I'll talk more about spin right later But before I would even say if you have a brand new hard drive run spin right on it. The problem is um You're pretty much looking at overnight at this point at least but If you could spare that time spin right is going to just totally Um, even new drives are going to have some issues that the drives firmware may not find and that's what spin right does Yeah, um, but yeah, I still recommend you do that anyway You know regardless because it just makes sense to make sure the hard the hardware is actually good before you start relying on it That's that's very important absolutely So the other thing I want to Mention because tom has something he wants to get out of the way So I will mention this Next because it's extremely important and I'm the biggest hypocrite in the world for even mentioning this because I'm an offender here Okay, I constantly don't do this no matter how many times tom tells me to do this. I'm trying to remember Um, check the physical layer first now. We're getting back to the capacitors and all that but I won't mention that um You'd be surprised how many times it's a bad cable Or something to that effect. I I once had a whole roll of network cable that I bought and I was making my own cables and It's not hard to make cables. I thought I was just really bad at it, but it you know, it turns out That entire roll of cable was bad. I mean it just it was bad no matter who made the cable so Check the physical layer first. Especially if you're dealing with wi-fi issues, you know, what are what are your walls made of? That's a very big big thing there Um, check the physical layer again capacitors But cable and the other thing too is just checking all the loose plugs and things like that You know, we we've had clients that make the assumption switch is bad And you know a whole leg of a building went down and there's six buildings and they're all fiber together And they're in panic someone cut our fiber and everything else I'm like, did you check the sfp modules? Well, no, I said, I you know, they're they're a client that we know And we're like there's a box of them last time I was in your office because you had spares just in case and there's a pause And he goes, I'm gonna try that you see mail me back like 20 minutes later. Hey, that fixed it It was oddly one of their sfps went bad But they thought someone cut the fiber and things like that and started looking at there You know, then they went to the is a switch bad Do we need to start reprogramming it because we can get to these switches People started jumping all over the place on it and sometimes it is something just really simple And it's rare that those things happen that a cable goes bad or a port goes bad But it's not the the number of times it's happened over the years is not zero So you kind of methodically just go through all the especially the easy things to check, you know That it makes it a lot Faster to go through Just each easy section as you go and kind of work your way up there But the checking the physical layer on a lot of that loose plugs loose fittings lose connections You know, those are all really just they're they're more common than the more advanced problems You think you have with it. Um, I went and leave it myself I went into a little panic when something happened at the office and then it took me a second I'm like, oh, that's right. Check the physical right here It was something as absolutely simple as I should have just looked Somehow a plug had come out and I thought a server ring just died But it just somehow I don't know how a plug came out.  I remember my first it job ever I was doing help desk in a factory So I worked in the office part and I would just walk out into the factory Which you know, I got a lot of steps in and I ruined a lot of shoes So I got a lot of exercise but I go out to the factory floor and address an issue One of which was this person complaining that his network connection is is constantly bad And intermittent and when I go in there, I see the network cable lying across the floor and he has a roller chair So, of course, he's backing up over the darn cable repeatedly And I'm like, did you ever maybe think that we you shouldn't like have your chair Running over the cable and maybe we kind of should consider like not having the cable across the floor Now that's obvious, but often it's really not that obvious. You just have to kind of look at it I've troubleshooted things for like four hours sometimes months like my wi-fi issue From a couple years ago, tom I was complaining about it for a couple of months and I tried every setting in unify no demand And come to find out it was just a bad cable going to the access point. Yeah after all that So yeah, check the physical error first Absolutely. All right, all the physical errors out of the way the one I'll get out of the way That I just wanted to throw out there. We didn't a lot of these tools we're going to talk about next We're going to be going to be a lot of linux command line troubleshooting tools I'll have one pf sense one in there, but Windows has sys internal Utilities it's A long list. I don't know if there's going to be an episode on sys internals But there's enough documentation out there from microsoft on it. It's kind of the de facto Set of tools you're going to use inside of windows to troubleshoot a lot of detail windows problems So we're not going to spend a whole lot of time on that or any time on that other than to mention Generally, you're going to use the sys internal tools and There we go. That's yeah I would go as far as to say that if you if you do use windows servers in your home lab I mean I know enough about windows to know get sys internals like I know every windows admin i've ever talked to They all say, you know, how great those tools are sing their praises So if you run windows make sure you also have those tools downloaded as well So that way they're ready for you whenever and if if you ever need them You know, um before we jump to the next one j. Let's let's talk about one real quick here Because I seen someone mention in here and we should have been on our list because it's always dns It is always great. Um dig is your friend when it comes to dns I have a whole video on using dig to help troubleshoot dns issues It's you know finding mail server problems for whether or not you have mx records a records and all those types um, I don't know if that I mean, I'm not going to spend a lot of time on it right now because maybe that's a Uh episode of how dns works I don't know if we've ever covered that but that might be just its own episode because all the different trickiness To dns, but I have a video on dns dig is your friend ns lookup is ns look like deprecated in linux or I don't know because deprecated in linux generally means You really support for the next 10 years that everybody uses it for like What 10 to 15 years after everyone tells you not to and then finally it goes away if it even does because you know It's weird. I've been using dig for song. I never think about ns lookup. Um, I think it's still in stalled by default I don't know how you dig is my go-to tool for all of my things Uh, it's just it's you know easy to use dig at the ip address of the dns server and then the commands after Uh, but it's just invaluable because you want to know how each server responds Um, and you know bug us enough and send us some messages and tag us in twitter And we'll do a whole episode on dns because you know, we can I'll dive into my zone transfer story that got goofed up one time So so here's the thing. I'll make a deal with you tom I will absolutely be on board with an episode on dns just as long as we call the episode It's always dns that must be the title and then always dns that has to be the title then i'm on board Yeah, but we'll mention dns. Definitely on the list. All right now. Um, you have a good one in here That's uh, or rescue zilla Yeah, I there's a few tools in here and i'm gonna mention a couple of them And there's and by the way, I know We're gonna get comments like why didn't you mention x? Why didn't you mention? Why trust me like I know like there's a bunch out there But um rescue zilla I like because it's compatible with clone zilla if you do take images Which is which is great. We had an episode about that the rescue zilla Supports those images plus a bunch of other tools. So um, you know your general troubleshooting tools and apps and things It's kind of like the swiss army knife of bootable tools so It's one of the things that I recommend that you have flash to a usb or um, you know, tom turned me on a ventoi recently Which is a lot easier. Um, I haven't tried it with ventoi But but I assume unless the knowledge base says otherwise you can use it with that Either way at the very least have a flash drive rescue zilla on it because if you need to do any data recovery Anything like that. It's a good one to have But I also mentioned zubuntu as well, which is going to be strange at first But there's a reason so I didn't mention ubuntu or pop o s Because well, first of all the thing is i'm talking about live bootable linux distributions Where you run it off of usb, which is pretty much the majority of distros nowadays um What I like about zubuntu is that it has the same You know, it's built on ubuntu. So it has the same compatible compatibility but gnome doesn't really work well on gpu starved devices And let's face it unless you have a very specific kind of server You probably don't have a gpu because a lot of the server hardware It has gpu enough to show something on the display and that's it like it's not built for games Unless there's you put a gpu in one It's probably going to have the weakest video card you can get so you probably won't be running gnome on that so zubuntu is lightweight it has the xfce desktop environment and I know there's lighter weight ones but I feel like zubuntu has like some of the best functionality with Being lightweight so it'll run well on whatever server and you can use that for file recovery So for example, you want to get all the files off a server You could just connect it to the network boot from zubuntu or sync everything to somewhere else Verify the data and you can sell it or whatever it is you want to do And another thing is that it has boot repair that you could download From the repositories and even though it's live you can still install software until ram gets full obviously, but Um, you can use part of boot with that and g parted Oh, yeah g parted live is another one But yeah zubuntu for file recovery and boot repair for sure It's just a good thing to have I mean you could even use it to to google the problem you're having with the server on the server I mean let that noodle around in your mind for a minute. Um, but yeah g part of live is great Well, no, you can actually load g parted in the xpuntu as well. It's what I was saying right you can and um For some reason i've always had g parted live separate. I don't even know which is nice and that works too Um g parted separate is nice if you want to use it It's just a live CD you can download that boots right up and g parted It's nice because it's really lightweight and dedicated task But if you're troubleshooting things And you find that troubleshooting leads you to partition problems Then you can apt get installed g parted along with googling those problems right on the rescue one Which is kind of fun like jay said it's let that noodle around a little bit You can boot up do all your diagnostics have internet do everything on there solve the problem And the other advantage using something like xpuntu is like he said are syncing files But we'll go a step further you have all those facilities in there for smb mount and everything else to be able to mount Other things without having to load a lot of that that kind of just comes default loaded in a bunt in the xpuntu To get things moving so it's a great way to rescue servers and things like that That you don't know why that last command caused the problems that did or what happened, but it's a good way to help unravel that Another thing that i'll mention about this that's probably even more important is that live media help us Determine like is it a hardware issue? or a software issue because if The problem follows whatever distro you boot then it's probably hardware I mean obviously it varies But if you try to reproduce your problem in live mode You'll learn a lot about the situation that you're dealing with Especially if everything works fine in live mode and another trick you can do with live media that I don't think a lot of people know this You can for example boot from let's say zubuntu and then get another flash drive And put that in another slot and then you go to install zubuntu would be careful Don't install it on your actual server point it to the other flash drive And it'll treat that flash drive as a legit hard disk And then what that flash drive then becomes is a actual install of linux that is not in live mode. It's actually Booting it's writable. It's every bit a real linux installation on the flash media And you don't have to deal with the try or install or any of that other stuff It's already installed it's installed on the flash drive. So at that point you have a legitimate hard drive Yeah, it could be a little bit slower But you can install or build whatever software it is that you had running on the internal disk and see if that works And then you can take that flash drive out with your software and settings on it Put it in another server and see if it works better there because if it does then there might be something specific to the original server Yes, absolutely And what's next on our list here? So there's going to be a lot of smaller things to mention One of which and I have a video coming out that goes over logging, but Tail the syslog I mean, it's like the ultimate thing when you are troubleshooting anything just tail dash f syslog or var log messages regardless of your I mean depending what distro you have That you can watch the messages scroll as you're trying to reproduce the problem And it's the number one way that I troubleshoot ssh because ssh Yes People complain about this because you're like, well, I can't connect to the server The ssh is not even giving me an error message or anything that really tells me why Some I mean it it could tell you why but I mean ssh will tell you that your password is wrong When your password was not the issue and it was the key I mean, there's just all kinds of oddities there So I think the issue is that ssh doesn't want to give you too much information about why you can't connect because if it's a bad guy Then they're getting information about why their attempt isn't working. So it's a good thing that it's not giving that info But on the other end You could like in a in a, you know, web console window just tail the log try to ssh from your terminal and in the logs especially Varlog secure or the off log in devian will give you information about ssh But for everything that's not ssh or security related just tailing the syslog or varlog messages will absolutely give you some information That'll help you understand exactly what kind of problem you might be running into So you could check check dmessage as well. That's a kernel ring buffer. There might be some information in there as well Another thing that's that's not as known because this is a problem that doesn't happen often But I think homelab people Would be more likely to run into this than the average user I'm talking about iNodes. This is not something that people really think about first because Yeah, it's that's a good interesting one too Because this was a topic I just brought up when I was talking about the new way xcp and g backs up And i'm glad they added the warning on there because they're doing Data chunking into lots of small files to make merging deltas faster But that chunking of putting it all in a bunch of small files They warn you if you're not using zfs or butterfs Don't do this if you hit an ext4 it only takes x amount of data to completely overrun All of that so that's you're just going to have a real problem For sure and I I remember very early in my career how frustrated I was when I ran to the end of this So here's what the symptoms look like You have an error that the disk is full you go to write a file and it says insufficient free space or something like that And then you do what everybody does df dash h and you look at it and I looked at it. I'm like It's 20 full. It's literally got 80 of its space free. So it's not full. What's going on here And then after a ridiculous amount of researching I stumbled upon this I'm like, oh, so if I type df dash i instead of dash h I'll see how many iNodes are in use And then the maximum number of iNodes that can be used And like you're saying it takes a ginormous number of Files to fill up the iNodes. This is not something They'll run into unless something is really wrong like you if you have a mail server Which is probably the big problem.  Um, it's probably more likely to happen in a company though, honestly Yeah, anyway df dash i if you have a situation where the disk is reporting that it's full But you look at it and it's not actually full at least not in the sense that you think of it as being full Yeah, and I'll also mention I almost just out of muscle memory habit. I'm going to type uh df i h And the reason why is I just want human readable on the sizes It just makes it a little bit easier to to show you on the space side of it a human readable format So you understand it easier Because a glance if you're if you don't see just how many digits that is when you deal with larger storage places You're like, oh, yeah, and uh, it's easier to see. Oh, that's a g in front of there We have that many gigs free Of space on there and just a touch back on the log files There's a great utility that free is built into most repositories called lnav l nav and L nav is great. So l nav will allow you to do color coded real time plus has reg x matching of any of the logs you Uh put into it and you can even take and put multiple logs together into one l nav view So if you wanted to watch two log files simultaneously in real time You can type l nav and the two different log files and it will consolidate the view on there I've done a whole video on it. Uh, it's just a really impressive tool for being able to not just see the logs Or search the logs but also watch them in real time as something's happening It's just it's an invaluable troubleshooting tool for sure when you Have log problems to go through and another Uh thing i'll mention about logging this is thanks to michael in the chat room because I can't believe I forgot Actually, I can I can't believe it because I'm I started using linux way before system d was even thought of so i'm still not like conditioned If you think of it like doing everything the system d way But you know it is the way it's going Um, and no i'm not trying to start a flame war. Believe me, but journal ctl dash f dash f is follow So you could follow a log file, which is great But you could also use the dash u option to follow a specific unit. So if you wanted to Um follow ssh then you could use um dash u and then ssh And what's easy to remember because I've said, you know, when nobody's around Let me come on. We've probably all done this.  It's so easy to remember and then the unit name after I mean, obviously you could do dash u f Right, but it's not as fun So if you do dash f u and then the unit name like ssh d or whatever it is You'll follow that specific unit's messages And you won't see messages that are meant for a different service. So that could help you narrow that down so It could be like on a on uh ubuntu, you know journal ctl dash f u apache 2 Or http d if you're on sentos and so on so that's the system d equivalent of the tail dash f Yeah, and I'll give a shout out to cat daddy for duff d u f That is prettier than that. I'd actually not use it before I knew because it wasn't installed on my system I just installed it really quick. It wasn't it wasn't a repository, but uh duff is a more enhanced prettier version I know i've seen it before at some point. I didn't know what people were using when they showed that So it's a really nice kind of incurses drawn version of the d u command. So that's clever We're going to come to a little more just utilities. Oh, I'm sorry um I was going to mention when it comes to all like these disc utilities for for free space related shenanigans The interesting thing here you have to install them before it becomes a problem because if your hard disk is completely full Then you're not going to be able to install duff because it's full. Um, so obviously your inability to install duff answers your question Yes, the hard drive is full. Yeah Problem solved, right? But you know give me the error message you expect though But you know considering what you tom have added to the list, which i'm going to let you own this one That's another one that you'll want to install before it becomes a problem because then you can't install it If you have no space to install it in but it'll help you with your free space Yes nc du And there are there are utilities that are graphical like ui graphical this one actually has some graphics to it I actually was just using this today because I had to solve some elastic search problems Where one particular index was too big, but I wanted to delete stuff from the command line So using this in the command line it can analyze all the directories And then tell you how much data is in each one of them and when you have Well, I don't know 600 of them in a server that's storing a bunch of elastic data You just want to purge one particular index because something broken that's the fastest way to fix it It can help quickly find the offending folder that had 400 extra gigs of data for no reason and it when most of the other ones have a gig of data so It's a really nice utility for searching down and figuring out what's taking up all the space on a You know per folder basis per directory basis. However, you want to call it And and drill down into it. It also Trees down as you go into each of these it is just a really simple utility, but boy is it handy I've actually used it I had a weird docker problem where the docker didn't delete a bunch of stuff that didn't show up in docker But I did use it and I found all the extra files that the database When something had failed had an extra replicated copy on it. It wasn't in use by anything, but it was definitely using up space That could happen Yeah, so it's sometimes almost a utilities, but it's just really handy sorting out space problems of linux We've spent a lot of time on that but you also in real life you spend some time on sorting out storage issues, so Yeah, it's uh, it's storage in dns and number of contenders with dns being number one obviously because you know, we you can't Even the entire internet can break sometimes. Um, it happens another thing to address here is this kind of a Weird problem to work through you have an issue on your server and you want to troubleshoot it and try a few things But you're also kind of scared of like Making the problem worse like breaking it more and then it becoming more You know harder and harder to figure out how to fix it because you know, you just made it worse um One thing to keep in mind is that if you have Your server running in a vm clone it Or take a snapshot depending on the data if you had like a you know 100 gigs of data or way more It's going to take a lot longer to clone obviously, but If you clone a vm And i'll do this on linode and proxmox both I could just you know Use all of my troubleshooting against that clone and I don't care if I break it I'll delete that clone and create another clone until I get it down to a science about what exactly fixed the problem And I know exactly what to do in the on the production instance Now of course you could take a snapshot all the same that'll serve the same purpose It doesn't have to be a full clone But you know some companies out there will even do full clones just to you know Put in some you know backup testing as well Um, so it kind of gives you an opportunity to test your backups if you grab a backup that was taken You know after the problem started and you restore the vm You know your backups are at least working because you're able to restore it and the data is there But if it has a problem then you can just troubleshoot it and I think it is Kind of liberating to have this feeling like I could do whatever I want to the server It's not my main thing I can break it and that's fine And then you just have no hesitation and you might actually be able to fix the problem sooner because you know You have a contingency plan just as long as you're not a bonehead like I've done some time And then you're actually on the production server because the ps1 prompt is exactly the same on both Okay, you got to be careful, right? But with a clone of your vm if you're troubleshooting you can absolutely Get it down to a science as far as what caused your issue and what you need to do to the real one to fix it Yeah, there's and I have a lot of snapshots that are frequently named before tom did a thing Me too Yeah, I just hurry up and snapshot something run the command see if the outcome is what I Had hoped or not what I had hoped and if it is great I'll eventually delete my a point in time that was before tom did the thing Yeah, that's really handy. It's one of the reasons, you know virtualization is so popular It isn't just because it makes a lot of things easier or more efficient use of your hardware But it also allows you to grab those points in time Where you can say this point in time was exactly You know before I did this command that I think will work I think it will fix my elastic indexes. Ooh, that didn't fix them at all. That seems to have caused a completely new problem so Funny you mentioned that because I'll do like a snapshot. That's base install Um updates installed, you know kind of down different layers I have so many snapshots that if a vm where admin looked at it They would just get red hot mad and there'd be steam coming out of years. You know, you you need to get rid of those snapshots I've heard that over and over again from vmware people But you know snapshots are a very useful tool and I use them without hesitation Yeah, but also the majority of my youtube videos Are um, actually the result of avm. I record from real hardware But before I hit the record button I rehearsed on a virtual machine and I had snapshots to know like Or to test what's required and what's not because I see a lot of how-tos out there that'll Say you need to do these 10 things and I do like six of those things Or check the documentation from the project and it doesn't even have those things in there So then I just keep trying over and over again until I get it down to science And then I recorded on real hardware because I know what's going to work So yeah, I mean I take snapshots way too much I think but it works Yeah, um next couple utilities and we're going to get into the networking side of things now and I really like it's just simple, but it gives you a real-time stats from the command line And yes, you can do this with a couple of utilities we'll get to but beam on is really simple bmon And it monitors your network gives you a cool little graph to show you how much data is going across They can also give you the bytes collision errors broadcast deliveries Fragmentation problems a lot of little details about your tcpip stack and When you're doing a bunch of goofy little troubleshooting with networking It's kind of helpful to be able to see that Next one on that list is going to be and I seen net stat and someone said the replacement is ss. Yes Use both SS or net stat both are solid and you want to see what connections are going somewhere and what connections are going back and forth Two things those are great for having snapshots There's a lot of scripts They probably have a lot of that integrated in there Especially with a lot of net stat because you need to know what is or is not connected But let's go a step further and let's watch that in real time filtering for connections even ip dash ng ip traf ng is awesome It lets you in real time with a completely because you can ssh into a server and do this by the way when you do that Also when you create the filter you can create inverted filters like please ignore the ssh connection I have going into this and then Start looking for the connections you have in there ip traf ng is just really helpful Let's say you want to see if a certain server has a tcp connection to a certain ip address or maybe even just certain ports What's connecting on this particular port that I have a service running on and I wanted to update on the screen in real time And have a nice little it's all just driven through keyboard commands or up down arrows to go through menus Kind of an incurses look but it makes it really nice to go through those menus and go All right, I can see this or I can see what's hitting the ports and easy example Maybe you're setting up a unify server and you want to understand what services are coming connecting to one particular port on there Then you can start doing that and make a list of those ip addresses This is some really those Handful utilities are just kind of a combination of things I use a lot to kind of burn through and understand the tcp connections going on And what's going on with them? I'll also give a shout out because beam on does a nice job But if you just want to watch speed there's if top And that's interface tops kind of like top but for the interface We'll show you how much bandwidth per ip and then there's also speedometer Which will give you a speed rating for that network interface and kind of has a cool graph to it And all this is a command line So these are all just really helpful when you want to watch some of the data going across And that stat is a great idea one of those things that Is is technically being deprecated but in linux it takes a very very long time So I think your advice will probably be good for another 10 years. I'll never understand why Getting rid of legacy things is so hard and companies I get it because I know what the challenges are but I still reach for net stat and I haven't made the ss command Muscle memory yet no matter how many times I see articles out there telling me I shouldn't use net stat It's just install the net tools package and it's there So, I mean as long as they make that make the package available to me and it's installable I know technically as an educator. I should be telling people to not use deprecated things but Honestly, my opinion the warnings are out there and they usually have the warnings out there a very long time in advance So someone All of a sudden can't install it anymore and they're not ready You know what's on them because they should have made attention to that warning But while it's in the repository, it's muscle memory. It's really hard to break. But yeah, yeah that it is now There's plenty of other things to do. I see people talk about more of them, but we'll move on to Using iperf I suggest this all the time and it's going to be kind of related to another question Someone asked about mtu when you're doing some of these troubleshooting things iperf is a great way to load up interfaces and this works in windows and works in linux and works in free bsd There's compilation. I think there's uh, there's an android. I don't know if there's an iphone But there's even an android app for it Wow iperf is great It's even built in the pf sense The the overall with iperf is you set up one server to listen and the other server to broadcast and then you can test the Line speed because before people in start diving into I can't figure out Why can't these file transfers between my nas and my computer going? I always ask and I rarely see anyone start with a I tried iperf and i'm getting a full connection between these two devices And i'm not getting the speed I want on my nas it always starts with my nas is only transferring at X you know, I have a 10 gig connection, but it's not even getting to one gig I'm like, what's iperf say? and there's always like a 24-hour response in my forum post before oh, I did test iperf And I had it plugged into the wrong port because I couldn't get above a gig. I'm like, okay now we know the problem um I purpose is a handy utility for understanding Whether or not you have solid connectivity. It does not write any files So you are not limited by the file system in it It is doing just a raw network socket Basically to go from point a to point b and see how fast we can get there And if you can't get there at full speed you have a problem kind of related to the mtu problem When you think about the way mtu's in the way you're doing the chunks If the Switch has a misalignment so to speak you set a 9 000 mtu But then your switch actually requires you to set a 9 000 plus a few extra bytes for the header and That can cause a problem because you've got some extra v-lands in there And so it's offsetting it you'll run into an iperf problem right away when you start Connecting devices and realize something's dropping some of the packets And you now have less packets going so there's lots of retry transmissions going across this line And retry transmissions take up bandwidth therefore you do not get the full bandwidth iperf just makes a lot of that troubleshooting and tuning Really easy to do when you're doing it. It's just it's like the common question I ask all the time is did you run iperf? Because I do a lot of nas troubleshooting a lot of vm troubleshooting iperf is even built into xcp and g I believe it's probably natively defaulted or easy enough to install on proxmox. It's also in true nas So it's already on the platforms you use and then to go a step further You can load it up on your phone because next question is how fast is the wi-fi? Well, it depends where you're standing and iperf can kind of make it pretty easy because you can Have a fixed number You know how fast iperf is and you keep moving between fixed points and seeing how fast the data Traverses at full speed across the access points. So iperf is just it's an easy free utility been around forever works on all the platforms And I just find it really really handy for doing all the network speed troubleshooting You know what it's funny Before I discovered iperf Which I wish I knew about it before I did My go-to was like having the larger version of the sentos iso downloaded the dvd And I would just send it from one computer on the land to the other And just kind of do a verbose mode and just watch how fast it goes which is not an accurate way to do it but Before iperf that was totally my go-to is just send a big sentos image across the network and see how fast it gets there But don't don't do that use iper don't do that Yeah, there's not iperf is just uh Makes life simple now right to go a step further This is a little bit more in depth but definitely worth if you want to play with lots of tuning things And I've used this plenty of times in my videos And that's for onyx for onyx test suite is amazing if you want a Test suite where you can have it all graphed and mapped out for you So you don't have to open up your own spreadsheets to do this For onyx just has an amazing set of utilities. It's used by the industry as a whole you'll you'll see other not just youtube channels But lots of people serve the home and all those people one of these tests. They'll run the for onyx lab test Um, it's just great because you have a repeatable Absolute consistent you can even script it You can go straight further and it has a web interface if you want to get complicated into it But just using the command line for onyx download the suite load it up on a server Run the commands document make notes I should say of just which commands you ran so you run it consistently They have a test suite that'll test everything from processor or memory They have sequel simulators apache simulators So you can simulate the entire type of workload and this is used commercially I know by a lot of companies before they build servers because they kind of determine What is this server going to be set for? Oh, this is going to be your you know a sequel server All right, let's go ahead and simulate a sequel server on this Then you run the command set on there it creates an output Then you for each time you run it it'll ask you would you like to upload these results? You just keep saying yes and for each run you do you can make notes of what you changed Change this configuration. So you're running the same test The important part is you're creating a consistent baseline of tests And then for each note you made of your change for example, I did my iSCSI versus nfs Nothing different the command output was the same The only thing different was the vm was stored on an iSCSI target for one and an nfs target for another And I ran each one of those sequences of tests And this is how I get those different performance numbers But having that consistency you get from something pharaonics allows you to tune Because you can't really tune without a consistent baseline test that you run Perfectly the same you can't just say it feels faster now because that's that's the kind of fuzzy way of doing it You want something that's extremely objective And that's why if you see me and I thought about maybe I'll do a video on it because I don't think anyone has Of how pharaonics works, but it's free. It's open source It's easy to get access to and it is a wrapper in some ways for a lot of other utilities Because it uses under the hood fio and a few other things It even has a Colonel compile benchmark, but if I'm not mistaken it actually loads gcc and compiles to make it work so So just to address a comment in the chat room because I feel like a lot of people are going to have this Same question is ph o r n o n i x Yes, because when you hear someone saying it yeah, it doesn't sound like it, but it's That's what it is. Um, absolutely and I've used it too. It's really good Now it does share the name with the news site for onyx And yes, they're the same people to produce it because they do a lot of linux testing and they built this utility To have a consistent baseline for their reviews. So it is a it is also pharaonics news is Not coincidentally named it is the test suite is named after and maintained by them They do a lot of testing there and of course, this is also really cool. The results database is public By default people make it public But you can then look at something maybe the pharaonics news site tested and then you can compare your benchmarks to theirs And that's one of the things it'll give you stats on that so you can see how you're doing To get baseline averages, especially, you know, drive performance is Very tricky to do With a lot of setups and pharaonics, you know trying to say, all right Is it as fast as this array or that array when you're testing things? It's it's really it gives you some really good numbers So definitely um, I it's an involved utility If there's enough people message me or dm me on twitter or something and say time Can you make a video about it because it seems kind of hard because our documentation is sparse But it's it's not if you play around you just kind of figure it out If you're familiar with running command line stuff Uh, and once you kind of get the nuances of you're like, oh, and they do have forums and support as well so I wanted to take a quick moment and mention more about spin right because I meant to mention that at the same time I was talking about zubuntu and you know rescue zilla that it was another one to keep on hand. Um now what spin right is is a way of um Triggering the error correction on the drive to do the job that it's supposed to do anyway because let's be honest We're not the fact that spin right exists is great because it's useful But it shouldn't exist because this is the job of the hard drive to be doing the error correction But the error correction of the disk firmware is just not that great So what spin right does is if it has a if there's a bad sector and all hard drives have bad sectors And then in ssds we have bad cells It if you have a situation where you can't read data from a drive What spin right tries to do is it tries? Group force almost to read the the sector over and over and over and over again It's like a a three-year-old that's asking the same question over and over again It's asking the hard drive for that data over and over again and the hard drive is answering I can't read this I can't read this the hard drive is supposed to say You know a long time ago. There's an error with this sector. Let's map it to a Good sector, but it doesn't do that as good as it should So spin right is just a way to force the drives firmware to do what it's supposed to do And when the situation that it helps in is of course file recovery, but it also kind of helps with I think they call it disk route where you have things are slower to load, but they do load It's just over time Because there's some wear it actually forces the data to get mapped to a better area and it can actually make a slow install Actually feel fast again and all you did was run spin right on it So I just make sure on physical hardware. You don't need to run this on VMs. That'd be crazy. Don't do that Yeah, but you can run it on the hypervisor on the actual physical hardware You can run it on SSDs at level two I'm pretty sure if I remember correctly level two is what you want because some of the ones Some of the modes will take weeks. I mean that's when you have data Like it's you need that data and you didn't have good backups And you don't mind spending having this thing run for weeks to have like a five percent chance So that might read the data and you get that data back But just running it every year in your physical hardware makes sense And also if you run it on brand new hardware that might also help as well So I wanted to it's not free by the way. I want to throw that out there Um It's not free. It is slow. There's a faster version coming out. It's been in development for like 10 years It'll come out one day promise. Well, actually, it's not for me to promise I'm it's made by Steve Gibson of GRC He's one of the uh two hosts of security now one of my favorite podcasts But I've used spin right a lot and I like it and it's saved some It's actually done a lot of good. So it's just one of those things I Like to have around I'm not saying to go buy it Because what if you don't need it, but if you run it every year, I think it will actually add value So it's just even though it's not free. It's something to consider Yeah Gibson's put a lot of work into it his new version is a lot faster. So Yeah, his new version isn't now unless it is I think he's the beta if you buy it if I'm not mistaken Oh, okay. Well, that's interesting. Well, I'm still waiting for the final release. Yeah, I'm waiting for the final release. So But it's one of those things that that really shouldn't help Right because again hard drive firmware should be doing this stuff and it shouldn't be an issue But unfortunately spin right exists because the hard drives themselves just don't do a good job with this kind of thing So that's um why I wanted to recommend that Yeah, no, that's and it's worth um It's worth mentioning that because it's One of those things and I guess I'll mention this too because it's kind of related to spin right is test disk I don't know if you've ever used it. It's a it's a command line file recovery utility it's It's one of those challenges sometimes where people lose things and test disk has some ability to try to do it Spin right try to recover it just back everything up. Um, I know I know we're saying that but everyone's like well cool I wish I would have heard that before I lost my data But recovering data is always really really tricky So I'll throw that out there and spin right can sometimes save our drive, you know provided It hasn't gone too far Exactly if your bios can't read the disk then spin right cannot help you in that situation. Um Yeah, it does not recover from catastrophic failures Right if it catches on fire, it's not gonna help. Um now Test disc was that the one that people use for like when sd cards start getting corrupted It's actually I I've over the years. It's been a minute since I've used it But we used to have a lot of photography companies and um I I mean I would suggest they don't do this But they would they would constantly reuse and they'd buy the cheapest flashcards They could whatever they could find on sale And then they would lose a wedding and it was just shame and I'm like I My opinion is if you're spending that kind of money in a wedding Just buy a dedicated 30 dollar Sandisk like you can buy one for 30 or 40 dollars or just not that expensive But nonetheless if you buy the cheapest one and you reuse it many times there are a limit And with nice high res high quality cameras you're writing a lot to these So you occasionally would lose them and sometimes it would lose the file table The good news is tools like test disc do a simple thing where they walk the disc and identify file types And reassemble based on the file information that can be reassembled It does pretty much consistently lose the metadata about the file such as its name But when it comes to photos for example, that's not as relevant You just want to find all the photos and then you can organize and rename them As you see fit like so-and-so's wedding So Exactly. Yeah, and I feel like it's a isn't okay utility. It's not like the most amazing But hey, it's something and sometimes you can get some files back with it I'm considering how many people within our audience are Using raspberry pies. I think that recommendation might go a lot further than you might think because I know we have some Photography people in our audience. I'm one myself, but um Yeah, I mean raspberry pies. I mean It's probably more of a question of who doesn't have a raspberry pie in our audience and the people that don't are probably the ones that are Um unable to find them because of covid prices right now. Um, that would have one otherwise So that could actually go pretty far for that recommendation All right, I think we've reached the end of our utilities list Mm-hmm Sure have plenty of stuff for people to try Plenty of stuff for people to troubleshoot. It's best to be familiar with these tools before you need them So play around with them. I beat your half is just kind of fun because you may discover something on your network You didn't know was communicating Uh, the recovery utilities may be not but for onyx boy, it's fun to benchmark things Uh, it it's kind of I played with that a lot and so some of these are just kind of fun Uh, because tuning and troubleshooting and figuring out the changes you made and if something was better So get out there play with all these utilities we mentioned. They're a lot of fun I'm actually going to this time Put them into the show notes. So they'll be into the uh description which will follow over to the show notes So we will have those in there for those of you that didn't hear some of the commands Or just want to cut copy and paste the commands and uh, you know have fun with them So thanks everyone for listening. Looking forward to seeing everyone next time. Thank you


Okay, continuing with our week of shell basics, working in the, in this case, Linux terminal, but this will work on a lot of other systems, not Windows, I mean, unless you have something like Sigwin installed, but basically what we've gone over this week, we'll work on like a Mac OS, BSD, as I mentioned, Linux, and a lot of systems, really pretty much anything but Windows should have some sort of shell in it. I mean, Windows does have its own thing, but it's different than everybody else because they just got to be that way. So, and I figure today we can actually write a script. You can use any text editor that you'd like make sure it's a text editor and not a word processor, like you don't have to be using LibreOffice or OpenOffice or Microsoft Word or something to write this out. You want to use something like gEdit or Kate, I believe is KDE's, but since we're working in the shell, you might as well edit in the shell. Normally I use Vim, V-I-M as my text editor of choice, but it might be a little advanced for some people. We're going to use Nano today, which is also a little more common on like stripped down systems. It tends to be there quite often, and if not, it should be available in many cases, but use whatever text editor you feel comfortable with. I'm just going to use, once again, it's called Nano, and then I'm going to give it the name I want to call it. I'll just call it My Script, and this isn't necessary, but .sh indicates that it is a shell script. That's just for the user. It doesn't affect how it works at all. Unlike a Windows system where the extension, what's after that last dot there, tells the system what type of file it is in Unix systems, that's pretty much for most parts for user knowledge, so I can quickly look at it and go, oh, that's a shell script, not necessary at all. I'll tell you what is necessary, is once we go in here, is the first line of the script is called the Shabang line, and it's pound exclamation mark, exclamation point, forward slash bin bash. It doesn't have to be bash unless you're using bash, which is going to be very common. You might see ones with other terminals on a very lightweight system. It might be SH, which is just a standard shell. Bash is born again, shell, it's another shell, and there's many out there. Basically what this is saying, because as far as the system is concerned, this is a text file. It's no different than a letter you write. It's no different than another scripting language like Python. This first line tells the system this is a shell script.  But let's say you're running in another shell like the SH shell, or Z shell, or TC shell, or TC, yeah. Anyway, there's a lot of, a lot of shells out there. If you don't put this there, and you try to run it, and your code isn't compatible with that shell, it's not going to work. But most systems have bash installed. It goes, okay, this is a bash script, use the bash interpreter, the bash environment. So very important, not extremely necessary in all cases, but important to put because it will cause headaches later down the road if you don't. So pound, exclamation mark, forward slash bin, forward slash bash, just saying to use bash interpreter. At this point, we just write out a list of commands. So let's go over the stuff we learned this week. Let's first off, I like to start off most of my scripts, if not all, by clearing the screen, makes your code look clean. Then we'll ask a question. I will say echo dash n. At this point, someone's going to ask me, oh, nano doesn't color code on my machine. I'm not going to get into that today. Some systems, depending on how you set up, it's in the config file, whether it color codes or not, you may not get colors like this in nano on your system unless it's set up to, in which case just Google color coding nano. So echo and color coding makes it a lot better for noticing mistakes in your code. So echo dash n, and I'll say what is your name going back to our first tutorial here. Actually, I'm not going to, I'm going to put the name on your line there. Unless I put it, it all depends on how you want it to look. I'm going to put the no new line. I'm going to say enter your name and then put a colon there with a space. That looks like, like it's wanting you to put it at the end of the line there. So clear the screen, print echo, enter your name. And then we're going to say read. Remember, this waits for a user input. And we'll create a variable called name. And that variable be whatever the user inputs. Then we will clear the screen again. And then we will echo out. Hello, name. And don't forget your dollar sign. That way it knows to use the variable and not just the word name. Hello name, echo. And what should we do next? We will say, oh, here we go. What is your favorite color? What is your favorite color? Question mark. And I like to capitalize random words. Don't ask me why. So what is your favorite color? And then here I'll say read. Now create a variable called color. And now I will echo out. Echo dollar sign color. And this is case sensitive. Don't put a capital C there if you did not put a capital C when you created the variable. So echo color is a good color. I also know there's different ways to spell color. That's how I spell it. And there's not a right way in a wrong way. There's just different ways to spell color before someone comments on that. I don't know if it's every live part of the world part of country, whatever, but echo color is a good color. So it's not going to say color is a good color. It's going to say whatever color the user inputted. Inputted input. Inputted. Yeah. So and then we will say echo. Now saving that info. And then we can say echo dollar sign name, name, favorite color is. And then we'll say dollar sign color. But we're not going to print that out to the screen. We're going to put that into a file called color dot log. And then we will clear the screen again. Well, I don't want to clear the screen at this point, because it will go so fast you won't see any of that stuff. So I will say actually I'll clear the screen up here. I just like to clear the screen because it keeps things looking fresh. So now we'll say echo data saved echo. Please always be nice. Say please press enter to continue. And then we'll just give it the read command without a variable. And it will just wait for the user to hit enter. And then we will clear the screen. And then we will say that's the end of our script. Well, maybe we should have some sort of exit message. Echo have a good day dollar sign name. And then we're going to hit control X to exit. Y to yes save. And it says you want to write to this file my script that sh enter. Now we have that all in that script. Now, there's two ways can run this. We can say bash. And then the name of the script. It's not the best way to do it, in my opinion. What you should do is change mod to make it executable. So change mod plus X, the name of your script. What that is doing is saying to the system, this is a script. And I as the user am giving this script permission to run. Because otherwise, it would not work. You try to run it and it just would not execute. It would give you an error message of some sort. But now that it's executable, we can run it by giving it since it's in the folder we're in, we're going to say dot forward slash dot slash my script. And when we hit enter, it starts. It says enter your name. My name is Chris. Enter. It says hello, Chris. What is your favorite color? I'll say blue. I actually really like black, but black is not really a color. So we'll say blue. We'll hit enter. It says blue is a good color. Now saving that info. Data saved, because it was just a little bit of data. It only took a fraction of a second. Please press enter to continue. We could also have wrote exit because that's the end of our script. It says have a good day, Chris. So and if we go back to a little review here, LS, you can see all the files in this folder. And there is one called color log. And if we cat that out, it says Chris, favorite color is blue. So let's go back into nano. I'm hitting up arrow to go through my history. And let's quickly review our shebang line. Very important saying this is a script and what type of script it is. It is a bash script. We're going to say clear the screen, echo. And don't put a new line at the end of this and then wait for the user input and then save that input as the variable name. Clear the screen. I did that last time too. Clear the screen and then echo. Hello, whatever the person inputted. Echo. What is your favorite color? Save the user input as the variable color. Clear the screen. Use the variable color is a good color. Now saving that info and then it's taking the variable of the name and the variable of the color, putting it in a sentence and appending it to this color log file. So if we run the script again, it will actually add it as a new line to the file. And I'll show you that here in a second. Then we have a few more messages. We're using the read command without a variable just to wait for the user to press enter. Clearing the screen, having an exit message. So real quick, control X to X add that if you're using nano. Once again, it's already executable. We made it executable with change mod so we don't have to do that again. But I'm going to say dot slash tab to auto complete here. And I'm going to hit enter to run it again. What's your name? I'll just say James. And this is hello James. What's your favorite color? And I'll say James's favorite color is red. I'll hit enter. It says red is a good color. Now saving that info at that point saves it data save. Please press enter to continue. And it says have a good day James. So now I can cat out our color log file. And since we appended by using the greater than greater than rather than just one gate greater than it will add it to our last line. So both lines should be in there now cat color dot log. We've got Chris favorite color is blue. James favorite color is red. Really probably should have a comma there or something or apostrophe s but you get the idea. So I hope you enjoyed this week of review on basics in the shell basics in the terminal. Once again I have plenty of tutorials if you want more go to my website. If you want me to do more on the basics of the terminal shell because I've been getting into a lot of more advanced stuff recently. If you want me to do a lot on basics I can go back and do more videos on basic stuff like this. The way you let me know.  You know that's the way voting you know all the videos in this series. If I get a lot of thumbs up people liking it I know that I should do more videos on the basics. If not I'll just continue doing more advanced stuff and you can watch the old lower quality basics that I've done. But I'd probably would like to do more tutorials on unwrap and cut and said and Ock which is more intermediate stuff I guess. But my old videos on that stuff is rather low quality but they're doable. So it's like should I redo them? Do you guys not care? Are the old ones good enough? Let me know by liking this video. Also if you enjoy this video if you're new to this be sure to check out my website filmsbychris.com that's Chris of the K. There's a link in the description of this video. And I have plenty of videos there. I've been doing this for a couple years now. I hope you enjoyed it. Please subscribe. I put out videos regularly. Check out this whole playlist of shell basics. There should be an annotation or something in the video description linking you to the entire playlist. And I just thank you for watching. I hope that you have a great day.


Thank you, Simon, for your presentation. Just to remind me that as a huge Spanish flex, it's a very unpleasant situation. And it also raised me that we have a lot of free-will challenges. Yes. It's part of the strategy of the party. It's kind of where we're able to not to serve the CEO of the board. We are also facing this kind of challenge. So my duty here is to discuss how can we avoid bad architecture, including wrong architecture through the pitfall. I'd like to make a step back and just present to you how do I see the, what is the national landscape for the national commercial education. And of course, coming from Brazil, I quote, you're packing a deep pack. And you remind our president, say, you'll be able to assume that the South is quite a different practice. It's a very large practice of artificial education in the South. But it's slightly different from what you have here. Well, what's the concept? The concept is that when the case arrives, there is a discussion between what's really happening in the case and, of course, the interpretation of the different sets of rules that interact with the facts. And of course, the contract, the usage practice, the applicable law for the merits, the situation rules of the sets of rules. Sometimes they are graveled with free-born, different applicable laws for different parts of the contract. The more components are, more difficult is to understand what the law is for the specific situation. So this is the body field. And what happens in practice?  So you have a good mess. And this happens in almost all the cases. And it's more complex in international education than in the West because, of course, you have the applicable law that sometimes is different from the case of the applicable practice for form. You have different uses that are applicable because you have local users, you have international users.  So, in principle, you have their trade with the lawyer, the parties, and the institution. They have all their different nationalities. And this means that they have different mindsets. So it's absolutely different, a case that is where the lawyers are from international, English or American law firms for case where you have French or Brazilian or Korean law firms working because the lawyer himself, they have their bias, their system of law, they wait for the war. Well, the way to proceed the case and to design the case for the arbitrators is different. You have also the different backgrounds of the arbitrators. You have arbitrators that are practitioners, arbitrators who are scholars. Although they don't have legal training. A lot of cases in construction, they have engineers working as arbitrators. In cases of financial agreements, not to come to have some of this from the industry. But more importantly, what you really have is different conceptions of arbitration, how to handle arbitration, how the tribunal interacts, how the parties shall behave when the case. So it's not important when we are in an international situation, it's not important. Sometimes it's very bad outcomes. And each of these players have a different mission. So of course, the arbitrators, the main mission is to conduct the proceeding with the official and the war, which means the efficient style of course effective, means flexibility to include the parties legitimate expectations. It also means to focus on the development, giving some kind of speed, some direction to the proceedings towards a final war, getting out of the slam of exchange of documents, discovery, written statements, hearings and so on. And with all this respecting the due process of law. But it's also the mission of the arbitrators to end a fair decision on the merits. I think most of the parties expect to have a fair decision. And then for doing that in the international commercial arbitration landscape, they have to understand and consider the different rules that may be applied. Contract the usages, the applicable law. And all of these will affect of course their reputation. The mission of the lawyers is a big difference. They want to win the case, no matter what. And that's very important because what we see in practice, not in the events, because in the events, most of the people start saying, well, what you'd like to have in the arbitration place, but in fact, in the concrete situations, you see very competitive and aggressive litigators working in arbitration. So there's not much room for courtesy. All the courtesy is only a rhetorical thing. What happens in the case, it's a shock and sometimes very aggressive. Presentation from the lawyers. And we see, why do you think we have the guidelines now for ethics part of the presentation for lawyers? It's because in fact, what we see a lot of times are witnesses that are lying, documents that are being changed, manufacturing evidence, challenging decisions by only two great time, requiring a number of expertise, not to take time, make confusion. So it's a one. So what is important to understand that the outcome of any international commercial depends a lot on the combination of these factors that we have just spoken about. If you have a tribunal, that is a criminal law from the only criminal law arbitrators. It's very different from a tribunal of a civil law background. So if you have English law firms working and you have civil law firms working, it's a different outcome. So it's very hard to say if arbitration is a very secure environment because the final decision will rely a lot on the combination of these aspects. How is the outcome of the case presented? Who are the arbitrators that are going to decide? How is the institution interfering in the case? So in this context, choosing wrong arbitrators might engender serious risk. And this is also one of the reasons that explain why you have a scope level for the case. Because when you are choosing an arbitrator and you see that the case complex, that the parties are going to be aggressive, you have to have someone that knows how to handle this situation. Not only a perspective of assuring that the due process of law will be observed, but also the course of the case. You do also understand the users of the case, the standard context, the practice of the context. There are not so many people like this. So if you want a case of, let's take an example of emanating transaction, are you going to choose a score or are you going to choose a practitioner? And if your case is more theoretical case, out of the contract, then you're going to a scholar, probably, not a practitioner. If you want to apply the contract, you're going to a practitioner. And how do you find information about who is going to decide what the measure is? And you don't have it in the neighbor. So that's why when you have experience with some kind of arbitrator, arbitrator's knowledge in arbitration culture, in arbitration usage, unknowns the merits of the case. This person creates a repetition that's going on and on and it's being applied again. And that's why it's also very hard for a person to go outside this clue. Because how can you have a case if you are applying it? It's always the most important case you should have. How can you stick to the fact, let's try someone new. You have never had a case in a certificate. It won't work. It's very hard for the client to accept. So of course, there are nuances in this. There are a different possibilities. But the road choices are this one. I choose arbitration because I know it very well. Because someone from my institution, because it's famous and because it's the worst case, because it's partial arbitrator. And this is very common. Let's choose someone because actually this person will advocate in my, in favor of my position in the tribunal. And arbitrators are not the smartest guy in the world.  So when they're in a tribunal and we see that a court arbitrator is slightly or explicitly partial, what happens? The other two, they close themselves and decide to run the case without the participation of the third law. That happens very frequently when you see this situation. So one experienced arbitrator knows that he cannot do that because this will also affect his reputation. In the next tribunal, the other arbitrator will say, that's not the point here because he's too partial. We cannot have this person in the tribunal. And there are people that just went through the arbitration career, arbitrated career, because of this. He started working one, two, three, four cases and then the reputation is so bad that no one wants to follow him anymore. And it's bad for the client because the other arbitrator will decide the case and all. And sometimes the case of this client, of this party, will not be heard, will be even more difficult to be heard because more arbitration is being so explicitly and favor of this party. So, and personal knowledge, I mean, it's not important. It's not really important because in Brazil we have a small community of arbitrators and lawyers that live in the case. We all have a lot of cases. I have, well, it's as many cases as arbitrary and 10 cases as council right now. And I'll probably have a back, back, about 300 case. But we never choose someone because we know this person. It's not important. The person will decide the case because he's convinced or not, persuaded or not of the case. So personal knowledge, if you think that someone is going to decide in your favor because he knows, he or she knows you, it's a wrong criteria. Someone from my jurisdiction, it's also a very wrong parameter because if I have a case, and that's happened very much and that people doing business like in Brazil and foreign companies, they say, okay, that's the point. I'm from the case, so let me upon a really sharp trade. But graphical law is Brazil law. And then there be trade, it's also outside the dialogue of what's going on because he or she doesn't know how the law interferes in the case. If you take a construction case for instance, you have a lot of public policy interfering in the case. You have an instrumented law, labor law, tax law, real estate law interfering in the case and it will affect the outcome of the case. And a foreign arbitrator, or someone that is not knowledgeable in the last applicable law, will not be able to have a war in this case. So we have to take care of this issue. Famous arbitrators, the problem of famous arbitrators is bad. The two famous ones. Sometimes they don't seem, they need the help of the lawyers to decide. So they decide all along on the aspect that they think it's the correct decision. And there are some literature about this, but now people are complaining and complaining because they're so experienced. But they say the best decision of this case is this one, regardless of the law, the contract, the usage, and so forth. That's my position. Since I'm so famous and so I'm so distributed, that's my view. And we have some challenges and we move on towards awards at the end because of this kind of situation. So we have to take care of it. The risk, of course, of choosing the wrong arbitrations are to have wrongful and fair decisions. Waste of time of money because the decisions can be challenged and decided on board. And of course, the loss of credibility, not only of the arbitrator, but most importantly, from the international commercial system. It's a system that is based in trust because the whole of our system. If you have wrongful decisions based not on the merits of the case but based on the applicable law and the contract, this kind of things, it will weaken the system, the whole system. So, I think the first, the most important argument for choosing arbitration is that each case requires good thinking about it. The French have an expression that is, not be charged for nothing, it means that the arbitration is only as good as the arbitrator is. So maybe if you have one decision to make, a correct decision to make during a case is to choose the right arbitration. But there is not one arbitrated that fits all the situations. For every case, you have to re-consider a lot of different criteria. One of these criteria is, what's the ground for your case? Are it your case based on the law, on the contract, in usage? And that's very important because, as I was telling you, if your case is based on the law, you might look for a score because there are some times it's very common that the law is different from the contract itself. Who prevents, what prevents the law or the contract? It's an issue to decide a case by case. You may say, come a lot of revisions, take the contract and see the law, you have to integrate both, but there are things that are public points. So we have case law, now in Brazil, of the case that concerns corruption because of the car wash operation. And the state, and the state-owned companies that are all arguing that the contract is moving towards. So it's a very theoretical decision and it's outside the contract, no matter what the contract says. So what kind of arbitration do you want? You have also to consider what's the other part of ground because when you're choosing an arbitrator, you have to think, who the other part is going to choose? Because they're going to interact and somehow you want the arbitrator that you are appointing because the belief that this person is more clean to understand or be expected will prevail, right? Police will be heard and have a word in the tribunal. But then you consider, well, the other part is going to choose a big shot. It's going to choose a foreign, a foreign arbitrator. And then you make your step also depending on the party you might be in. You have to consider if you have a strong case or a weakened case. Most likely you'll always have a mixed case because there are so many issues in a complex case that you're not going to be able to resolve. But you have to understand where exactly you want to make your point. So what's the right person that will perceive this point? So you also want to decide if you want to have a domestic or international approach in your case. And for instance, you have to have a case that's the law, the applicable law is New York law. But let's apply a Brazilian one. It's the opposite I had just said. You don't choose enough for someone that doesn't know the applicable law. But maybe that's your industry. I don't want to apply New York law. The substantive law of the conference is New York law. But I don't want to apply. The fact that the contract was performed in Brazil and have a lot of Brazilian issues interfering in the contract, that's the point of Brazilian lawyer or Brazilian scholar. So all this is a strategy, right? All this is a strategy. So that's why at this moment you have to decide and usually if you are the plaintiff, even before filing the request for arbitration, you are already thinking and discussing and sharing with the clients the names, the possibilities, the ways of the name of arbitration. And that's why it's a claim. I think that's the main reason why it's a claim. Not because we go to conferences, not because we publish articles. It's because the parties and the lawyers that this person has will understand your case and you'll be able to have a certain influence in the tribunal because there is no such a thing of totally independent and impartial of the court. In practice, what happens that the court what he or she tells that he brings the main arguments that the party who has a point of dispersion, to the knowledge and to the discussion, it doesn't mean that he will agree with the party who appoints a hero. But at least you bring this argument and we'll discuss. If you have someone that you think that we will agree with your point of view, this is the perfect attitude, it's independent. It's not connected with you, it has credibility. And you persuade them of your argument. So bring that voice inside the tribunal. That's the choice. And also it's the trend now in the national arbitration, also in the national arbitration, that the parties have a voice in choosing the chairman of the tribunal. It's not anymore as it used to be until five years ago that the two court arbitrators would solely decide who the chairman is. Right now, the court arbitrators, the parties, they discuss with the court arbitrators. And even there are leads that are presented to the parties. So the parties have a voice in deciding who the chairman is. And that's I think a very fair trend because in the end of the day, the chairman is the most important attitude because it can have decision two against one. And also the chairman is the one who lies, the one who is right in decisions, who handles a lot of documents, exchange decisions, a lot of decisions, interim decisions, really proceeding. So it's very fair that the parties can have a voice in who the court arbitrator is. Mauricio, I'll give you a couple, two minute one. A couple of minutes. Thank you. So the last availability of engagement there after the tribunal, I included engagement because all arbitrators say they are available. No matter if they have one case or if they have 100 cases, they all say we are available for your case. But the most important thing is the engagement because sometimes we are discussing from case to case, we have arbitrators or arbitrators who have one or two cases, they don't care. They don't participate, they have other things to do in life. They are scholars, they are writing or they are practitioners, they are billing hours and they don't care about the case. So the most important correctness you want is an engagement of the application to read everything and to participate in the tribunal. That's the most important goal. That was the point I wanted to do. Thank you very much. Thank you.


All right today's video we're gonna teach you a technique and that technique is something I should have spoken a long time ago about and that is the wild technique the wake induced lucid dreaming technique And I have mentioned this briefly in other videos But I don't really feel like I've been at the attention it deserves Because it is probably one of the most effective lucid dreaming techniques And it's the easiest way for beginners who don't really know a lot about lucid dreaming to be able to start On on a level that's comfortable for them and actually start controlling their dreams from scratch So If you don't already meditate, I'm not going to go into much detail to that But I would advise you to go to my website house on lucid.com and sort of read a few articles that I have about meditation on there Okay, so I'm just going to leave it like that for now So we're going to just get straight into it the waking juice lucid dreaming technique Is a technique in which you lay down ready to go to sleep and you You're going to let your body fall asleep while your mind stays awake And it's much easier said than done Okay, this is something I did struggle with a lot when I started out Because the temptation is for you to just let your mind go to sleep as well You just fall asleep and wake up in the morning and you're like, well, what happened? I was trying to have a lucid dream and I just fell asleep and of course, this is very annoying This is a common problem but with a little bit of practice and a little bit of Practicing the right thing. I believe you can you can master it. You can get it sorted out Okay, so the first step of waking juice lucid dream And before I go any further I'd just like to explain that a waking juice lucid dream can be done At the start of sleep when you're first going to to go to sleep or It can be combined with the wake back to bed technique Which is where you wake up two hours before you would normally wake up in the morning And you target your your deepest period of REM sleep rapid eye movement sleep It can be done at either time. Okay, it's easier to do this In the morning Just before you would normally wake up. So maybe say if you would normally wake up at seven do this at five I am okay So it's a bit of an early start But that's going to be the easiest time to do the waking juice lucid dream technique However, I'm just going to go over how to do the technique and then you can decide Whether you want to do it first thing as you try and go to sleep Which can work for some people or whether you want to do it Combined with the wake back to bed technique in the morning when it's most likely to to work Okay, but obviously as I said, this is different for everyone. So try both Try both maybe do two days of one and two days of another and keep automating until one of them works Okay, which it will because it's a it's a fairly common technique so step one lay down And go sort of get comfortable relax all of your muscles And try not to focus on anything in particular Um, if you've never meditated, this will be quite difficult because you'll be laying there and your mind will be racing You'll be thinking about all sorts of things and the most common thing is you'll be thinking Am I lucid dreaming yet? Okay, you'll be concentrating on what you're trying to do, which is natural Okay, it's it's normal However, in order for this to work, you need to actually relax beyond that. You need to literally not have anything on your mind Uh, or or at least get to the point where things are coming to you coming to your attention But you're not focusing on them. You're more letting them drift over you So it's like you'll be you're aware of the thoughts, but you're not interacting with them internally Okay, and this is obviously much easier if you meditate because that's what meditation is about It's about detaching from those thoughts and being aware of them But not actually interacting with them or giving them emotional attention so Step one as I said relax Relax all of your muscles. You can you can do this whichever way is most comfortable for you Okay, some people will start at their head and they'll sort of focus on each body part going down to their toes and relax each part individually And this is I think this is known as sweeping sweeping relaxation And something like that. There's lots of different names for it. Some people will sort of sink into their bed and just relax everything at the same time Okay, this is a technique I like to use because I find it works faster for me, but everyone's different So as I said try try it out see which one works for you And yeah, other people like to listen to sort of audio tracks you can get by neural beats Um, I'm sure you've heard me talk about those before and they can help you relax as well There are all sorts of ways to help with this step. Okay, you can get incense in your room You can get lavender spray for your pillow. You can get all sorts of things a memory foam mattress helps Um blackout curtains will help you as well If there's lots of light for example from street lights and stuff outside blackout curtains will help with this Um, but the basic step is here just to find the most comfortable way for you To relax all of your muscles and try not to think or focus on anything in particular at this point. Okay, step two Stay in step one for about 10 minutes or 20 minutes It varies from person to person depending on you know, what you've done that day How tired you are your natural, um hormone levels in terms of your wake up and your go to sleep hormones Um, but step two is just about staying in that state for 10 to 20 minutes. Okay So you don't need to set a timer. You don't need to be um focusing on on it in any way But i'm i'm just explaining step two because then you know sort of what's happening Step two is that you stay in that state for 10 to 20 minutes The way the way you'll know that you've done that is that you'll start to see what's going to happen in step three Which is uh sleep hypnagogia. I think i've pronounced that right and that's where um images shapes colors lines Whatever will start to flash in front of your eyes Uh, sort of on the back of your eyelids and they won't be at first. They won't be distinct specific things It will more be sort of like the uh the feeling of a shape and I know that sounds weird to hear um, but it will be more sort of just about the um the idea of a a particular place or a shape uh patterns And these these sort of things will flash on your eyelids and at this point It's important to let them wash over you if you try and focus on them That's going to keep you your body awake and you're not really going to be able to do it as fast as you could Um, so just let the images and shapes sort of wash over you And after a while you'll notice that you've completely detached from your body You're no longer aware of your body and the feeling of your body in the bed Or either that or you will be aware of Sort of like a heavy weight pressing down on your body or like Some people describe it as like a lead blanket being slowly rolled up from your feet to your head Um, and this is the start of sleep paralysis, and I'm sure you've heard of sleep paralysis There's all sorts of stories about that. I've mentioned it a few times on my videos before Sleep paralysis is completely normal And it's what happens normally to everyone every night.  Don't worry about those. Okay, they can seem a bit unusual Especially if it's your first time. Just don't worry about those. Ignore those And if you do have to think about them at all, just think you're on the right track to becoming lucid. Okay, it's it's a It's a good thing because it means you're doing the right thing. It means you're starting to become lucid and enter a dream Okay, so don't focus on them too much These things will happen and then after about 10 minutes after that You will start to be able to think about entering the dream And the way you're going to do this is you're going to focus on the feeling Of the dream So instead of trying to tangibly reach out and grab something that you see Like I said, you'll be seeing shapes and patterns at this point Instead of trying to reach out and tangibly grab something Really try and just let the dream form around you Okay, and this is easier. Again, if you practice meditation, I know I keep going on about it Um, but just sort of let the dream form around you and so Maybe focus on something in the distance and then sort of Try and see things in your peripheral vision And this is something you can practice in waking life as well If you look at something right in the in the very distance, okay focus on that And then try and notice things around that using your peripheral vision And this will help you in the lucid dream because your peripheral vision is Going to be sort of what's constructing the dream around you And at this point it is very important To not panic and just relax because if you if you try and focus on something or if you get emotionally attached or think Oh, I can I can see something over there. I'm going to run and try and interact with that The dream is very fragile at this stage When the dream is forming you're you're in that very delicate fragile state between being awake You know being in your bed aware of yourself laying there and seeing these shapes and being in the dream So it's important that in this transitionaries Transitionary stage. I think I said the right You are not going to be too emotionally engaged with what's going on because you'll collapse the dream and you'll wake up And this is very annoying. This has happened to me a lot of times So you want to Be relaxed let the dream form around you and then Naturally after a minute or so you will be in the dream and you will find that you've gone completely You've gone to a completely lucid state from a waking state and hence the name waking juice lucid dream It's a solid transition from wake from being awake to being awake in your mind But in the dream So I hope this is sort of cleared up how to do a waking juice lucid dream for someone do you? um As I said, you can decide when to do this this video has gone on for over 10 minutes I'm going to sort of cut this short here But yeah, you can decide to do this either as you first go to sleep Or in the morning two hours before you would normally wake up when it's most likely because this is targeting your REM sleep Which as I said before it's the most likely time for a lucid dream an ove that's one thing So let me know how you get on leave a comment in the script in the um Saying it again now leave a comment in the uh comment section Uh go and subscribe to my website howtolucid.com And obviously subscribe to this youtube channel if you want more see you in the next video