Hello everyone. Welcome back to our channel. I hope you all are safe and sound. Most of you must have played games on Xbox using game pads, joysticks and whatnot. How about making a game that you can control using your fingertips? Sounds pretty cool, right? In this video, we will show you how to make a gesture-controlled space battle game which you can control using the tip of your fingers. Pre-requisites are a laptop or a computer with good internet, a camera and the latest version of Pictoblox downloaded. Let's begin by adding the human body detection extension. Open Pictoblox. First, select evive as board. To use the extensions of artificial intelligence and machine learning, you need to sign into Pictoblox. Make sure your computer is connected to the internet while working with these extensions. Select human body detection extension and wait for a little while till the models get loaded. First, let's set the stage. Since the battle is going to take place in space, we need a backdrop that looks like outer space. Click on the choose a backdrop button and select the stars backdrop from the library. Time to bring in the characters aka the sprite. Right click on Toby's icon and select delete from the drop-down menu. Now click on the choose a sprite button to open the library. For our game, we need three sprites, the enemy that is the space monsters, a rocket ship and our special monster killing bullets. Add them one by one from the library. Let's first write the script for our rocket ship. Select it from the sprite palette. Now drag and drop the when flag clicked hat block in the scripting area. Adjust the rocket size to 40% of the original size using the set size to block from the looks palette. Then drag and drop the go to XY block from the motion palette. Set X as 0 and Y as minus 140. These coordinates will be a rocket ship's initial position. Now let's add some sound to the game. Add the start sound block from the sound palette. Then click on the sound tab. Click on choose a sound button, then select video game one sound file from the library. Come back to the scripting area by clicking on the code tab and from the drop-down of the start sound block, choose video game one block. Now we need to create two variables. One to monitor the health of our rocket ship and the other to keep track of how many enemies we have killed. Go to the variables palette and create variables health and score. Set the initial value of health to 3 and score to 0 using the set variable to block from the variables palette. Drag and drop the turn on video on stage with 100% transparency block from the human body detection palette. Then drag and drop the forever block from the control palette. Next place the analyze image of hand from the camera block into the forever block. Now we need to make the rocket follow the tip of the index finger. Thus drag and drop the set X to block from the motion palette. Place the position of fingers inside the set X to block. Choose X from the first drop-down, top from the second and index finger from the third drop-down. Next drag and drop the if block. Now place the iski pressed block from the sensing palette and select space from the drop-down. For generating multiple bullets we are going to use the create clone of block. Drag and drop it inside the third if block and select bullet from its drop-down. Finally add a weight block and set the time to 0.1 seconds. No battle game is incomplete without an enemy. So let's bring in the monsters. Click on the monster sprite from the sprite palette. We are going to write two scripts for the monsters. One for creating monster clones and the other for assigning actions to them. First let's write the script for creating the clones. Drag and drop the when flag clicked hat block. Next drag and drop the forever block. Inside the forever block drag and drop the next costume block. Then add the create clone of block to create clones of the monsters sprite. Add the weight block and set the time as 2 seconds. This will make sure that each clone appears 2 seconds after the previous one. Now that the monsters are here it's time to assign actions to them. From the control palette drag and drop the when I start as a clone block. This block will make the script run every time a clone of the monster sprite is created. Now drag and drop the show block from the looks palette. Next drag and drop the go to XY block from the motion palette. Now place the pick random block from the operator's palette into this space next to X and set the range as minus 200 to 200. Set Y as 180. Now drag and drop the repeat until block. Place the greater than operator block and write minus 170 in the first space. Drag and drop the Y position reporter block from the motion palette into the second space. Next drag and drop the change Y by block from the motion palette and write minus 3 in the space. This will make the monster gradually move downwards until either it reaches the bottom of the stage or you shoot them down. Now drag and drop the if block. Place the touching block from the sensing palette into the hexagonal space and select the bullet from the drop down. As soon as the monster is hit by the bullet the score should increase. For that drag and drop the change my variable by block and select the score variable from the drop down and set it to 1. Now let's add a sound for when a bullet hits a monster to make it more lively. Drag and drop the start sound block add the zoop sound from the sound library and select it from the drop down. The monster should disappear once hit by a bullet. Drag and drop the delete this clone block for the same. Now let's write the part which decides what happened if the monster attacks a rocket ship. Duplicate this if block and place the second block below the first one. From the drop down of the touching block in the second if block select the rocket ship. Then select health from the drop down of the change my variable by block. Write minus 1 in the space. Remove the start sound block. This part of the script makes sure that if a monster touches a rocket ship its health will decrease by one. After that the monster will disappear. Now the game should end as soon as the health goes down to zero. For that again duplicate the if block. Replace the touching block with the equal to block from the operator's palette. Next drag and drop the health variable block into the first space and write zero in the second. Drag and drop the wait block and set the time as 0.5 seconds. Now we need to turn the camera off once the game is over. Thus place the turn video on stage with zero person transparency block below it. To stop the game drag and drop the stop block and select all from the menu. At the end of the repeat until block place the delete this clone block. Now let's write the script for our monster killing bullets. First of all select the bullet sprite. Then drag and drop the when I start as a clone block. Place the start sound block and add the laser to sound from the library. Next drag and drop the go to xy block. Drag the off reporter block in the space beside x from the sensing palette. Select x position from the first drop down and rocket ship from the second. Now duplicate this block and drop it into the second space. Select the y position from the first drop down. Now drag and drop the repeat until block. Place the or block into the hexagonal space of the repeat until block. Next place the touching block into the first space of the or block and select edge from the menu. Select monster from the drop down. Now the bullet should move upward until it either hits any of the monsters or reaches the top of the stage. For this drag and drop the change y by block and write 12 in the space. Then drag and drop the delete clone block below the repeat until block. With this the code is complete. You can try to control the game using your nose and share it with us in our picture blocks community on facebook. Also if you like this video give it a thumbs up and don't forget to subscribe to stempedia and follow us on facebook instagram and twitter.


Hello can you change your YouTube channel name just by using your iPad? If you want to change your YouTube channel name by using your cell phone and iPhone or an Android mobile phone I've got you covered completely. There's a link on screen and in the description where I walk you through the entire process but I got lots of comments asking me how can I do this specifically on an iPad.  I'm sharing lots of walkthroughs on running a YouTube channel because I'm a beginner just like you so you can avoid all of my mistakes and all of my obstacles. Now you and me are going to get through this quickly I promise but I'll also cover a couple of problems at the end of the video. Sometimes this doesn't work or some of the steps might not actually appear on your particular situation. Let's put the iPad up on the screen now and this is my YouTube app on my iPad and the very first important thing that we're going to do is to check that you're logged into the right YouTube account to change.  So make sure you've got the correct channel showing and then we're going to hit your channel. I've got two not one but two of my smiling gurning faces there. There are two buttons along here there's edit channel and manage videos so we're going to hit edit channel and it brings up the channel settings for my YouTube channel and this is this is called type word dad. I think this is quite a negative name it was deliberate but I've had a change of heart and I want to change my YouTube channel name. You've actually got three options here at the top you can change the banner or your profile photo. At the bottom you can change the channel description and sandwich between the two is is the channel name. So we're going to click on the pen icon on the right hand side here. It's quite easy to miss and this is where we can edit the channel names. Now if yours doesn't look like this just keep watching because I've got some fixes for you but I'm going to rename this channel dad delivers in capitals and then I'm going to hit the tick in the top right hand corner. There we go the channel name has been changed. Now there's a very high chance that your YouTube app doesn't look like this it actually presents you with a first name and a last name. If you want the single box like this where you can name your channel with one name or maybe a phrase anything up to 50 characters then that means that your YouTube accounts needs to be moved to a Google brand account and you're in luck because I've made a complete step-by-step walkthrough on this video here it's on screen now and the link is in the description and you want to watch this video from about two minutes fifty seconds in. I show you the entire process of moving your personal YouTube channel that's linked to your Google account and move it over to a brand account and on screen now is a link straight to that video where I walk you through the entire process of changing your channel name to be a brand account. I hope this works out well for you.


Ladies and gentlemen Salam back welcome back to another fix your form video where I take your form Try to clean it up try to guys make hope you become better lifters if you want to get involved We need three reps 70% of your one rep max filmed horizontal sent to ask my kke at Gmail that calm check it out my man right here Setups a little bit funky. It looks like your back's gonna be in a real real bad place But you get it into an okay spot at that starting position What I'd like to see is your hips a little bit higher shins a hair more vertical and keep pushing yourself behind the bar Shoulders are just a little bit in front of the bar What it'll allow you to do is one flatten that back out But two it'll keep that back flat even at lockout What we want is to remain in a solid position from start to finish and although your starting position It's pretty dang good your back gets a little curly when the bar gets just off of the ground And then what you're gonna have to do is unravel that weight and the heavier it gets again If our hips aren't in the proper position We won't be able to push our hips through and lock out cleanly and it'll end up being a grind every single time So good position there you get it off the ground that back takes the first Portion of that weight to get it off and it loses position So what we want is hips a little bit higher back a little bit flatter And we want full tension through our arms and our low back at the beginning pushing your hips backwards to the walls behind you Not downwards when people say hips down or hips back what we want is not hips down We want hips of backwards like this man right here He wants to push his hips a back towards that guy on the bicycle or whatever the heck. He's doing elliptical a Little bit of sumo deadlifts pretty decent again right off the ground Many of us are having issues here with finding tension You can see you try to get into position, but there's still still some looseness from the bar to your arms What we want to do is pull out that entire slack So we want full tension in our arms at our low back right here you drop your hips But there's not tension in those arms So when you pull off the ground all the load goes to your mid to low back and then we have to unravel ourselves later What I'd rather have you do is keep pulling see it goes from zero to a hundred What we want to do is get a little bit acceleration going we want to slowly Get some tension to that body and don't think about jerking on that bar no more jerking boys and girls not in the gym No more no less. We've done this too many times for too many years. No more jerking in the gym So what you do there is again not those hips down You want those hips high and then you want to sit back pull yourself back while pulling your shoulders up Getting some heavy weight into your hands.  I don't know what's going on. Maybe it's maybe it's hot and sweaty in the gym I wouldn't suggest that it'll probably make the bar even slipperier. I don't know what's going on Maybe he's just a germaphobe in that case props to you man. It might be dirty in there I do agree maybe some hand sanitizer instead of a towel, but what am I? I'm no I'm no toxicologist. I'm no doctor. I'm no virus specialist Take a little bit while to set here. Maybe overthinking a little bit We want to be able to do again hips are a little bit too low Similar to our first guy issues are we're trying to curl our hips under us to get them to the bar But what we want to do is flatten that back out. So let's drop that chin stop looking at the mirror We want those hips a little bit higher and really flat back the tension on this pulls a little bit better You're not jerking on it as much as the other two But our backs in a little funkier position So again flatter back breathing embracing in our stomachs one Gonna allow us to lock out efficiently because we'll be able to use our glutes and hands just to push our hips forward to it Allows us to stay Healthier and more efficient long-term so we can handle more volume and overall getting stronger right the more sets reps and weight We can handle in training and staying safe over the long term months six months years The stronger will be able to get and the more muscle will be able to build So that's obviously the keys here for technique It's not only just to lift the most amount of weight or look the prettiest or not only just to not get Injured, but it's a combination of all of them once you have good technique You're more efficient with the lift the most efficient lift allows you to lift the most amount of weight and stay the safest It's a super convenient on our part. We hit all three birds with one stone.  You're just gonna end up flattening your back But what you're trying to do is squat the weight up and that low back doesn't have the range To stay flat in that position. So right from beginning see right there before you release right there Is where you should keep your hips flatten that back out lock in your lats neck down a little bit Stop cranking on that poor little neck of yours, buddy Another thing I'll try to do for everybody. This is just as general cue Stop looking at a mirror get some flatter shoes If you're looking at a mirror and your powerlifting or getting real strength training in stop doing it And if you're not squatting and deadlifting and flat shoes Don't do it get some flatter shoes. I like the dungeon vibe here It looks like a gasoline tank in the background a little bit of Agua my man's getting after it.  The most efficient is a straight line from a to b So what you could try to do is move that stance in a little bit more narrow That might change it just on its own or to have those hips a little bit higher my man Overall looks really really solid backs in a good spot next in a good spot Overall starting position is still you know, maybe a 8 out of 10 But let's make that a 10 out of 10 flatter shoes hips a little bit higher keep breathing a brace and figuring out My man here got some heavy ass weight. We got some sumo going Looking pretty efficient actually looking pretty efficient actually Right now from this view, I don't know if there's much I would change to be honest Looks like he's just repping out 500 pounds like it's nobody's business That last set looks like you just got a little bit tired a little bit lazy Make sure to lock those lats in but on all the other ones it looks really solid So some of the main differences You know person-to-person are gonna be torso length arm length and leg length on how your dead looks gonna look But overall rules of how we set up for the deadlift are always going to be the same They're just gonna visually look different right we want our hips a little bit lower in our shoulders We really want to breathe embrace our midsection into our belt flex our lats as much as we can with the sumo Typically we want our shins a little bit more vertical with the conventional our knees can travel forward a little bit get some quad off the ground Shoulders gonna be just on top of the bar We're gonna get a lot of tension through our system all the slack out of our back Tension into our hamstrings slack out of our arms and then we're gonna begin to pull and my man does that really really good Except for that very last rep you can tell he probably just got fatigued Shoulders came forward a little bit rather than flexing those lats And it looks like he jerks a little bit and under maximal loads or under fatigue That's gonna end up either being a misrep or perhaps a little tweak So just make sure you're consistent there my man really good good really good reps really good sumo We got a bright light in the background another here's a instagrammer clip for you instagrammer Behind-the-scenes tip if you want to do better videos always put the camera From the direction lights coming So right now my man would film from the opposite direction and everything would look a little bit cleaner But look I'm no I'm no I'm no model. I'm no I'm no Fitzboe. I just aspire to be I just aspire to be if you know what I'm saying Everybody again. Thanks for visiting this channel. We got a couple more forms We're gonna get after but right now if you're enjoying this type of video be sure to give it a thumbs up Be sure to subscribe turn on notifications new videos every Tuesday Wednesday Thursday Saturday Sunday My man right here everything from what I can see even though it's a little bit blurry off the side It looks pretty dang solid backs in a pretty damn good position next a little funky There might be a mirror there, which is remember guys rule number one everybody no mirrors rule number two everybody flatter shoes So what I'll try to do is drop that chin and drop that eye line just a little bit That's just gonna keep you a little bit more comfortable position I'll allow you to not strain those traps and neck so much as well as often what we do with our neck No, we're not gonna go to snap city and your heads are gonna fall off But often what we do with our neck Translates to how flat or not flat our back will be and also the positioning of our hips It's just a little bit of a cue It's a visual cue and sometimes if your next being a little wonky your hips will be a little wonky and right here Your hips are just a hair off. You can see a little bit of rounding in that low low back And I think if you fix that neck position your back will naturally get in that The more erect tight midline that we're looking for so again breathing embracing neck down But otherwise my man, it looks really really solid can't tell the weight here and again if you filmed into the light a little bit I might be able to check a little bit more Some of the angles if you guys want to send in directly from the side is best and then directly from the front those two positions typically will allow a coach or An expert to give you the best feedback something like this. I just can't see where your shins are to the bar From the grounds a little bit hard to but if you could do it straight from the front You can also see the symmetry and how things look and directly on the bar boat up. Okay, we went a little heavier here Yeah, man, the lights a little bit better in this one. You can see the forms pretty dang good, dude I think your hips maybe just a hair higher right there You can see you drop them low But the bar doesn't begin moving until they get into position they want and that's naturally gonna happen for everybody Just because it leverages the bar won't move until your hips are in the proper place So might as well Let's practice on putting our hips in the proper place and then two men you're just really stranded on that neck I honestly think it'll fix that hip problem talking about so drop that chin a little bit work on the film and skills to get more likes on Instagram because we all know That's what's gonna pave the way for success likes on Instagram Can I get an amen in the comments below? Can I get a Mike preach in the comments below? Can I get a Mike you so right in the comments below? Another conventional poll a lot of conventional polls today appreciate again everybody sent it in to ask mikke At gmail.com it is appreciated. Let's see what we got my man's right here locked in those lats locked in the back Really really solid pull you see the hips may appear a little bit high But they're still below the shoulders and allows him to keep that back flat one thing Oh, that's the rep right there. He rocked a little bit back extra there That's exactly what I was gonna say if you could push those hips back and not down still get those shoulders a little bit Over the bar a little bit better for my man here I would recommend chin up just a little bit It'll allow you to perhaps get a little bit more upright and allow you to just be balanced a little bit more So keep on breathing embracing that back keep on working on flexing those lats harder and harder appreciate you guys Solid Mike. I'll catch you in the next video. We're out of here again Tuesday Wednesday Thursday Saturday Sunday new videos and twitching at least five to seven days a week Info in the description below catch you guys in the next one


Ethical behavior, to me, represents the totality of your conduct, how you operate when people are not watching you. Ethical behavior to me means doing the right thing all the time, even when no one's looking. It's making the right decision about even the smallest thing related to the work that you're doing every day, either in the field or in the office or as you go about the city serving our customers. Ethical behavior means being a stand-up person in your job, being committed to your job to do the right thing, and knowing that even if somebody doesn't hold you to any kind of a standard, you're still going to do the right thing, and do the right thing for the city as well. Treating everybody equally and fairly. To me, ethical behavior is doing the right thing for the right reasons, whether anybody's watching you or not. Ethical behavior is honesty, fairness, being diverse. Making sure that I meet the public trust and making sure that I do the right thing for the public good. Doing the right thing no matter what, even when no one's looking. When we're dealing with our customers, our citizen customers, it's so important that we be ethical and honest in everything we do. To be ethical is to be honest and to actually do your best.


Alrighty, let's watch this here. This is probably for polish and final. It's really nice. I really like the Double check something as we're doing this a nice clean silhouette I can nice break through the leg. So it's not either clear or a tangent. It's a nice Nice move. I think I would have that foot angled a bit like this for polish So imagine that leg is here and here you might even Like slightly over than tilt instead of being parallel to the ground a bit more like that So it's more line with the shin But the main thing I'm looking at is Because if you look at the whole thing here, it's not extremely cartoony in terms of snappy timing. It's fairly Naturalistic in a way. So what I'm looking at is Even that has a slight it's pretty harsh in how it goes down to like a knee bend pop That could be potentially a bit more ease in but it's not crazy because it has a nice energy of two wits go But the main thing I'm looking at Besides yeah, I'm skipping through things and then I see stuff like it's like we're going for a bend into a straight leg But then you have that Knee going into the right back out to the left left back to the right and then over this in real time that left side Has a bit of a wobble. I think we could polish out into a nicer line for spacing And I wonder if here you can instead of landing flat we would land so you already have the foot down with a slight toe first To a toe bend and that will give you a bit of a cleaner sort of a pop bend here a nicer smooth bend into this It's a bit foot down for wolf into that But again, the main thing looking at is the amount of time We end up here to give this leg Time to push forward stays a bit has a full Move out. Maybe it's what I'm looking at is how quickly this foot Goes forward and then to that. It's a nice pose. I'll do like that. I just wonder Again, watch out that knee for instance goes to the left left bang to the right and then to the left again Just kind of visually has a bit of a beep beep bit of a jitter But I wonder if you would go here here here and on that frame It would be it would have to be fairly rolled. I don't want to break that foot and ankle look and everything but imagine it would be It'd be much much more Straight out here kind of trailing off where we were and in that way you get another frame Visual of a full extension for the push-off and then you can go into the bends. I Think a frame a frame wouldn't make the forward move too poppy But it will give us one more frame of extension to believe the strength of the leg and muscle to go forward That's the only thing watching for the first time. It felt like That's a soft change of direction. I'm not super buying it She's not like Pushing or landing here and at this point Like this Where where the weight over the foot is already so far that it's not just the leg Moving it forward, but she's already so forward that now it's also this leg in a way. I hope that makes sense It's a very picky picky thing here. The other thing is the tail and that arm are a bit in sync through here I would I would offset that a little bit more. I think it should pick okay here I was wondering on that drop boom as that route stops moving Was it's fairly a one-frame direction change if you look at it's one is getting here Look at that line.  I think that could have if you keep this I would almost have this arm Let's go fancy here. Whatever. I know This arm Right down down and that's that's when the root goes back up. It's such a change of direction That then that arm Has a bit of a lower Angle and then comes back up and then meets this Meaning that because the route change direction so quickly it has a bit of a an influence on that arm But if a shoot down and drag up into that or You give this route one more frame We're down here again. This is probably from the red not the best We're down here down here And I don't try maybe flattening or one below and then you can Shoot up and then match here Again because the overall from the moment you start moving It's fairly naturalistic, especially with this this bounce back here the timing of this Gives it a specific realm where this is going to live to some degree. You know, it's kind of break it but because of that This only feels a bit weightless Just that will bounce and really again. I'm talking about one frame the only thing with this From here to here. I wish those arms Be in a different pose. It has a slight feeling of we're hitting this pose And then we have that and then we have that And then it's kind of okay, just I know it's only three times where there's a slight repetitiveness in the posing of the arms where she goes And it's almost Because things flow nicely on threes you could easily have this Maybe she doesn't go well Say not as high, but maybe it should be as happy because this is the big push-off here but then this would be You know either breaking the silhouette a bit more with even the higher or just a bit lower and then this one Might already open arms and be a bit high against a little bit of a contrast And even if it's just in height or extension where instead of bent so much Maybe spent less and we're ending all more and was like that. It's a slight repetitiveness here Even your bounces but feel kind of the same. It's almost like she goes into cycle cycle cycle and go That's the only thing I would say for policy There is here something to give us a bit more Contrast I think you probably okay here terms of how low we go for push-off I could potentially try a good couple That's the but maybe this low just a little bit more of a Because it is quite a jump and maybe a bit more of a squash is patient into into that And by that extension when she jumps Have those arms a bit lower Because as you jump fast it's gonna drag those arms a bit more and then that way they have a bigger contrast to go from bit lower Out into this Might be nice I would probably cheat that arm further away from her even if it starts breaking So we are a bit more why the arms because you're starting to get it really for short and short arm And I know she starts to turn But I think we can keep that a bit longer And then she goes into that Now you want to keep this a light nice bouncy feel But this I would now she can't use Anita. I'm just gonna say lower I don't know if you can go slightly lower and then out of this rake has like a knee move up. I can't remember Shout together read with that rake. So you go lower, but then just pull that knee pull vector up So it's not intersecting feels like it's a bit bigger compression that again It gives it a lightness that I feel like you could give this a bit more weight By compressing a tiny bit more Her shoulders at this point would be higher. They feel low I will bring those shoulders up to not up to the ears obviously They're too high, but really just more of a drag even this feels like we can bring up those shoulders I don't even know if they're pulled up that much. So really high high high on the shoulders Even though she is bringing her arm down Still shoulder up shoulder ups arms would be higher and maybe even a bit straighter here You can bring up those ears. I don't see I don't see too much in those Ears a bit of a soft as potentially the ears or a flick or something But then the reason I was saying all this so that when you have Stronger compression with the root down then through these frames You would also bring the shoulders down neck a bit forward ears a bit down Just the lighter parts would Compress over a couple frames and I would cheat this foot more into profile With this knees out there the foot is towards us and they seem a bit similar so for contrast It's nice, but also so they're not break things because I know you have to probably have to cheat that knee out because of How low we are so lowering that roots probably causing more problems, but maybe we can cheat it just a bit So yeah, how nice a compression there And even that tail Could then shoot lower Bit sooner And watch out It's like we're extending that knee back And then back forward again. So watch out at real time has this just a bit of a stretch pop It's not super extended, but a bit of a pop there and then her finger poses like through even here she could Land and then spread out the fingers a bit more almost there dragging a bit not sausage fingers back But a bit of a wider thing As in like rolled back and bit of a spread so that when she goes in here we can start Putting them in a fist again for contrast. I seem like they're just stuck in a default pose both of them in The fist in a fist in a fist and then you can bring them out again with a nicer Grouping and just a nicer pose where they just seem to at least here the same rolled up But they seem a bit too default even through here. It was like a default curl for all of these these could have some more appealing Hand poses carefully a bit of a tangent right there on that chin. I will bring the arm a bit lower And especially through here as she's done that could be a nice pose and then as she starts transitioning Bit of a change especially in this hands and the fingers This is there's nothing happening at least there's something happening here I would just not have all fingers curled the same amount and start at the same time And then during that transition have a slight change again This is stuck in the same pose and then we're back into this which is cute Unless it like that a nice little flick here, you know, so do you have stuff in there? So it's kind of just for looseness and if it's too much You know, it's kind of back off of it But just some changes for the loosens on the ears of compression or something like that even if she wants to You want to make a bigger deal where she actually curls in her ears It will be fast, but it will have some little nice detail in there and then she comes out Maybe they didn't come out again You have it here a bit But again, I would offset these so they're not being at the same time So slight changes even through there. You have a little wiggle there, which is cute I don't know if you can rotate them and why It's a bit more life in them I think that's kind of that As she goes up and down here, you know framing through things since she's asking for polish I'm looking at how much weight is now being transferred onto that leg Both legs push off a bit more here. Bam really compressing here All that weight is there But if I look at this line of her shorts and a t-shirt There's nothing changing and you would think that she goes up and you can even exaggerate and instead of I mean I know this will wait here But exaggerate and actually bring this side of the hip up and then bomb on this it does that right goes from here to here And a little bit of as you go down a little bit of a change in the hips Maybe that's what you're doing But you can't see it because the way this is rigged and on the low But I would love for see a lot of love to see this line here Change from this to this because there is a rotation in the hips that needs to be happening through all of this here And again a little offset of fingers and all that good stuff All right, that is that. Thank you All right, there's an email you can sign up you can start whenever you want you can submit whatever you want You get 16 submissions either way a like and subscribe would be awesome. All right. Thank you


Okay, so this talk is about Linux kernel code reviews and as an introduction, this is a talk that I gave, actually it was a formal Intel university class that I taught at Intel last August, actually. And it's from the perspective of a vendor tree provider. So for the past, oh jeez, it feels like 20 years, but for the past seven years or so I've been working in the Android space providing on the Linux kernel for Android at Intel since about 2009 or 2010. And so this is based on my experience from doing that. So I just kind of kept it in a course lecture format just because I thought it would be easiest for me. So I'm just going to review the goals of the course and we're going to talk, and there will be just a handful of fairly lame or tame examples coming from this GitHub tree, which is really, what this is, is this is a rebase of an Android things kernel that from a 4.4 kernel to a 4.9 kernel and I'm trying to get mature to be a base for, sure enough to feed actually the YAKTA meta Intel layer. And when I first thought about doing this course, I thought it would be hilarious to basically throw up a lot of examples and talk smack about the patches. But then as I got time went on, I started thinking more, he's like, yeah, I don't know if I really want to be shown internal code. And I'm pretty sure I don't want to take code from other vendors and embarrass people too much. So I decided just to, you know, so the examples aren't as expressive as the examples I have for the internal class. And that's just the way it is. So I will describe some patches as we go as well. If you have a burning question, go ahead and interrupt me. But otherwise, I just kind of want to go through the class, go through the lecture and then take questions at the end. So the goals of this class, so basically by the end of the class, I really want people to kind of understand what code reviews are expected to look for as you, oh, I also want to back up just one little bit. This is, I want to make clear that these code review practices are important for people working on non-upstream code. So this would be like a Linux stable tree or a tree that isn't tracking upstream. So a number of the things don't make sense when applied to upstream development. So keep that in mind. So by the end of the class, you'll understand what the code reviews are expected to look at when they're looking at your code. And hopefully you'll get a little bit better appreciation of what's expected from your code during a review. You'll also hopefully understand the mindset of customers a little better. You'll understand the utility of having a good prefix discipline. You'll be able to identify a problem with a patch that needs to be fixed and you'll be able to explain what the issue is with the patch. So I left this in here just as a reference because I believe that everybody working on any kernel code should read these two files, the submitting patches and coding style about twice a year. So they're here for your reference so you can refresh your memories. So what do customers think of you and your code? Well, customers actually don't trust you and they don't trust your code. They do not want to see changes after beta releases other than bug fixes they care about explicitly. They scrub every change in detail that you provide as you provide your kernel. And as work progresses, you give them an initial release and they start working on it themselves and you keep working on it and as you provide releases later and later in the program, they really get resentful of your updates. And if they could bill you back for the overhead associated with refreshing their tree with your update, they would do that. It's not really a good relationship, typically. To be fair, I have my own opinions about the customer's kernel practices. So basically customers are system integration teams, system integration and system debug teams. They can't understand how to use anything but Garrett in a mechanical way to manage their technical debt. They don't plan for security maintenance. They don't appreciate security maintenance. They don't plan for rebases and kernel migrations. They don't upstream their bug fixes that they depend on and by upstream I mean feed them back to me as a provider of the kernel to them. They don't provide visibility into changes they're making and they're driven by purely time to market risk and short-term cost and long-term program viability. They just don't care. Let's see. I think I wanted to say something a little bit more about this. Okay. Let's see. I did have another thing I wanted to say. One of the reasons why we... I'll get to it later. I'll get to it later. Okay. Some high-level policies. Pretty much as you do in a code review, you need to make sure that a good commit comment prefix discipline is applied. And the reason why we need this discipline is because you may be working on the 4.4 kernel today but you're going to be working on the 4.9 kernel or some other kernel tomorrow. And without having this discipline migrating your code from one kernel version to the other is almost... You can't do it. I don't think you can do it. And as a code review, it's important for you to review this policy because as a member of the kernel team, assuming you guys are a part of the kernel team, it's going to be your job to migrate to that new kernel. So this is to cover your butt. Okay. So this is a copy and paste from that slightly modified copy and paste from that URL from the Brillo code. So this is essentially the commit prefix conventions that the Chrome OS team created and they expanded and they continued it on and they're applying it in the Brillo space. So essentially, there's a number of these prefixes that they want you to put in the front of the commit comment. So you have upstream and what upstream means is basically you were able to successfully do a git cherry pit dash capital X from the upstream kernel to get whatever patch you need into your older kernel. And there were no merge commits. Backport, it's just like upstream except there is a commit... There is a merge conflict and you had to fix it up. The from list, this is... I use it for both from mailing list and from feeder trees that are feeding Linux next but essentially this is code that isn't yet in upstream... By the way, upstream means kernel.org minus this tree. From list means to me it means it either came from a mailing list or it came from a developer maintainer tree that's feeding Linux next. So this is basically things like I have some USB patches from Felipe. I don't think they're actually on any mailing list but they're in his tree that's queued up for Linux next. So that's what you would prefix your patch if you got it from there. Then you have some OS specific patches. These can either come from the... In the Android and Brillo case, they come from the AOSP command.get project. They have a bunch of reference branches. But these could be... And I have an example later associated with Yachto. But they could be anything that's really not upstreamable or not upstream yet that is important for a particular operating system. The vendor tag, this is where most of the patches should be. That your debug team will be creating patches and stuff like that. And new drivers that haven't even started on the upstream path, you'll just put the vendor tag on it and put your name by it, or the vendor name by it. Like vendor Intel for example. RFC, I haven't actually used the RFC one or seen it used yet but from the text, it's basically if you're too impatient to wait for it to actually get into something that's feeding Linux next, use the RFC one. And I got some examples. So these are two simple bad examples that I want to try to make the point of imagine a tree with about anywhere between 500 and 5000 patches. And more than half of the patches look like these two. And you're given the job to migrate these patches to a new kernel version. Say you have a product that has an extended lifespan and you're concerned about security updates and being able to maintain security updates.  Let's see, it's 741. Let's see. Oops. Darn it. No. This one. Okay. So here's a patch that basically says it corrected some value and it has a bug number. And then it does some stuff and it's actually not a bad patch. But the commit comment is hideous. Okay? Because what's missing from this patch is what's so bad about having an incorrect TSF value? I really don't know. What's in this bug number? What fails? Is there a testable issue that says, oh, if I don't take this patch, this happens. This bad thing happens. There's no clear reason why it's important to fix this, have a cracked TSF value here. Now, clearly I'm showing I don't really understand 802.11 very well. It might actually be really obvious if you're a network guy. But in general, when the customer gets this, they won't have access to this bug database. They won't be able to look that up. And I can't tell if this is actually a really important thing that needs to be ported forward or not. Let's see. My next one. Is this it? Yes, this is it. So I was hoping Matt would be here because I wanted to tease him. Okay. So here's an example from a friend of mine. It's another example of a one-line patch. And it also uses revertMe. What does that mean, revertMe? When will it be appropriate to revert this patch? I can't tell.  It's not because so I've had to port this patch from 4.4 to 4.9 and I don't know if it's important. I'm pretty sure it is. Flushing the firmware from the cache is probably important to do but at least before you start up the device. But we have cache coherency on our hardware so I'm not sure if this is actually needed. So other than that, it's actually a fine patch. It does what it says, well, it does something with flushing cache so that's okay. It could be worse. Okay, so there's those too. Yeah, so you really kind of need to think about, imagine yourself rebasing these things. Oops. Let's see if I got that okay. Also, I saw a talk yesterday and the person was looking for good reasons to justify upstreaming their code. And one of the things that I really think is it should be an easy sell for most businesses is to just talk about the security aspects of their and the security liability of their code. If your management and engineering culture is in the mindset that okay, we're not network connected. We'll never have to update the kernel. We're all good. We can use a 3.4 kernel if we wanted to and get away with it and never do security patches then okay. But that's not us and that's not what we're working toward. So hopefully I provided some motivation. Now I'm just going to kind of talk about what's the structure of a code review. So for my team, basically the engineers are expected to develop for, or they're expected to review for supportability and correctness. And supportability is, is it clear what will happen if this patch isn't accepted? And will this patch be supportable one year from now when the authors aren't there? And how hard is this patch going to be to migrate to a new kernel version? Because you're going to do the migration, not the author in most cases. And then for correctness, you need to check for bugs and coding standards. And is it well aligned with upstream? I'll talk more about those through the talk. So supportability, basically supportability mostly relates to commit comments and inline comments. So does the commit comment, oh, by the way, these slides are, well, earlier versions of these slides are already up on the website, or the conference site. And I'll refresh them with the final version here after, later today. Does the commit comment explain what's going to break and why it's important to take this patch? You know, does it explain what the change is? And does it actually match the change? Because I've seen more than a few patches where the developer cut and paste a commit comment from one patch or one change to the next and sent it my way. And that's kind of annoying. As you're reviewing these commits, you need to think about the commit as a sentence. You know, they need to stand alone just like a sentence in a story or in a paragraph. And if they don't stand alone or if they're a sentence fragment or they're basically incomplete. And I really dislike those. The typical example of a sentence fragment would be someone adding a data member, changing a data structure in a header file, but never dereferencing that change anywhere else in the patch. That's quite annoying. Another thing that you need to look out for, which actually hit me when I did that rebase, when I rebased those changes from 4.4 to 4.9, was there was a patch that said, there's a patch that used to be in there that talked about adding a worn on or a worn once in a file. And after the rebase, the worn on actually fell out. So it was a patch that I probably didn't need to rebase at all. But I ended up with a patch that actually didn't match the commit comment. So this can happen to people by accident and on purpose. You can either get it to happen just by being lazy or just not as careful as you really need to be. So after a rebase, you actually really have to kind of re-review these patches from the perspective of supportability again. So, look out. Locking, basically these are my hot buttons when I see people do stuff. So locking needs to be well-documented, what the lock is actually protecting and it needs to make sense. Magic numbers really need to be traceable to specifications whenever possible. And if they're experimentally derived, admit it. And actually in the comment, you probably ought to tell me what's going to go wrong if I use a different number there. Typically this happens and bring up people's sprinkle delay loops all over the place. And then later on in the program, those delay loops you start optimizing for boot time or performance or something.  And when you're sitting there scratching your head, well, is it safe to remove that delay? And you have to rediscover the failure case when you change the delay. And that's really kind of rude. So you're just being rude to your future selves or somebody else. Either way, it's rude. Complicated and confusing logic needs to be, needs to be, have some helpful inline commenting. Print K's and log messages. So as a reviewer, you've got to look at these print K's and log messages and think in terms of each one of these is a possible support call. And so you really want to make all your log messages and your print K's count. They need to be kept to a minimum and they need to be useful. Just, I was here, or Kilroy was here kind of print K's, aren't that helpful. Oh, reverts. Yeah. So you review this kernel code. Reverts are very common in a integration environment because you have a system integration lead who is revert happy and they smell, if they smell a regression they just revert the thing and ask questions later. So if you make them, if the developer makes the mistake of wedging in multiple features or multiple changes and bug fixes into a single patch, that patch, all those features are at risk for revert, getting reverted. And you really don't want to be the guy who forces, you know, forces a team to make a hard call between accepting all these features with or the revert. You know, it's, they don't want to accept the revert typically. So make sure that, don't accept patches, basically don't accept patches that mix, mix bug, multiple features or bug fixes in a single go. Just because, actually, maybe multiple bug fixes is okay to mix, but adding features and bug fixes, you're gonna, you're putting your feature at risk. Don't, don't do that. Another thing that the code reviewer needs to do is basically you need to imagine, as you're looking at this patch, you need to imagine yourself, you know, basically a year from now or something when the developers are no longer available and there's a big escalation, let's say it's a security issue, you know, and there's a patch that's identified as the problem. Is there enough information in this patch that you can understand what that patch is about and perhaps make some progress on it? And, and you really need to put yourself in the customer's position, in the customer's shoes, because they don't have access to the original developers and you might after one year, you probably won't, but you know, you really kind of need to think of that.   You know, it's easy to fall into doing a git rebase or some other rebase and just kind of plowing through and you don't really look at the patches, you just try to get them to rebase and compile, right?  And so make sure the patches are good. You're just trying, I'm just trying to protect you from yourself. You're trying to protect your future self from your, your today self. Okay. And just want to show a patch that I consider is not too bad. It's over here. Is this the right one? Nope, that's not the one. That's not it. That's not it. Shit. Should be here. No, I think that's it. Yeah. Okay. So here's a super trivial patch. It all fits on one screen. Essentially what this patch does is it replaces binoc with user binoc.  It's for Linux like Yachto.  And essentially the reason why we need this patch is because, uh, the Pocky build will, will basically fail when it tries to get the version from the Linux with, without this patch. So you know that if you don't take this patch, you're going to break, you're going to bake Yachto essentially. Um, incidentally, the reason why this patch exists is because someone from Red Hat, and apparently Red Hat likes binoc for where it likes to put its Ock program. Uh, but everybody else kind of likes user binoc. So this is just to work around a change that was put in. Um, but this like that, consider this a pretty good patch. This, this would be hard to say no to.  You want all your patches to be hard to say no to. Um, you know, you'll have testable behaviors associated with not taking the patch. You know, that's, um, you need that motivation on the patches. Okay. So now I'm going to shift gears and talk about correctness. Um, uh, let's see. We're, we're doing pretty good on time. Um, so, you know, I was doing a code where you need to look for correctness, you know, so you need to do all the normal things, you know, is the logic correct?  Are the error paths correct?  Uh, does code make sense? You know, sometimes, you know, a lot of times it might not. Um, uh, does, does the code match, does the code match to commit comment? Um, I know this is kind of redundant to supportability, but if it, if it doesn't match to commit and it's just not correct, you know, and, and, uh, the, uh, is there, is there justification for the patch, uh, that actually doesn't need to be there, but, and is the code aligned with upstream kernel.org directions?  Um, we actually last week, um, uh, we had this patch. Um, I had this patch come past me and I had to reject it, you know, and essentially what this patch did was it did a really nasty hack to a function called, um, alarm suspend, alarm timer suspend. You know, basically it was no hopping out that function, uh, because that function on this particular, on this particular platform, uh, resulted in suspend, suspend behavior, uh, not being what people wanted, uh, or, or could tolerate, uh, for the program. Uh, the suspend architecture of this, this particular device, uh, or platform, uh, was different because Android is running in, in a virtual machine in this, in this, in this case. So having the RTC timer wake up, uh, really wasn't welcome in this, in this, in this particular use case. And, uh, so anyway, they, they know opt, they, they just deleted everything in that function and put a return zero in it. Uh, and I said no. And then I, you know, and I looked more closely and I noticed that, hey, there's a, there's a config macro wrapping that function. You know, I wonder if you could just change that config and get the same, same result, right? You know, and it turns out that's what, that's, that's what happened.  Um, that sort of thing, that's, that's a fairly good example of an upstream alignment. Another, another example, which I haven't seen in a few years, but it has happened in the past where people will forklift from a older kernel, an entire subsystem to a newer kernel, you know, and just don't say no to those if you can. Sometimes you get forced, um, memory allocation and deallocation. You know, check, check, check for memory leaks, you know, um, uh, look at it, question every global you see, you know, is the global really necessary?  I've seen that happen. Um, you know, and then for every global that you see added, you need to check, you know, you need to interrogate it or question it with respect to, does it need a lock? And it probably does. Um, so globals are a pain. Um, locking, locking is an even bigger pain. Um, so you need to check to see if the locking is sane. Sometimes it won't be. Um, uh, I know it locks, protect data, not code from concurrent access. Um, so, so there's, there's a story that I was, that I, that I, that I tell with this is, um, so locks are kind of like capacitors on hardware, uh, to me a little bit. Um, so at least, at least, uh, non sane walking is a lot like capacitors on hardware. So hardware engineers will come in. So, so a friend of mine who is a hardware, a hardware guy at Intel.  So apparently in hardware circles, there's this, there's this phenomena about being visited by the cap fairy. So what this boils down to is you have a board that's not stable and then one morning you come in and the board's better, you know, and, and there's a whole slew of new capacitors sprinkled across the board, you know, and it makes things better, you know, and, and, and, you know, it's, you don't want a lock fairy coming in and sprinkling spin locks around trying to make things better. It, it, it's happened. I've seen it. Haven't seen it happen lately, but it used to happen. Don't let it happen. Don't let, you know, where, where locks are taken need to make sense. And so be careful with your locks. Static analysis, you need to review your static analysis. So we have, we have some, we have some CI tools associated with the patches as they come in and they run, they basically run III and some other things. Some security analysis as well. And, and you need to, as the code reviewer, you need to review this stuff, you know, and make a decision whether or not it needs to be enforced or not.  Not in header, I haven't seen too many in the header files.  You'll have a lot of false alarms. I know. Yeah, yeah, yep. It's true. That's why you need a human to look at them. Yeah. And that's, that's, yes, that's been my experience with, with that tool as well. Yeah. Yeah. Don't let new compiler warnings in. And I'll talk about, I'll talk about check patch I think next. Okay, about check patch. So, check patch is a annoying thing.  It's, check patch will, will also will sometimes call out errors that you can't work around. So, you need, you need to, you need to review the check patch and use your, and use your head. You know, check patch is great. You need to, you need to run it, but you need to review it, review the output. One case, one case we had with check patch was the, I think the audio team was adding, was adding some back ports, was doing a back port from upstream. So, this is code that was already upstream. They're doing a back port, adding it to some old kernel I was working on. And it had a fairly complicated macro in it. And check patch was flying in this macro. It was being too complex. And, well, you know, it's, it's a change I can't, I, we couldn't fix. We needed that change. And so eventually what we did is we just disabled check patch until we got that patch merged and then we turned check patch on again. It was, it was really, it was really lame. But, you know, so I really prefer human reviewers to review these output of these things, not, not just a robot. And as a developer, if you're, if you're submitting code that you know it's got some check patch issues, be ready, be ready with, get, you know, be ready to be challenged, you know, because we're going to ask it, do you really need that? Or should that be fixed? Why, why is this okay? We'll be what you will be asked. Security scanning, you know, you need to review the security analysis and you need to be very careful before you, you let the patch in, you know, it's, it's, or disposition the issue is false alarm. So, you know, it's, as you get practice looking at this kind of stuff, you get fairly quick at it.  And I know this isn't, I don't think I have a slide to talk about this story, but one time, you know, if you see a patch that's clearly doing stuff that's security related, you know, like checking permissions before doing stuff. You know, get, you know, it doesn't hurt to get expert, expert review on it, you know, ask, ask, ask someone who might know better. You know, for example, there was some patch that was ported that was, I forget what it was for. It was, I think it was for changing some C groups, some C, C group properties. But it was, it was, it wasn't using the, it wasn't using the same security check that, that P trace uses, and which is, you know, which is what was, which was what was proper for this, for this particular scenario. And, you know, I saw that patch, it wasn't really sure if it was good. And, you know, I'm lucky enough to work with some, some really, really great upstream people. So I asked Ari and Vendorvin to take a look at it and ask, you know, and he gave me, he told me, oh, that needs to use, use the same check that P trace uses, otherwise it's wrong. You know, it's, it's, it's good to have experts around that you can ask for help. I'll talk about asking for help more later too. Another thing about correctness is, is the code compliant with your business policy, you know, is it in compliance with your business policies and legal, legal and business policies? You know, does it leak confidential information? This confidential information could be a customer name, it could be a code name of a project.  Just for the comment, commit comments.  That's basically, you're leaking, you're leaking IP if you do. So you need to check to see that everything's approved. Most, I doubt if, I don't expect a lot of people to have to do that in this, in this room other than me. Oh, well, Intel people. You need, you know, do business approvals exist for the IP that the code's for? And another thing you need to check for correctness is where was this, where was the content sourced from? So I'll talk about that more in this next slide. So a common thing that, that people will do when they're developing code is they'll, they'll look around at other trees and they'll harvest, harvest code. And when you harvest this code, it's really, really easy to do it in a way that, that results in you being named as the author of the code.  Even though it's GPL, you don't want to, you, you want to respect the copyright and the authorship. It's, it's more than just a plagiarism issue. You know, the easy fix to this problem is to use get-amend author and fix it. You know, so you need to make sure your developers know this, this, this get snippet. But, you know, it, it's, it's more than plagiarism. You know, it provides, it provides trust. It, it, it provides a herd mentality to the customer that, oh, okay, this, this patch was taking from, or this code was taking from, taken from, say, the Cyanogen mod Samsung 5X kernel, which I have, have, I do have, I did have an example like that in the internal class. That is just a hideous tree, by the way. It's, it's just, it's got 30, everything squashed into one commit. You know, it's got like 30,000 lines of changes. And it's, it's awful. Anyway, but, but you need to, you need to, you need to call it out so that, so that you can provide a high, a herd mentality a little bit to, to provide more credibility to your patch. Okay, what does a good code review look like? So, basically a good code review helps good code getting quickly. That's the biggest thing.    And then try to put in place some follow-up commits, plans for follow-up commits to, to fix the issues. It's really kind of a bitter pill to swallow as a code reviewer, as a kernel maintainer. But you, you kind of need to do that, be able to do this as well. More details about what makes a good code review. You need to provide actionable feedback to the, to the author. You know, you need to make clear what needs to change in order for the patch to get merged. It's not good enough to tell the developer that you make my eyes bleed. You need to actually, you know, give them feedback that they can do something with. You know, so you need to explain why the code needs to be changed. You also need to try to, try to make sure that, yeah, you, you review the whole code one go. You know, because, you know, this, this can be hard to do if the, if the patch doesn't, doesn't, if the patch doesn't get passed, you know, the, the, the static analysis very well and is really a turd.  But, but you can, you can throw it back and say, make, you know, make, make it pass all the static analysis checks and then I'll, then I'll review it, which is, which is fair. But after it passes all those, those, those items, you need to review the whole patch and attempt to, to get all these, get all the issues enumerated for the, for the developer to fix. And this is important because, you know, well for, for Intel it's important because we have a, you know, a worldwide engineering team and we really can't afford to have a, have a 24 hour turnaround time for every, every bug fix. Oh, three minutes already. Okay. I think I'm pretty close to done. So you don't want to, you don't want to start playing games with the, you know, with, with, with this sort of thing. When discussions stall, you got to reach out to the developer and, and to management. Many times developer will, will decide, you know, I've reviewed patches and I bled all over it and I threw it back at them. And they then I get radio silence in return.   Then I'll send it your way again and see if you change your mind. Because now you're going to have management crawling up your backside to make that, to get that thing in there. Don't, don't, don't let them do that. Talk to their managers and chew out their managers and escalate it. Don't, don't be afraid to ask for help. A lot of good learning you can do. A lot of good growing opportunities when you get something, you know, when you consult some expert. Give examples. Be patient. Key takeaways. This is like my last slide. Hopefully you, you understand how the patches are going to be used by customers. You're going to understand the, the, the importance of reviewing the patches from the point of view of, of that, with the assumption that you're going to have to reuse these patches across different kernel versions and you're going to have to execute a kernel migration at some point. You know, use good prefix conventions.   And I guess that's it and I'm pretty much out of time. So, awesome.


Hey guys, welcome back to Daniel's Tech World on YouTube and for this video I want to demonstrate my current Ubuntu desktop backup approach now for people not involved in the world of You know, I haven't thought twice this video is really intended for anyone using Ubuntu Linux who wants to take I'm just demonstrating my current backup approach now. Gonna go through the various tools. Gonna go through the rationales I'm gonna try do so relatively quickly because this is not the most grossing subject I'll be the first to agree with that. Although actually the more you learn about backups the more interesting things that there are to learn about them This documentation is on GitHub. My username is Daniel Rossell JLM. I Always think I might change that so just type Daniel Rossell get up. There's only I think two Of us in the world and I think the other person is not involved in technology in any way So my GitHub account if you look up the master backup strategy Repository that I currently have pinned to my home page, which has been forked once which is which is a nice milestone for myself This is it so basically I documented this in a markdown file Also in the repo. I have a couple of scripts that I use in my own backup operations, you know taking local files you can see What I'm doing here just giving myself I have a B2 bucket My Linux backups and I'm just kind of just the auto key config The open box config LibreOffice stuff that I don't want to have encased within a whole system backup that I might want to look at that's the rationale there and I have my these little graphics here the PDF if anyone wants it of v1.3 I called it v1.2 initially then I did some updates while I was making this infographic. Hence it's now v1.3 And basically what this is is it's currently what I use for backups now this master backup strategy I called it master because I described both my local backup approach And my cloud backup approach, so I want to back up really as many different Things as possible. I want to get everything on my desktop. I want to get everything in the cloud I want to get everything I call this minor cloud backups. It's my own terminology I'd never heard anyone else describe major and minor clouds, but I'm talking by major cloud stuff like Google Drive Dropbox P Clouds and Sass-minor cloud is stuff like reddit, Quora, Twitter now I'm really really vigilant about cloud backups, and I want to make sure everything including reddit and Quora at least I mean ideally to do this every three months this unfortunately There's a cool. There's a cool tool called skivvia, which is just about the closest I've I've come to seeing what I'm looking for what I'm looking for really is something that you know would take reddit and Quora are not here because it's it's manually you need to literally write into their team and say can you please give Me my data export and that's only available as a result actually of I believe GDPR which gives Grants data subjects the right to have a copy of their own data They didn't have it before then I think it's fair to say that was the results a lot of people have started offering it now That never did that before this is a nice tool skivvia. You can see you've got stuff like sugar Zoho dynamics your major CRM's here and They just give you a bunch of connectors basically right so You can see backups a major use case solutions data. Let's go for data replication This schematic explains it quite nicely. So you have all your various things here in the cloud Your sales force your hub spot And then it's just this connector basically And then just mirroring that to wherever you want it to be mirrored such as a data warehouse, for example This is really a mature enterprise product intended for big scale something a bit more user-friendly would be mold cloud Which again their library is not brilliant it kind of has stuff like Evernote and then doesn't have other stuff It's inconsistent, but I use it because stuff I use Happens to be covered Although I couldn't get b2 to work unfortunately So that's what I do in the clouds I as I say you can use more cloud and you can use this nice tool called flexi phi and that really moves stuff at Lightning speed across the wire direct cloud to cloud Another approach which I will just show quickly is using spinning up your own ec2 instance on a ws and p cloud to B2 back up I think I should find my own stuff because here we go not many people are probably Using both p cloud and B2 and they're looking for a way to back them up. So that was a previous video I did and That's basically is firing up ec2 Installing or clone. That's a cli that is for cli to cli backups Based on our sync I believe and then on the ec2 instance actually directly running that backup and then obviously the rationale there would be using the Using the upload speed that that is available directly on the cloud as opposed to your own internet connection So this is my cloud approach and the overall strategy I have here my graphic from my article on I believe it was Linux hint calm My overall goal here is to be compliant with three two three two one So I'm gonna explain what three two one approach to backups is now if you do not Trust me on this A lot of really good stuff has been written about three two one carbonite for example have this resource So let me read and I'll show you my my My my own thing so this is why I call three two one a misnomer because You can see here that includes the original copy and at least two backups So this on my schematic here I let's say let's for the sake of argument say that we're using an SSD as our primary As our primary Ubuntu desktop that we're trying to protect It could be an HDD a hard drive or it could be an NWM E But in any event we need to to get to the first number three we need to create two backups So it's actually a regional source plus two backups as carbonite make clear not three backup copies The next thing in the three two one rule is that the backup data should be on two different Different storage types, so we're gonna have two backups and those backups cannot be on the same Storage types, so let's say for example. We were gonna back up our SSD here onto the SSD Now we could if we bring over a time shift. There's nothing. I believe Preventing us if we go into the settings with I am using here SDA is is my original. Yep So I can change it over to SDA to which is the partition that I have my Ubuntu desktop on here So there's nothing actually stopping me from creating backups onto the actual primary Device I'm protecting the problem in that situation is that they're on the same storage media That means that basically if that hard drive fails for instance the backups gonna go with it The backup's gonna go with it, so therefore They should be on two different storage media Generally, you can achieve this and I'm achieving this in my Ubuntu backup by having and if I just bring over This settings page actually because it does a nice job at showing What I have in place so SD SD a is a 480 gigabyte Drive an SSD and that's where my operating system lives on You can see I've actually gone through relatively a relatively small amount of that. I just recently actually swapped out a 240 gig for a 480 gig just to give myself more room. I would say tangentially the reason with Linux backups The longer your system is stable the more you stand to lose You know your modifications tend to accrue you tend to add more packages You might add unattended backups for example, sorry on this hit unattended upgrades, which I always do and I just find that over time. This is actually how I got into backups. I would basically every second year I've been using Ubuntu for like 10 years Every second or third year something would break the system Leading as I've said at the start of the video would be a leading release a non LTS release First piece of advice stick with LTS to LTS releases more stable Typically something like an LTS release would break the system ruin the package manager ruin NVIDIA at that point It was really just not worth spending the two or three days You can do that once or two times. You can reinstall your system two or three times You will if you do this get to a point where you say never is this ever happening to me again And that's why I decided to get really big into making sure good backups have been taken It's really paid dividends because I now have a stable system But in order to keep it stable I need to keep on top of this backup approach And that's why I'm going to be spending the next 20 to 30 minutes Explaining us on this YouTube video, and I've certainly already spent a lot more than 20 to 30 minutes Putting together this documentation on GitHub for anybody interested, but let's get back to what I have So this is my primary system here And then SDB is where I stick my clone zilla now that's 240 gigs because they want to change anything here That's 240 gigs because I take on zilla less regularly. It's not automated and therefore it's more work SDC is another drive that I have formatted to ext4 and This is where I put my time shift time shift backups Time shift is creating basically snapshots restore points something like what you have in Windows with your Windows restore points similar to that not familiar in depth with the Windows tool because just because I don't use Windows that frequently But it's a similar idea. So I basically have you can see this is 480 gigs This is 480 gigs, and I'm using actually not a whole bunch of Of that space just just as I'm not using a whole bunch of space Actually, I'm using roughly the same it seems I think that's a coincidence because those are snapshots and there are three of them and this is one operating system So I basically am using for the sake of my backups two dedicated discs one for clone zilla one for time shift and why do I do to essentially because Time shift is a great tool, but I don't trust it 100% If you're restoring from time shift you go into a you can do it directly from Let's just exit out of this You can restore from you know just click on restore and you can roll back to a snapshot Now that's do that's obviously that if I were to go through this process now It would be restoring a board live system, right? I've booted into the system that I'd be looking to restore from I Don't trust that really 100% you can also use a command You can do the CLI boot into your Ubuntu system get past the group menu and you can there Run the same operation from the command line interface before you've booted to the system and it's not live I trust that a bit more. However, I trust clone zilla more than I trust time shift clone zilla is a very low-level Backup methods and that's why I do to but something else you could do would be to You don't need to have two different like basically I'm running two different two different Backup programs each gets its own drive and I back up my hard drive my main drive SDA on to SD be an SDC That's going actually beyond three to one because it's creating two on-site backups and then one off-site backup So three copies of my data here You could do raid one raid is redundant array redundant array of independent disks and you could just have another SDD Another another drive NVME as I said HDD doesn't matter of the same size and you could use raid to constantly replicate locally I Find this approach advantageous over over doing a raid configuration and that's because I actually get to keep three snapshots here, so raid you have the latest and There's a point that sometimes made that you shouldn't mistake redundancy for backups so raid creates terrific redundancy You know the whole world of backups Fits you backups and you have data recovery If you just look up the difference between them, you know backups refers to creating the backups ahead of an anticipated disaster like a hard-dry failing Disaster recovery encompasses the full strategy for responding to a disaster event and putting the backups in into action. So that's that's concerning. It was the restore site site and another interesting allied field I would say is business continuity management and So if you do redundancy if you're creating another raid disk, you're giving yourself terrific redundancy that in other words if you had let's say Let's go back to our schematic here sort of schematic Location if we hadn't we could put in another we could let's say we created SdE Or as to say SdD wasn't Windows. It was another it was another component in our backup arsenal So we could have a we could be running raid between SdA and SdE and we could also have that would give us redundancy that if SdA Were to just without warning fail the heart the SdD completely failed We could immediately and that's business continuity swap over to SdE But that would be our latest copy essentially before the failure occurred in SdA so we might find that there was There was stuff There's stuff in that in SdE that wasn't to our liking But we wouldn't really have much of an option in order to actually go back in time We need we need we need to restore from a backup point. So in that scenario our SdB would still be useful for us because we could restore from SdB to SdE or from SdC to SdE So that's why in a kind of nutshell why redundancy and backup are not the same things and why both are actually required optimally One thing to mention here is it doesn't you can see these are all disks sitting within my computer If we go back to our My diagram here. So basically why let's just understand three two one here for a second So we've covered this we need original plus two. We've covered this Different storage media actually we haven't so let me explain it Basically as I said if we have the backup if we had SdD backed up onto SdD if SdD failed we'd have no backup Now where else could we what else could we do? We could have a NAS and that work at that storage Like a Synology and Synology have just sent me a NAS to play around with so that's kind of cool and If if we had SdD backed up backed up to our NAS in the event that are that would be one on size On a different storage media. So that's three two one compliant and if SdD failed if our primary failed we would be able to You know restore onto a new storage media from our Synology or it could be a hard drive that we connect us in an enclosure or it could be an external you know one of these USB Western digital External SSD that you just exactly something like this That achieves about the same thing as if we had a hard drive in an enclosure and then kept the enclosure in in a in a Like a barracuda for example now What's what's the what's the difference between this and an NAS the difference would be that let's say between uses we put This in our cabinet that means it's not connected to electricity So when we're looking at the reasons why your onsite backups might be vulnerable We're looking at basically a few catastrophic events. We're looking at for example theft would be one everything in your apartment or workplace is stolen We could be looking at fire the office goes up in fire your home God forbid it goes up in fire and everything is destroyed That is so this this will not actually be any be of any use if we have our backup on Something like this in that case, but if it's a power related event For instance, there is a lightning surge or a massive power surge And it blows out everything in the in our in our home office. Let's say if our NAS and our Computer are both connected on that same circuit. There's a good chance that The NAS will be fried alongside the SSD. So if we Actually take our backup on something not connected to the power or or we could do we could do another onsite backup If it's an NAS that we're backing up to onsite We have the advantage that the NAS will be constantly online and we could therefore automate this onsite backup We could just do a simple cron job that would use our sync to incrementally back up our SDD Sorry our SSD on to the NAS at midnight every night. Let's say. I mean, let's say we keep the desktop running 24-7 Obviously if we are doing something like this and we're not keeping it connected to a network device We're not gonna be able to avail of that So what would what we would need to do? So that that's a use case why you might want to Both let's say do an automatic backup on to a network attached storage and you might also want to do this And that would be again go beyond beyond 3d1. We'd have in that case to On-site backups one off-site backup because we're gonna do that next and that would therefore give us three What are primary data source plus three? And don't forget as well just jumping back to the cloud for a second And if you look at this final part of my diagram where I'm describing doing a pull from b2 On to our local server if you have if you back up from one cloud to Google Drive to another cloud b2 That's not three two one compliant chat. You've only created one copy of your primary data source and not two And not to now they are on different storage media. So that's great This is on, you know, Google Drive's data center. This is in b2's data center. Realistically That's fine But you might want to pull it down and keep another copy on an onsite storage like the NIS we mentioned and the reason for that is because if we're dealing with local backups, it's easier to typically easier to Restore local from local and it's typically easier to restore our cloud from cloud Why is that if we're restoring if we're restoring a In the scenario where we suffer STD disk failure here, and we need to restore for mutton or NIS It's going to be a lot quicker if we you know put in a new SSD and there's it by the way There's a use case for having always having a spare SSD on file Unused format in whatever you want EXT4 for this very reason that we could just stick in a new EXT4 let's say our disk fails stick in a new SSD for attach it to the motherboard and run clonezilla and Just quickly restore and bingo. You're back in action pretty pretty pretty good in terms of business continuity almost as good as using rate Doing that it would be slower if we had to restore onto that new SSD from an off-site backup namely Namely from clout clout berry, which does have a restore capability and I'm going to talk about clout berry shortly So quicker to do quicker quicker to restore local from local and For the same reason quicker to restore clout from clouds if we lost our data in Dropbox It would be quicker to upload it to another Dropbox account over the wire from another cloud than it would be to Do so from our desktop You know or are from or are from an NAS that would be pushing up Why is that it's the same reason that I did my P2 to be to back up here? On an EC2 instance because it was quicker to much much quicker to upload data on the cloud Than it would be to deal with my and I don't want to do this be test because just to show my IP address But I have an uplink of about three megabytes per second megabits per second. Sorry So it would take an eternity Um, all right. I don't I don't I don't want to make this video a marathon. We're already at 22 minutes So I'm going to try to keep this within the 30 minute mark So what do I do one? I do time shift time shift. I configure to If I can get my time shift back here. I back up onto this is for local backups. I back up onto Uh disk the same size as my as my main one and I keep A monthly I keep two weeklies and I keep one daily So I don't know why you don't have four snapshots here Time shift is good. It's my first protocol if something goes wrong. It means that I can do quickly Let's just jump out of this again restore from any of my restore points today's 12th of june I have one from a few hours ago that that would be the one I would use If I Install some package that broke the package manager or did something that just created a mess And they didn't want to spend the next two days Getting out of that mess and I wanted to get on with my life I would restore from that guy If I had installed a packet a few days ago that then seemed to create and I could trace it back to the created some kind of massive Series of events that resulted in my system being bricked I would go for that guy and again further back in time I would go from this backup on the 5th of june that would be about a week ago As I said, I think I'm missing a backup here missing a snapshot Um, they're pretty light You just I would recommend having the same size as as the as a drive. You're backing up storage is pretty cheap You could also do this onto network at that storage. You could have an nas as a Synology as I as I said And this is just a front end that we're using rsync Uh, it's basically just using rsync, which is an incremental backup command line interface and just, you know creating a few snapshots Um, and uh, so that you don't have to bother writing scripts bash scripts. You don't have to bother Running rsync with the correct operators. It does all that messy work for you. Um, and It's one thing to point out as it says here devices with windows file systems nt fs and a fat f at So it just runs so you need to have exd4 or other linux formatted file systems just to run So this little guy is um, and you can also exclude and include stuff basically I actually have forced it to include the stuff in my home user directory by default it excludes that so I've added That folder, so it's actually basically taking a full uh, a full disk and that's because within my user directory I actually keep uh um, I keep some network attached stuff and uh So that actually if you have something like google drive that's mounted you might want to exclude that from within the include of your home user directory So that's time shift in a second in a basically and it's used to create my first uh on-site backup Now the limitation as I said you can restore from this Interface or you can restore from as the cli and you just basically boot Into your computer. Uh, you know get up a shell.  Uh, so that's my first protocol the second. Um, that's an incremental backup now Uh, I mentioned I use clonezilla clonezilla is a very very uh low level tool clonezilla.org. I believe I believe yes Uh, you can just download clonezilla put this onto a live usb. It's a very very low level device. Um, unlike, uh, Unlike our friend timeshift. It doesn't have this Limitation you can see many file systems are supported ext 234 As well as the f at file systems and at ntfs. So it's actually it's cross platform So you don't need to just worry that you can actually use this also to back up a uh A window which is going to get rid of this uh, this advertising here. Um It also supports lvm 2. Um, and they've got some screenshots here. So basically I use this This is really what I expect is going to work. Uh in the event that for some reason my uh incremental Restores are the timeshift doesn't do the job. Um, I I I've tested this and if you really really want to Knock yourself out. You should ideally and this is part of uh, remember we looked at backups versus Disaster recovery versus business continuity. This is really part part of uh disaster recovery Would be uh testing the restorability now clonezilla When you run it has an option to test the restorability of the backup. It's just created But if you want to or you want to be extra sure I would actually go as far as recommending That you stick in a uh test um a test drive here In order to actually um try to write You know try to try to use clonezilla to restore onto the test drive Boot into that and if that is replicates the functionality of the uh of the primary disc You've just backed up then you know that the backup image is restorable that it's good. Uh, I Just trust because it's my second tier. I don't have Patience you could say that's really a lot of work. Uh, but that's the optimal thing so clonezilla Is uh something I do manually, uh, and I do this really as I said here quarterly and it's a full disc image It's not incremental another important distinction. Um, I literally go in I have another video on my youtube and I will actually uh, It takes about probably 20 minutes and uh, I'll put that on to you. I in my diagram. I've got an external hard drive Once I get my new nas hooked up. I'm probably going to start doing them on to nas. You can also, uh, You can also encrypt those afterwards. Um, I think you can encrypt them as the process runs, uh, and obviously if you're backing up on site Ideally for security, you should be encrypting Uh, encrypting those backups. Um So, you know, if you had an encrypted file system using timeshift and then encrypted those clonezilla backups Um, and this process I do quarterly because it's far less convenient. I don't need to worry about timeshift It does it works by itself clonezilla. I mean you could be extra diligent and do it weekly Um, it just creates an image and uh, I use the uh partition to image So I take it doesn't back up the disk. It drives it specifically the partition that my ubuntu Linux desktop lives on and then it creates a nice image of that on this guy and in the event that Uh, timeshift was not able to successfully restore Um, restore a new there's another actually important distinction here and that's timeshift In order to restore in the event that my, um, ssd failed And I needed to restore. I would need to firstly stick in a new Uh, ssd I would need to install the timeshift program. I would need to then attach my uh, this guy my my uh, sorry I would need to install timeshift onto linux desktop And then I then I would be able to you know, see the existing I would have to tell out where my timeshift snapshots are and then pull them in You could say it's a little bit because you need to go through a whole manual install It's a little bit slower than this is just disk to disk. So I could just put in a new ssd in the event that uh timeshift did not work and um, You know, it would probably be quicker in that instance that the disk was completely failed As opposed to there was a just a packet's gone wrong and the packet packet manager Uh, wasn't working if that were the case a simple software glitch I would probably restore from timeshift if the disk if it was actual if it was an actual hardware failure I would use um, I would use this guy because I could just directly run a restore over clone zilla From uh, whatever it is the nas or the uh external drive onto the primary And I'd be back in action without needing to reinstall that's My process for creating and uh, as I said This is actually going beyond 321 because I'm creating two backups locally and one in the cloud Final thing I will demonstrate is what I'm using for uh, clay backup. So this is a tool called, uh, Clydeberry I think it's like whatever their community edition is cross platform And I'm not going to say too much about this. You just create a new backup plan Uh, you tell it basically what to do you then add you can see all my backup storage is here I have all my b2, um buckets mapped out and really you just give it a job You say I need please back up my local system the whole file system or my user directory In practice and this is maybe just the final thing I'll see in this video Linux backups what directories? You don't want to back up when you're backing up, um Here we go. We have a nice little resource. Uh, you don't want to when you're backing up a Linux system You do not want to do everything. Um Linux, yes, yes, yes There are things in a Linux system that are not going to be useful and actually they're going to to the country Uh, they're going to actually make uh, I believe they're going to make it impossible to to restore. So you want to They've given a general, um, this resource for Linux slash unix backups And you can see some of these i'm the boot. Uh, you should not include lost and found You should definitely not include this you might want to look for a more specific List of things you can exclude for your the specific Linux distribution you're running Uh, so I would in my Clydeberry plan. I would uh, if I'm doing a full disk one You can see my full disk backup plan here if I've basically told Clydeberry What's uh skip? I told it where where to put the data in b2 And that's pushing it up to the cloud now. That's a really really slow process It takes days and it's painful. It is incremental. So once you run it for the first time, um You can put it on a schedule as well or you can just run it manually each time Um Sorry, I'm going to distract them actually Let me just finish this video before I'm I'm going to actually run it again now Um, so that's the final thing the final chink in my armor If you like so to speak realistically in terms of restoring a brick Linux system, uh, there's really no need to go beyond timeshifting clone zilla But because of the three two one rule and just general best practice in which Credibly, there could be something like a uh, as I said again God forbid a fire in this place and both the nas And the uh, and this uh, the computer itself were, uh, you know destroyed And I really really want you know and even in that case to be honest because all my data is on the cloud It would just be quicker easier to install linux and uh, I think if anyone's apartment burned down Uh getting back their operating system just as it was and getting the programs the way they were and all the configurations is not going to be anybody's Most pressing objective And there's another approach you can take which I'm trying to do and get up as well And that's just basically uh, if I go to my a bunch of modifications, I've tried to just map out This is really documentation. I've just done for myself um, you know, I've kind of Listed out the packages. I did this a few days ago Just what packages I have that I could also just kind of refer back to my own github documents and say Uh, this is the stuff that I want to get back on my system But uh to comply with the best practice. I'm keeping a secure off-site backup up in b2 And if in this catastrophic scenario, I outlined I would uh, you know, I could basically Um, if I didn't do Clydeberry, I could push let's let's just say for the sake of argument I had a fantastic home internet connection with um One gigabyte per second upload speed. I could take a I could take a full just full local backup with clonezilla I could put that onto a network attack storage as I said a sonology device And then I could upload from sonology on to b2 and in a reasonable amount of time And I would cap a reasonable amount of time realistically in a few hours I'd push that as an off-site backup Then in the event that um, this guy fails and we weren't using something like raid. I would install a new ssd Uh device, uh, I would uh, Just install a little a little basic linux, uh the same distro I wanted to restore from I would then uh, Download my my clonezilla Backup from my from my b2 from the cloud put that on to a Put that on to a usb or Uh, download that back to my network attack storage I would then stick a live usb into this system And I wouldn't even need actually an operating system to be in existence yet So I can just skip actually the installing linux Put in my live usb running clonezilla and I would restore and I would tell clonezilla to restore From let's say an nas was in this picture restore from my uh, My full system backup on the nas Onto the linux backup it would onto the linux desktop the new ssd It would run their process in about 10 minutes And then I would simply boot back to my boot back to my machine and I would have a backup from That would replicate the system from whenever I took Um that full system Back up and uh push that off to the cloud and in the event that I was you know doing this process from A different location entirely my apartment had been destroyed and I was uh backing up, uh, you know from the cloud I would follow this and I'd be able to get my old computer desktop back in action just as it was when I was instituting this backup, so Uh 36 minutes later that is essentially how my current approach and as I said it's a work in progress v 1.3 When I have a v 1.4, maybe I'll wait for the v 2.0. I will make another video Thank you for watching and uh any questions or comments from anybody Uh, they can go on to my website here at danielrowsell.co.al Um, and I'm always happy to uh, you know discuss backups or whatever. So thanks for watching and uh Check out new videos soon on daniel's tech world