FORSE: Knowledge is our force!
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Mehmandarov, Rustam
Fianbakken, Harald
Are you a Ninja or a Samurai? Ever wondered if you could switch from old-school Bash to a newcomer PowerShell? Or the other way around? Could one of them be as effective at the other one? Perhaps even better or easier to master? Want to find out? Come and see the epic dance off of a Bash command line ninja and PowerShell samurai. Find your favourite scripting platform, by watching us solve real-world problems using the two!
 Is it working? Yes, I think it's mine, it's working as well. All right, good. All right, let's start. Welcome, welcome, Amaran. And as you know, we're going to have a battle, and so there will be things, there will be blood, there will be swearing, no, we won't. We'll try to be nice, at least a little bit in the beginning. Do you want to start? We can start, and then we can switch. Sure. So, I will be representing PowerShell, and this is my name, and I'm working with Foshe, and I've been a PowerShell enthusiast for quite a while. It's called Addict. Addict, PowerShell user, whatever. Once you get into it, it's hard to stop from there. Good, all right. All right, so, and you should probably say... I'll do that, just could you... We have this fancy thing, we have to push the button. Yeah, now it's my turn. So, this is me. I'm going to be representing Bash, and while I have to say, I have been addicted to Bash for, I don't know, over 10 years, 15 years probably, so, yeah, well, and I work at Compitose, and I'm going to try to show you some cool stuff about Bash today. So, there is one thing. We need your votes. We really need your votes. We need your tweets. So, basically, what you have to do is, what's there, you just say, and this here, slow, and then you say Bash, or... PowerShell. PowerShell, and whatever you want. So, basically, we're going to be looking for those two hashtags. Why you'll see later on, and how. All right, I'll switch over here, so you can quickly take a look at the PowerShell tag. This is what you want to vote, of course, and vote smart, vote for PowerShell. No. So, are you guys ready? Yay! Come on. All right. And then we kind of thought that this kind of battle, it has to be like, kind of, you know, within real, like, battle traditions, so we should kind of present in, like, in the left corner, there is a Herald, representing PowerShell. Yes. And in the right corner, representing Bash. It's me, Rustam. Yay! Thank you. All right. Let's kick things off. So, I'm going to go ahead and start, because I already have the computer online here. Perfect. Let's see. You start. I'll show the good parts. Do the duplicate screen thing here first. So, all right. This is a nice little Windows screen. Oh, and the foils. Okay. So, I'm going to go ahead and start PowerShell. Ice. And I'm going to render that admin, because I want all the privileges I can get. So, ah. Your shell is ugly, and it looks like MS-GOS. Well, since there are microphones, I'm going to repeat that. Totally. I mean, no, no, like, I have nothing to do with that. I'll just repeat it. He just said that his shell is ugly, and it looks like DOS. Yeah, well. That's for the record. Well, at least I can change it quite easily, compared to what you can do in Bash. I mean, I can just change the colors here. Yeah, but you need to. He can change it to black and white. So, it looks like DOS. Basically, I have all the options I need. So, I can change it from not looking like DOS. Anyways, so, I'm just going to kick everything off. So, I'm just going to go ahead and say, do awesome. And we can just admire the power of the shell. It's good. It's so wonderful, isn't it? So, this is a little memory stream that's actually writing to the system beep. The nerd factor of this talk, just skyrocketed. What do you got in Bash? Well, I mean, now we know who the dark side is, right? So, I'm going to go for safe stuff, and just like with kittens and animals and stuff like that, right? So, I'm going to show you some, wait a second. I'm going to show you something really nice. Can you see the, oh, you can't. Good. That's a yelp. It's another feature of Microsoft Windows. It kind of switches this stuff for you. That's the Linux yellow screen of death, almost. Yeah, well, it's nice, you know. Let's see. Can we... Technical. We have some technical difficulties. We go for duplicate. It's a power point changing the screens and stuff. So, I have something really nice. I have something like that. Welcome to NDC. Oh, isn't it nice? Isn't it cute? Yeah. Yeah. It's pretty cool. It's the light side. It's the dark side has cookies. We don't. We have cows and stuff. Yeah. And kittens. All right. So, what? Do you want me to show you something? Something more awesome, I mean. Okay. Let me start you showing you some cool stuff. And in this shell, let me just go to... What was that? What happened? Something is wrong. Something is wrong. Something kind of looks weird. It looks like a kernel panic. Oh, wait. That wasn't... Wait, PowerShell rocks? Come on, dude. We're in presentation. It looks like you're already completed. I mean... Come on. I trust you not to do that kind of stuff. I don't know. I'm innocent. Yeah, right. You're innocent. I kind of don't believe that. I mean, my computer wouldn't do that kind of things. Of course it would. Yeah, right. Okay. Well, okay. Let's see. Well, I mean, the thing is that... Let me just fix it. His screw up a little bit. I don't know what you're talking about. Well, he's still... Yeah, right. Yeah, okay. Well, you know, let's start with the profiles. Since we're there, just let me show you just a little bit of profiles and stuff and see how actually that kind of things could be done. We have... In Bash, you have profiles which are... There are like different places and there is one main one which is at... It's at... Can you see or should I increase the font? I can do that. I can do this and I can actually go full screen on this. It looks so much cooler. Is it better now? More? Like this? All right. Let me show you. Oh, let's go for like... The main one, the main profiles thing is here. Oh, wait. It's in... Oh, it's in here. Profile. So this is kind of the main thing that's for all users and stuff and then where you can define things, you can define your own variables and it kind of gives you the flexibility of adding your own functions, your own stuff. We'll look at more what kind of stuff later, but basically this is kind of lets you create shortcuts for your things, the things you type, the things you type more often. And there is also a local version of that which is for your user which is there, which is kind of your own customizations for just that user that is logged in and then you see I have my own customizations and stuff added there which I kind of going to use for later on. That thing is placed, it's at your home slash your user name. I have a fantastic user name. I'm really proud of it, by the way. It can get really critical. It can get really scary sometimes. I did type it a couple of times instead of the login window, I tucked it in the shell. I stopped in time so no harm is done, but yeah, it kind of could be a little bit different. Another cool thing, I mean what you can do, what you can put in those profiles is functions. So you can actually create like a easy tiny little function like, well, the example I usually like to show is the one like how often do we like say CD to something and then go to CD to something else and then you take LS there to see what's inside, right? What you could do is to create a function called CDL that would do both things at the same time, right? So then you can just do like this and then you say I want to go to CD to something which is, and that something is the first parameter that the function gets. And then you can say like LS minus, I don't know, LA, something like that just to see the contents of it. And then you can just go like CDL and NDC battle. It will do both things. So you go there and show the stuff. What do you get? Do you have some kind of stuff like that? Yeah, definitely. Show something cool and powerful. Okay, so if you took a mental note of the function in bash, it's really ugly. It's really ugly. I mean, you're passing parameters with a dollar sign. So in the PowerShell, I could just do a function, do something, and I could pass a name parameter. And then I'm actually able to use this for later. So I could say do something and then get auto completion. So it's pretty neat. It actually helps me to write better functions. Well, you have auto completion in bash as well. It's called tab. But it's not as pretty. So, he spoke a little bit about profiles. And the thing that just happened to your shell couldn't happen to mine because basically, I could set up a monitor to listen for events on my profiles. So PowerShell has the same concept of profiles. They're just stored more centralized. So basically, we have a variable called profile. There's just one one up. No. Oh, no, there's multiple profiles. But here it's all grouped together so you can have a profile for all users, all different hosts. You can have one for the current user, all hosts, and you can have for different variants of that. It's actually cool. It's a so you don't have to remember any paths in particular. You can also print them if you want. So I'm just going to go ahead and show you my profile. I'm going to say current user, current all hosts because I have something in this file. So basically here, I've set up a customized profile and I've added some neat little tricks like new item. I've added a default parameter. So every time I'm trying to create an item, I don't have to type dash item type file every time. I can just say new item and then it creates a file for me. So it's just small details that makes life a little bit more easy. But for the monitoring part, PowerShell has a really fancy way of registering events and listening to events. And since you're already based on the full.NET stack, you can basically use any component you want. So what I did, oh, I've done this earlier some many times because it's quite useful in many projects. Let's see, I'm going to go ahead and grab one of my scripts. Is it big enough? It's readable. I can probably make it a little bit smaller if I can read it. A little bit smaller, yeah, I guess that should be fine. So basically I've made a function to watch for changes and this one takes either a directory or a file. And there's some logics, there's some if sentences, which is quite readable compared to what bash is. You're right. But basically what this does is creates a file system launcher and it registers for the events and then it pushes them. So every time a file changes, I'm actually sending an email. Okay. So if I wanted to use the script, I could basically just say, what register, what did we call it? I have up here it's watch changes. So I could say watch changes, path, profile. Yeah, let's do it. Current user, all hosts. And let's save this and run this. And you can see it's writing some debug info because I put debug preferences on. And if I now try to change my profile, just say save, it's sending me an email. So it's pretty. So I can't actually pay you back, right? That's what you're telling me. Yeah, pretty much. At least I'll know you changed something. Oh, interesting, interesting. You know, I think I have to, I have to, I have to tell something. I kind of didn't want to tell you earlier today, just in a couple of minutes ago. But I don't know if you guys were like quick, fast enough to see what's what's in that folder. There is a tiny little file. It's green. Not cuckoo cloth. That's something else I'll show you later. But it's also green. You do feel the team like green, green papers, green, lots of green, right? Well, okay. Anyway, the thing I didn't tell you is that I have a tiny little script. Let's have a look at it. I have it open over here. So what do I have here? I think it's pretty much the same. Well, actually, it's a little bit better than what you had. Really? Yeah, I think so. Well, the thing is that we start with like, I notify weight, which is pretty much the same thing that would actually go and go ahead and look for different events for a file. And then what I did is that I said that it should listen all the time, M, and then event type is a close write. So you close the file and you write to it. And then I add some just for fun. I just added some formatted the timestamps and everything and just things like that. So you can actually basically ignore what says in format and time format. And then I say which folder it should look for and should actually monitor. And well, it just goes on, right? And then it says, like, every time something happens, it would just kick an event. And then something fun happens. One thing is just echo stuff and puts in blah, blah, blah. But I really like this slide. Do any of you guys know what Streamer does? Well, you kind of could probably guess. It actually takes control of my webcam and takes a screenshot. So actually, I mean, I'm just not sending only email. I'm actually taking the picture of the guy. So let's see actually. I think I have a picture here called intruder JPEG. So who is that again, huh? It must be manipulated. It must be Photoshopped, right? Yeah, of course. All right, let's go with that. All right. Well, even pictures doesn't help. Well, okay, I'll try to think of something cool for the next time. But anyway, I mean, just if we could just go through the rest of it, it just basically does. It takes a picture. Then it encodes it to make it like email friendly. And then it types like your file has been changed, blah, blah, and say which file and so on, and sends an email saying like your profile has been changed, and it would send to my email. So now I'm probably going to get a lot of spam. It wasn't supposed to be my real email, but anyway, well, be nice, guys. Anyway, so that's kind of it. So monitoring is a good thing. And like when you put the joke aside, it's actually has some useful stuff to it. I mean, what you could do with monitoring, the thing we showed in both PowerShell and Bash, is that you can use that kind of commands, not just for that kind of fun, like monitoring your BashRC file or profiles or whatever. If you can actually use it for logging for something like you have a tiny system that, and you don't want to have full scale logging some environment that would just do like crazy stuff and monitor the heck out of it, you just have tiny little watcher that would actually go and watch through the log file. It would just look at the contents like all the time and look for a special kind of exception, which is really bad and really critical, and would just send an email or something. So you can actually do something useful stuff to that. And that's what we're going to do. We're going to show you through this kind of over presentation through this battle. We're going to show you, first going to show you some fun stuff, and then we're going to kind of try to see and to turn it around and show you actually the useful, how useful it actually can be in your everyday life. And then you can decide what you feel is the best way to do it. I mean, if you're stuck on Windows, why do you want to use Bash? Because you have SIGVAN. Because you can. You have Bash from Linux. No, I don't like that. I kind of reject that. Alright. So monitoring one folder for changes is quite useful. So if you want to parse logs, you want to listen for errors, or maybe you have a system that ships a lot of files into one folder. You might want to ship them somewhere. It can be useful in many, many scenarios. Yes, it is. It is really good. It is actually very good stuff. The other good stuff that could be useful for, actually, you can use it together with that, is actually looking for, it's like searching for files. I mean, that's kind of thing that you do quite often. I mean, I'm sitting on a Linux box, like on a server, whenever I have to build something or something, and then something goes wrong or whatever, and I have to search for the file, and I have to find that, and I have to look for contents in it. And let's just show you really, real quick. I mean, we don't have that much probably time, but let's just show you real quick how you can search for files, and then look for stuff and replace them just on the fly. You want to start? Now you can go ahead. Okay, I can. Alright, since I have the machine, let's do this. Oh, it's fantastic. It's awesome. It's like sparkly unicorns all the way. Yeah, we don't like sparkly unicorns. And you don't like them. The rest of the people like, right? How many like sparkly unicorns? Yay! It's not so many. And kittens. Kittens is important, right? Yeah. Alright, let's see. Let's see for something like searching for files. There is a really, really, really powerful command that's called find. I want to show you one thing. It's manual pages. If you want to see what command does, what kind of description it has, whatever. The documentation of that thing, just go there. And man page for find is horrendous. I mean, it's really long. It's like it's miles long, and it has lots and lots of functions, and it does lots of crazy stuff. So if you don't know how to use it, if you're not really familiar with that, do that, check it out, and see how it actually powerful it is. And it's quick, actually, too. It's really quick. So simple stuff would be like saying something like find catalog, which is like here. And I would say give me something that has name into there something. Let's see if it works. Yeah, it does. So I just looked through it through the folder, and then I look for intruder file. I have also copied, both of us have this folder, this scary folder, it's one gig of log files and XML files, which we kind of use for benchmarking stuff. I kind of ripped it from Microsoft program files and Windows files. Just basically parsing all the logs and XMLs. So it's kind of artificially made folder. Yeah, so it's quite the neat little directory structure just to have a demo. So you can basically what you can do is like config and then look for something that contains stars with web. Oh, that would be a lot probably. Like this, I guess. Yeah, just a web star. Yeah, look, it went through like a gig of files like this and just found everything and show you the path and everything. What you can do, you can actually, if you want to look for something inside those files, you can actually use some stuff like grep. This is the simplest way to do that. Minus r just would go recursively. And then we can say, well, I don't know, let's go for web config. Well, we probably lost. Yeah, it did. Looked like an error. No, just the red one is just the hit. So, yeah, this is simple stuff, right? That's the easy stuff. Can you do that? I mean, this is basic stuff that you would probably have to do every day, at least like quite often, right, for some automation. So show us some partial magic. How can you do that kind of stuff? I mean, let's start easy, right? Sure, let's just give people some base start. Yeah. So as in Bash, you have basically the same functionality here, but instead of using something like find, we have an easier way. So you can always, yeah. So for the people that use the Bash, you have ls, right? Basically in PowerShell, ls is an alias to get child item. And this is a really, really powerful command blitz. So we can say get child item. We can say recurs. Let's see. Let's go to the right folder first, so we'll have some demos, configs. That's a good folder, yeah. So basically we have lots of stuff in here. So I could, whoop, not use find, influenced by Bash here. I could say. That's a good thing. That's a good thing. I like that. You're coming over to the light side, like the light side. List items, get them recursively. I will filter and I could say, yeah, just give me the XML files in all the subfolders. And it scans all the different folders and returns them to me. Takes forever. Well, I did all the XML files, you matched for web configs. Still takes forever. I know. Okay, so let me just throw this in a variable. Let's see, web configs. Let's see if there is any. Web configs. There's a queue. Like a seven or eight or something. Yeah. That path is fast because there's not that many files. But what is really cool here is that actually everything that is returned is an object. So I can use this for my advantage. Here I have properties. These are all full files, system, all file info objects. So they have a full name. So you can see the path. They have the directory name. Let's see. They have the directory, get directories, create subdirectories. And basically you can access whatever you want from the file info object. That's quite useful. Let's find another file. We have the web config in here for replacing. Well, let's do the bash equivalent. We could say cats. So give me the content of web config. And it prints on screen. This can be used with a pipe. Just as in bash. So I can say for each object, I can show you the equivalent proper command for each object. Or we have an alias saying percentage. Let me just go ahead and replace every instance of the string. I'm going to replace service bus, for instance, as I can see here with NDC. Let's see if we got that right. That's interesting. Replace. That's cool. And as you see, the output is now replaced. Perfect. So this is unstructured data manipulation in any file. This can be extended. So I could replace multiple lines. So if I wanted to continue, I could escape this one. And I can use dash replace again. And I could continue replacing it. So here I could replace service bus. And then I could replace emulated and just keep on going to replace multiple keywords. So this is, like I said, unstructured formatting like in bash. But we have something also really, really cool, which is very powerful. So if we wanted structured data, I could say data. XML.config. Now I actually have an XML document. So I could get the members here. And here I have the complete DOM structure or XML document structure. So you can manipulate all the nodes and you can actually invoke the data. Let's see, data. Save method. Which takes a file name or a stream. So basically you can manipulate XML files structured really, really fast. So it's pretty neat. That's actually a pretty cool thing, actually. I have to admit. The difference is, the main difference you'll probably see here is that... PowerShell, I mean, everything is objects. It's like you can access things with dots. And then you can just say. something,. something. In bash, everything is text. So everything is a text. Your touchpad interface, your network card interface, everything is a text. Stream of text going back and forth. And then what you can do is pretty much the same thing, but you can't use this. thing. You have to. It's a different, it has something to do with the way of bash was built. And then it has the idea of spreading the responsibility, spreading stuff between small commands. Instead of putting everything in one thing and like shipping something with batteries included, it would just give you lots of pieces and says like, look, this, everything works. You can just put together the way you want and it will work and do whatever you want. So that's the kind of main difference that you will actually see through the whole presentation. It gives you more manual work as well. If you need to install third-party, a lot of third-party things or configure them. I mean, sometimes, but sometimes, I mean, you don't want to do your computer make food for you as well when you come home. So it's like, you know, sometimes you do. Sometimes I kind of wish that. Could you switch the thing? Yeah, sure. I'll just show you a real quick one more thing just with the replacing stuff. It's really simple way. But as I told you, everything is streams. Everything is text in Linux. So then you have a stream editor, which is called said that would do all the replacing for you. So what you can do is saying like something like, I'm not going to explain that much about the options and stuff. Just have a look at the man page if you want, I mean, or just ask or something. I mean, it's pretty easy. I mean, it's like self-documented. It's self-documented. It's like I and E and off of the alphabet. It's cool. So what you're going to do is they say that you use stream editor to say that you replace something. As for substitute, and then you have this string, my string. Or actually, let's see. You are my grandfather. Oh, nice. It talks. Yeah, PowerShell talks. PowerShell talks. You can do, you can make it make it. I still have my call. Yeah, it's really nice. But does it talk? It does. I have, I'll actually show you. It should be somewhere here. No, not it. It's supposed to say this. I have a tiny little dinosaur saying hello or oops. Kind of cute, right? Still, I'm not still going for your dark theme. I'm still giving it cool and like stuff nice and dinosaurs with hats and stuff. Okay, go back to set. Minus something, you would just go like substitute, internet with interwebs, right? Something like that. And then you want to be it like this. And then you say go through all XML files. And wait. I did something wrong. Let's see. It's probably a magic command. It's probably this. Why it's not working. Let's see. So in PowerShell you'd had really easy, complete. Like this. This stuff, that's what I used. I'm going to explain why I used that. I wanted to do this kind of stuff for some HTML files that I'm going to use later. And I wanted to replace that. That's what I used. And that works. But it just says that it's not directory because I think because it is set to, it doesn't like that there are directories there. But that's all right. Let's just move on. And it's actually pretty cool. But it's pretty much the same. The only thing that you might see the difference is the performance. It's the way it works and how fast. And Bash probably is a little bit faster since stuff are a bit more optimized. Can we time that? We can time that. We can actually do that. Let's check it out. But I mean, I'm not really sure about the time. So we can, can you just show real quick how you do that? Because that's kind of, this is kind of a good thing. Let me show you how you do it in Linux. You just do this. And let's see. I have a curl request somewhere here. Curl. Yeah, like this stuff. Let's see. Curl. Oh, good. It was good this year. Curl. This is an example that we're going to be using a little bit further on in the talk. But this is basically something that sends requests, gets adjacent, and parses it in like nice way. So if you want, if I want to see how long time it will take, I will just say time. And it would just give me a statistics how much it took time for kernel time. Yeah, let's look real time. It took me three, three point seven seconds. User and sys. It's like it's how much time it takes in a user user side or system side, which is like system size. That basically kernel time. Sir. Show the same. Show how it works. Let's see. I'm just going to go ahead and switch. Let's see. Clear. And there. So basically here I can use measure command in PowerShell. So measure command just gives you all the data you want for a command. So now I just did the one I did earlier by filtering and getting all the XML files from the catalog. And measuring command, it just gives me how long it took. Seconds, milliseconds, takes, whatever. Yeah. Pretty much the same then. So we could pretty much monitor which one that was. That's good. It's not sufficient, but we would need hardware I guess. We probably need similar hardware and stuff like that. Mine is so much cooler. Yeah, sure. My surface. Sure, sure. So basically another cool feature here is if I wanted to do like 10 of these and measure the exact same commands and getting an average, I could just pipe them all through and I could do pipe to measure commands and I could say, hey, let's measure the objects. Well, measure objects. Property, I could say average property and I could say takes. Let's see. Yeah. It will take a while. Let's just do four of them, three of them. Five. So basically now I just iterated the expression three times and I've calculated the average property of the ticks. It's quite neat. Awesome. All right. So also for searching files in PowerShell, you have a really nice filter called where object. So we could easily filter, say, give me the files again here. Let's just store these in a variable. So if you want to do the same thing, you would use define for just with a bunch of options and it would do pretty much the same thing. But again, it won't be like objects.something, something, but it would be just options, bunch of options. So this is quite readable. If I say where objects and I could say, go ahead, give me all the XML files, which has file length greater than a thousand. Then it will give me all the XML files that is a certain size. So it's quite neat. That's cool. Looks good. I mean, again, pretty much the same, just a little bit different approach. But yeah. All right. All right. So have you guys tweeted yet? I hope you did. Because the next thing, I mean, it's like since I was talking about interwebs, we're going to go into interwebs and we're going to do some magic stuff on the interwebs. Yep. And show us, show us some cool stuff. Show us what we did. So the intention of making you guys tweet is to see what you guys like the most. If you like PowerShell or if you like Bash and try to get a score. It's not too late to work on it. Just have some sense of battle, I mean. Just tweet. So basically, here in PowerShell, I just wrapped up third-party DLL just to make the O-Wall authentication much easier for me. So basically, I could do this manually, but it's a hassle. So I took a DLL, just imported it, and I set up a Twitter app. And I made some nice little wrappers so I can just do searching, searches for stuff. I can do search next. I can do check if it has more results or not. I'm not sure if you're familiar with the Twitter API. I could also post updates. So I could say, post. Oh, let's include this file. Post update text. Alt status. And easy as low. Let's give me one point. I want another point. So I posted an update so you can get the entire structure from here. But let's get the score. I made a little wrapper saying, search for it in the Z-A-Low PowerShell. And basically, my script now just searches for seven days past and you see it didn't start seven days ago, so it should be fine. And? Unless I invented Time Machine. I'm not too sure about that yet. So there's six counts tweeting our criteria now, which is an easy as low PowerShell. Interesting. If we just, let's try to find your score. Let's rerun it. 11 counts. Come on, guys. Come on. More PowerShell. Awesome, guys. Thank you. Thank you. Thank you so much. Let's wrap it up. I could get the results of who's actually doing it. So we could do some real warfare here. Let's see. I could, let's see. I could get these out, out grid view. See? Ah, here we get the structure. Nice. Nice. So I'm watching you guys. It's really fancy. User interface, of course. Right? Yeah, yeah, definitely. Windows. Yeah, perfect. All right. Anyway, let me just show you real quick because before we go move on. Can you do this in Bash, I mean? Yeah, I can do that. That's what I wanted to show you real quick. I mean, it's like, we're kind of talking too much. But the thing is that, are we on? Yes, perfect. I want to show you something interesting. I mean, it just, I'm not going to show you the whole thing, but I'm going to show you that it's possible to do the same thing. I mean, since it's battle, we kind of have to show that things could or can't be done. So I have a library that I just downloaded from internet. There was another guy that wrote that for us. Let's see. Actually, I want to open it in editor. Then I can say like home. I should replace all your editors. User name. Yeah, sure. That's all right. As long as it's not like Visual Studio or something, I'm cool. Let me see. The cool stuff is that there is like a wout and stream wout authentication and everything. And it's actually, it works. Let's have a look at Twitter. There we go. So pretty much the same. I mean, it's like it looks a bit, maybe a little bit more scary. It could be. I have to admit that. But it actually works and you can do that kind of stuff. You can do, you can use your actual shell to run like authentication and go into and run and get the stuff from internet from the rest from soap from whatever. And it's actually pretty cool. I mean, it's like, it's not just like your Java code or dot net or C sharp or whatever code that would actually do that is able to do that. You can actually use your shell. And another thing is that, I mean, you see, I mean, I'm running here virtually on a virtual Ubuntu box, but I mean, what you could do the same thing. I mean, pretty much, I mean, most of the same things you could do in SIGGVN, which is like Windows Brother or Step Brother or whatever off a Bash shell. So SIGGVN would be like, Pash would be on Linux. I mean, it's not fully functional. No, it's not fully functional, but you will get most of the things. I mean, it's way better than DOS anyway. I mean, like, common line. Nobody uses DOS anyway. Well, nobody. I really hope you don't guys use it really. Even though you think it looks like DOS. Oh, it does. Still does. All right. Okay. Let's let's move on from like joy and fun of web services of Twitter and stuff like that. Let's move on into a little bit more kind of work related stuff that would, again, something a bit more serious, right? Something you can actually use in your everyday life. Something you can actually use in your everyday life every time you have to do something. So what you can do is you can, I showed you already kind of, you got the sneak peek of that you can use. We have most of the companies. I mean, it's like, we do that. I guess you guys do that. We use for issue tracking. We use stuff like Jira or something like that. And most of those would have a rest user, rest interface, right? So what we did actually was to, we took a random Jira site that was actually hosted by the makers of the Jira, Plasio guys. They had the demo site up. So we took that we, which is, I made a variable so I don't have to type all that thing all the time. So what we did is, which is that's URL. And we get the project demo project of that thing. We just get the rest and show you all the issues for that project. And then you can do stuff with it. You can, like, get the creators, get dates, get status, get whatever. So you'd start kind of your imagination that kind of stops you from doing all the cool and awesome stuff in the common line. So what I do is like to say curl this, this one, this again, look, in partial, you would probably do that with like included stuff. There would be a function that would do that for you and show it and everything. In bash, you actually split it. And then you say, like, okay, curl would just return me the output. And then I can pipe that thing that dash there, that kind of this vertical thing is pipe. You pipe it, you just send the output into another program, which in this case I use Python. I always use, like, look for excuse to use Python. So I did that, of course. So basically what it does, it just prints it in a nice way. What you can do that you can do more with the Python stuff, you can actually, yeah, like this. And then you can do, like, let's see, I have some more stuff here. Curl like this. I do a bit more. I just import some stuff, just what I need for JSON. And I print issues. I look for tag, JSON tag issues. And I would just print all of them and they would just list them. There will be probably a lot of them now. But you can do all that kind of stuff. Yeah, you see it just outputs every old text and then you can look inside and everything is objects. And Python, everything is objects. Then you can actually traverse and do magic and do stuff and do whatever actually you want to do with that. Show us some of the same kind of stuff in PowerShell. Sure. So in PowerShell you don't need external libraries in the same way. No. As long as you have the correct PowerShell version, there's a lot of neat little help features for you that does that. I just wrapped the show score from earlier. So now we can actually search for both. At the same time? At the same time. So now we're equal. There's a 13 count on each. So we're even. All right. I think you fixed it. No, no. We can show who's tweeting afterwards. All right. All right, let's go back to the G-Rack example. Okay, let's go. So basically, in PowerShell you have a nice little commandlet called invoke web requests or you can invoke REST method. Bash guys, you have to tweet more. Sorry, you were saying? I'm just going to scroll up here to the tweets. There we are. Remember to tweet. So invoke REST method. It basically just invokes a regular REST method and it serializes your data. So I can say g-raw URL. I just wrapped the demo URL here. I'm going to say data and invoke the REST method. It's the same URL, right? And then you can see it's actually fetching the stream. So in PowerShell everything as well is a stream. So you can pipe streams through the chain. But what's really, really neat here is that I have actually a JSON serialized structure. So you can just take a look here, data. I get auto completion. So there's issues. There's a lot of issues, apparently. So I'm just going to go ahead and say, let's see, give me the fields, actually. I think those are the ones that are actually, let's see. Here there's a fields property. I can actually just expand this one as well. So I'm just using the data structure I'm getting back to actually filter all this stuff. Interesting. So here are all the fields that's returned from the JSON structure on all the issues. So by using this information I can easily just say, I'm going to select something. I'm going to go ahead and say data issues, fields. Select. I'm going to go ahead and select, well, there's something called summary, I think. At least not summary. Type O. So data issues, fields, fields, and select summary. Summary. Was that right? Yeah. There we go. So now it fetched the summary. I could also go ahead and say, is there a creator? For you non-JR guys, it's basically a description of the issue. Creators. Yeah, there we go. And as you can see, there's a creator object. And I could go ahead and expand that object in my select method so I could expand the creator dot something, dot something. And I could actually make a really neat little list and export this JSON data to any format I want. So basically, if this is a JSON structure, I could easily just say, hey, give me this structure, convert to, and you see order completion. Nice. So convert to CSV, HTML, JSON, secure string, which doesn't make sense in this context. Convert to web application, no. But basically, I have a neat set of conversion methods just to play with the data. So it's quite easy. That's cool. That's right. So that was the small JIRA integration. And usually, that's quite useful if you have continuous integration or you have tasks that needs to be fetched and then combined with other stuff. It can be a really, really nice. Like putting together, for example, like your JIRA tasks with the code you committed or something like that, and you want to pull your commits and you have to put them together in some magic way and do something like that. So that's what kind of things you could do. And that's actually pretty neat. And I use that in my previous project quite a bit because where I wanted to see who committed what and what time and what kind of things we deliver whenever we do delivery, what kind of commits and what kind of JIRA cases issues that we're actually delivering and stuff like that. So it's actually pretty cool. It's actually good, useful stuff. Yeah. But also, another really annoying thing during your everyday life is working log hours. And just as a small example, I have this really neat little site which I proxied. It's one site I worked with earlier and I proxied it to local hosts. And it's not working in any other thing than IE. Oh, god. This is the fun part. So basically, if I pull this one up in Chrome, it shows me this. It works in PowerShell, right? Well, yeah, well, of course. Well, no. This is the thing I'm going to show you. If you have a really painful website, which only, well, is this IE? Yeah, this is IE. Wow, that's great. It doesn't work in the URL. I copied the URL. Oh, perfect. It's quite bad. So if I go here, it's working in IE. And in Chrome, it's not working. And this is a really great system. You have to manually register your work hours every freaking day. And it requires a username. There's no auto completion. It requires you to input the date and the project number. And there is really no help in this interface at all. No. And of course, you need to submit every day. So I could easily automate this. I could use something like Casper or a third-party integration tool, which might work, but no guarantees. Probably will. Yeah, if you tweak the headers a little bit and says that you are IE. But I could actually on Windows use the IE com object just because I like pain. It is a lot of pain. So I could say, I could go ahead and create a new object. I'm going to say com object and Internet Explorer, Internet Explorer application. I'm just going to go ahead and close this one. Oh, application. So save that and let's run that one. Now I have IE. So it's a com object. Wow. Wow. Yeah. It's amazing. Nice. It's a mess. Well, I mean, I think common com objects are bad enough. So I don't want to go back to any further. So by using the IE object, I could say navigate to. I could go ahead and say local hosts. I'm just going to go ahead and do this. I'm going to copy this to my scripts. So navigate to local host and I'm going to say IE visible equals true. So this is a really, really simple workflow so far. So executed and I have IE running in the background there. Oh, yeah. There we are. Oh, where did it go? There we are. So small little window. It doesn't really matter. But what I could do is I could say IE documents. I could say get element by ID, username, value. I could say my username. If this works, oh. Well, it's probably a typo somewhere. Value, text, text or value, value. I can't remember the DOM structure. Maybe something like this. Yeah, there we go. All right. So it set my value. Nice. So just by invoking these really small com object commands and using the DOM tree back, I could automate this process every day. And I could put it up as a scheduled task running every day at four just by inputting some data. For instance. Just random numbers. Just random numbers just to make the compliance work. There are a few people just like the numbers. So basically, how would you do this in Bash? Well, maybe not for the IE object. No, definitely not going to do it for IE objects really. It's, I don't want to do that. But anyway, but what I can do is to do it a bit more generic way. I have, let me start my little proxy here. I also created a tiny little proxy. And I kind of was looking for an example. And I was like, yeah, well, you have your hours thing, which is kind of, that would be lame to use the same. So I kind of wanted to find something else. So I thought of, I have a gym. I go to gym. I like to go there and they have classes and they have a system that kind of sucks a little bit. I mean, you have to sign up for the classes week before. And if you do that like five days instead of seven days before, it's probably everything is full and you have to wait and see and you know that kind of stuff. So what I did is just I made a proxy. I created a kind of a local version of that and I anonymized the whole thing. So you probably hopefully won't know what gym it is. Political reasons. For some political and legal reasons and kind of I don't want to get sued reasons. I also anonymized the whole names and everything. So basically it's like this and then you have your, so it's in a region, but basically it's a your center. Try a workout like gym set thing and then you go for like, okay, I want to go to this and I want to select, I want to go from Tuesday and it's like, oh, they have spinning on at seven o'clock in the morning. That's perfect. That's what I want to do in the morning before work. Sounds like good plan. Right. And then you sign in and okay, it says like, yeah, you're registered now. Right. So basically what you guys can do, I can just create a list of stuff and say that I want you to actually sign me up for those and those and those. And those classes. And that would be actually really cool. Right. So what I did is do to do it a little bit more generic way. You mentioned actually already Casper Casper jazz and I actually did that. I mean, again, I mean, I don't have anything built in. So I have to improvise. And that's what I did. And I created. Let's have a look at it. I think it's called sample. I created a tiny little file that does really simple stuff. I mean, it's like, that's not what you normally would do. But still, it basically would go and find, let's go to the top. This stuff would just turn on some debug. I removed that. But this is kind of a good thing to know. You can actually add some verbose mode and debugging and stuff. What would do what you want to do? It's like you go to your L and then you go like you set the size of your window. Just for fun of it. Because it's not a browser, so it doesn't know how big it is and stuff. Then you go to the first drop down. You select some kind of thing. You change it. The first drop down, you remember the center, right? Name of the center because they have different ones. Then the second drop down would be like a date. And I select some kind of date. And then I'll just click on a button. And let's see if I run that thing and see if demo effect actually, I hope it works. Well, I hope demo effect doesn't work, but I hope the script works. So let's see. All right. And what it did, I didn't show you that. At the end here, it actually takes a screenshot of how page would look. So if everything was right, there should be a page of like congratulations. You've been signed up for a course. So let's see. It is in development and battle. And there should be a screenshot. It is. And it is new, right? I mean, how, yeah, look, I've been booked. I have booked the spinning thing. And just see when it was created just to see that I didn't cheat or anything. Yeah, it's now. It's like 1714. That's right. Modified. Initiation termination sequence. All right. All right. That's kind of interesting. That was actually kind of a hint of what we have to do because we don't have that much time now. Notice the middle launcher. We're not going to get. Don't go there. Don't go there, really. So we thought it wouldn't be a battle unless we have some gadgets shooting at each other. So basically, we do what we did was actually, I basically added a DLL using the windows 8.1 USB hub library. So I hooked up this neatly USB missile launcher and then I had to think what should I use for something that contracts like a missile thing. Right. And then I thought like there are some guys that thought about that before and they almost hit me. Actually, I thought of you're going to need those. Yeah, probably going to need those for now. Then I thought like what kind of country, well, some kind of country that should not be named anyway, but that use something to contract missiles and everything. So I went for drones. Right. Let's see. Well, actually, you guys in the first row, we should practice like ducking. Just in case it goes towards you, just should we practice or you're cool? No, you're right. Perfect. Let me see. And then, of course, I mean, like it wouldn't be like a command line battle if we wouldn't use that stuff from command line. Right. So what we're going to do, we're going to actually control both of those things from command line. He's going to do it from poor shell. I'm going to control that thing from Bash. And I'm going to be, I'm going to go nice on you and I'm just going to do what I'm going to do is just go up, stay there, Hoover for a little while and just go down. All right. So then you have to hit it. That's right. Maybe your laptop is in the way. Yeah, we'll see. We'll see. I can do that. It's all right. Yeah, I can move. And let's see, do you want to switch just to show people what I'm actually doing? Sure. Okay. All right. I have a tiny little JavaScript here that would actually control the whole thing. And then I'm going to do like node. I'm using node.js for that. And drone. Remember ducking, right? Just go down. Just to be safe. Play dead, basically. If anything goes wrong, just play dead. Let's see. The moment of truth. You ready? Yeah. Die bash. Let's see. Oh, close. That's a miss. Oh, that's the wrong way. That's the wrong way. That's a miss. And miss again. No. It's landing. Too late. I can do it again. Move down. It's okay. I can do that again. I can shoot while it's down. No, it's not shoot when it's down. Come on. Yeah. Well, I would probably wrap it up now. All right. I have three more measles. Like, could probably hit it. Shoulda coulda woulda. But it just illustrates the point. You can easily integrate anything you want. And it's the power of the show. At the end, I want to really want to show you this one. It's really cool. That's how you can convert your server to a Kuku clock. It would just take the ejector cedar on. I mean, you have to have cedar on. You have to have a cedar on. You have to have a CD-ROM. You see it's an eject CD-ROM, and then it would make the cuckoo sound. So imagine somebody walking into the server room and just did that thing, just cuckooing there, you know. That would be so awesome. I just have to show you. Anyway, we're done. What way is it to show the score? Let's see. Oh, we have to show the score. Come on, two weeks. Let's see. Is there any score? Let's run this thing. Oh, I'm so excited. Oh, haha! 16-16. Oh, God. Oh, that's a good fight, then. Alright. Nicely done. Well done. Thank you. That concludes. So, if you have any questions, feel free to ask. That's my email and my Twitter. I'll post my Twitter. I'll show you mine. And you can easily find my email. And it's on the start of the slides anyways. And I can switch. You can switch and then I can show people my contact information as well. It's there. Just for the record. That's my Twitter and my email. Remember to vote the green for the yellow. Or the red. Or the red. How you like to talk. Yes. If you have any questions, feel free to come up here or just ask. Thank you. Thank you. Thank you.
 Is it working?  Yes, I think it's mine, it's working as well.  All right, good.  All right, let's start.  Welcome, welcome, Amaran.  And as you know, we're going to have a battle,  and so there will be things, there will be blood,  there will be swearing, no, we won't.  We'll try to be nice, at least a little bit in the beginning.  Do you want to start?  We can start, and then we can switch.  Sure.  So, I will be representing PowerShell,  and this is my name, and I'm working with Foshe,  and I've been a PowerShell enthusiast for quite a while.  It's called Addict.  Addict, PowerShell user, whatever.  Once you get into it, it's hard to stop from there.  Good, all right.  All right, so, and you should probably say...  I'll do that, just could you...  We have this fancy thing, we have to push the button.  Yeah, now it's my turn.  So, this is me.  I'm going to be representing Bash,  and while I have to say, I have been addicted to Bash  for, I don't know, over 10 years, 15 years probably,  so, yeah, well, and I work at Compitose,  and I'm going to try to show you some cool stuff about Bash today.  So, there is one thing.  We need your votes.  We really need your votes.  We need your tweets.  So, basically, what you have to do is, what's there,  you just say, and this here, slow, and then you say Bash,  or...  PowerShell.  PowerShell, and whatever you want.  So, basically, we're going to be looking for those two hashtags.  Why you'll see later on, and how.  All right, I'll switch over here,  so you can quickly take a look at the PowerShell tag.  This is what you want to vote, of course,  and vote smart, vote for PowerShell.  No.  So, are you guys ready?  Yay!  Come on.  All right.  And then we kind of thought that this kind of battle,  it has to be like, kind of, you know,  within real, like, battle traditions,  so we should kind of present in, like,  in the left corner, there is a Herald,  representing PowerShell.  Yes.  And in the right corner, representing Bash.  It's me, Rustam.  Yay!  Thank you.  All right.  Let's kick things off.  So, I'm going to go ahead and start,  because I already have the computer online here.  Perfect.  Let's see.  You start.  I'll show the good parts.  Do the duplicate screen thing here first.  So, all right.  This is a nice little Windows screen.  Oh, and the foils.  Okay.  So, I'm going to go ahead and start PowerShell.  Ice.  And I'm going to render that admin,  because I want all the privileges I can get.  So, ah.  Your shell is ugly, and it looks like MS-GOS.  Well, since there are microphones,  I'm going to repeat that.  Totally.  I mean, no, no, like, I have nothing to do with that.  I'll just repeat it.  He just said that his shell is ugly,  and it looks like DOS.  Yeah, well.  That's for the record.  Well, at least I can change it quite easily,  compared to what you can do in Bash.  I mean, I can just change the colors here.  Yeah, but you need to.  He can change it to black and white.  So, it looks like DOS.  Basically, I have all the options I need.  So, I can change it from not looking like DOS.  Anyways, so, I'm just going to kick everything off.  So, I'm just going to go ahead and say,  do awesome.  And we can just admire the power of the shell.  It's good.  It's so wonderful, isn't it?  So, this is a little memory stream that's actually writing to the system beep.  The nerd factor of this talk, just skyrocketed.  What do you got in Bash?  Well, I mean, now we know who the dark side is, right?  So, I'm going to go for safe stuff,  and just like with kittens and animals and stuff like that, right?  So, I'm going to show you some, wait a second.  I'm going to show you something really nice.  Can you see the, oh, you can't.  Good.  That's a yelp.  It's another feature of Microsoft Windows.  It kind of switches this stuff for you.  That's the Linux yellow screen of death, almost.  Yeah, well, it's nice, you know.  Let's see.  Can we...  Technical.  We have some technical difficulties.  We go for duplicate.  It's a power point changing the screens and stuff.  So, I have something really nice.  I have something like that.  Welcome to NDC.  Oh, isn't it nice?  Isn't it cute?  Yeah.  Yeah.  It's pretty cool.  It's the light side.  It's the dark side has cookies.  We don't.  We have cows and stuff.  Yeah.  And kittens.  All right.  So, what?  Do you want me to show you something?  Something more awesome, I mean.  Okay.  Let me start you showing you some cool stuff.  And in this shell, let me just go to...  What was that?  What happened?  Something is wrong.  Something is wrong.  Something kind of looks weird.  It looks like a kernel panic.  Oh, wait.  That wasn't...  Wait, PowerShell rocks?  Come on, dude.  We're in presentation.  It looks like you're already completed.  I mean...  Come on.  I trust you not to do that kind of stuff.  I don't know.  I'm innocent.  Yeah, right.  You're innocent.  I kind of don't believe that.  I mean, my computer wouldn't do that kind of things.  Of course it would.  Yeah, right.  Okay.  Well, okay.  Let's see.  Well, I mean, the thing is that...  Let me just fix it.  His screw up a little bit.  I don't know what you're talking about.  Well, he's still...  Yeah, right.  Yeah, okay.  Well, you know, let's start with the profiles.  Since we're there, just let me show you just a little bit of profiles and stuff and see  how actually that kind of things could be done.  We have...  In Bash, you have profiles which are...  There are like different places and there is one main one which is at...  It's at...  Can you see or should I increase the font?  I can do that.  I can do this and I can actually go full screen on this.  It looks so much cooler.  Is it better now?  More?  Like this?  All right.  Let me show you.  Oh, let's go for like...  The main one, the main profiles thing is here.  Oh, wait.  It's in...  Oh, it's in here.  Profile.  So this is kind of the main thing that's for all users and stuff and then where you can  define things, you can define your own variables and it kind of gives you the flexibility of  adding your own functions, your own stuff.  We'll look at more what kind of stuff later, but basically this is kind of lets you create  shortcuts for your things, the things you type, the things you type more often.  And there is also a local version of that which is for your user which is there, which  is kind of your own customizations for just that user that is logged in and then you see  I have my own customizations and stuff added there which I kind of going to use for later  on.  That thing is placed, it's at your home slash your user name.  I have a fantastic user name.  I'm really proud of it, by the way.  It can get really critical.  It can get really scary sometimes.  I did type it a couple of times instead of the login window, I tucked it in the shell.  I stopped in time so no harm is done, but yeah, it kind of could be a little bit different.  Another cool thing, I mean what you can do, what you can put in those profiles is functions.  So you can actually create like a easy tiny little function like, well, the example I  usually like to show is the one like how often do we like say CD to something and then go  to CD to something else and then you take LS there to see what's inside, right?  What you could do is to create a function called CDL that would do both things at the same time, right?  So then you can just do like this and then you say I want to go to CD to something which is,  and that something is the first parameter that the function gets.  And then you can say like LS minus, I don't know, LA, something like that just to see the contents of it.  And then you can just go like CDL and NDC battle.  It will do both things.  So you go there and show the stuff.  What do you get?  Do you have some kind of stuff like that?  Yeah, definitely.  Show something cool and powerful.  Okay, so if you took a mental note of the function in bash, it's really ugly.  It's really ugly.  I mean, you're passing parameters with a dollar sign.  So in the PowerShell, I could just do a function, do something, and I could pass a name parameter.  And then I'm actually able to use this for later.  So I could say do something and then get auto completion.  So it's pretty neat.  It actually helps me to write better functions.  Well, you have auto completion in bash as well.  It's called tab.  But it's not as pretty.  So, he spoke a little bit about profiles.  And the thing that just happened to your shell couldn't happen to mine because basically,  I could set up a monitor to listen for events on my profiles.  So PowerShell has the same concept of profiles.  They're just stored more centralized.  So basically, we have a variable called profile.  There's just one one up.  No.  Oh, no, there's multiple profiles.  But here it's all grouped together so you can have a profile for all users, all different hosts.  You can have one for the current user, all hosts, and you can have for different variants of that.  It's actually cool.  It's a so you don't have to remember any paths in particular.  You can also print them if you want.  So I'm just going to go ahead and show you my profile.  I'm going to say current user, current all hosts because I have something in this file.  So basically here, I've set up a customized profile and I've added some neat little tricks like new item.  I've added a default parameter.  So every time I'm trying to create an item, I don't have to type dash item type file every time.  I can just say new item and then it creates a file for me.  So it's just small details that makes life a little bit more easy.  But for the monitoring part, PowerShell has a really fancy way of registering events and listening to events.  And since you're already based on the full.NET stack, you can basically use any component you want.  So what I did, oh, I've done this earlier some many times because it's quite useful in many projects.  Let's see, I'm going to go ahead and grab one of my scripts.  Is it big enough?  It's readable.  I can probably make it a little bit smaller if I can read it.  A little bit smaller, yeah, I guess that should be fine.  So basically I've made a function to watch for changes and this one takes either a directory or a file.  And there's some logics, there's some if sentences, which is quite readable compared to what bash is.  You're right.  But basically what this does is creates a file system launcher and it registers for the events and then it pushes them.  So every time a file changes, I'm actually sending an email.  Okay.  So if I wanted to use the script, I could basically just say, what register, what did we call it?  I have up here it's watch changes.  So I could say watch changes, path, profile.  Yeah, let's do it.  Current user, all hosts.  And let's save this and run this.  And you can see it's writing some debug info because I put debug preferences on.  And if I now try to change my profile, just say save, it's sending me an email.  So it's pretty.  So I can't actually pay you back, right?  That's what you're telling me.  Yeah, pretty much.  At least I'll know you changed something.  Oh, interesting, interesting.  You know, I think I have to, I have to, I have to tell something.  I kind of didn't want to tell you earlier today, just in a couple of minutes ago.  But I don't know if you guys were like quick, fast enough to see what's what's in that folder.  There is a tiny little file.  It's green.  Not cuckoo cloth.  That's something else I'll show you later.  But it's also green.  You do feel the team like green, green papers, green, lots of green, right?  Well, okay.  Anyway, the thing I didn't tell you is that I have a tiny little script.  Let's have a look at it.  I have it open over here.  So what do I have here?  I think it's pretty much the same.  Well, actually, it's a little bit better than what you had.  Really?  Yeah, I think so.  Well, the thing is that we start with like, I notify weight, which is pretty much the same thing  that would actually go and go ahead and look for different events for a file.  And then what I did is that I said that it should listen all the time, M, and then event type is a close write.  So you close the file and you write to it.  And then I add some just for fun.  I just added some formatted the timestamps and everything and just things like that.  So you can actually basically ignore what says in format and time format.  And then I say which folder it should look for and should actually monitor.  And well, it just goes on, right?  And then it says, like, every time something happens, it would just kick an event.  And then something fun happens.  One thing is just echo stuff and puts in blah, blah, blah.  But I really like this slide.  Do any of you guys know what Streamer does?  Well, you kind of could probably guess.  It actually takes control of my webcam and takes a screenshot.  So actually, I mean, I'm just not sending only email.  I'm actually taking the picture of the guy.  So let's see actually.  I think I have a picture here called intruder JPEG.  So who is that again, huh?  It must be manipulated.  It must be Photoshopped, right?  Yeah, of course.  All right, let's go with that.  All right.  Well, even pictures doesn't help.  Well, okay, I'll try to think of something cool for the next time.  But anyway, I mean, just if we could just go through the rest of it, it just basically does.  It takes a picture.  Then it encodes it to make it like email friendly.  And then it types like your file has been changed, blah, blah, and say which file and so on,  and sends an email saying like your profile has been changed, and it would send to my email.  So now I'm probably going to get a lot of spam.  It wasn't supposed to be my real email, but anyway, well, be nice, guys.  Anyway, so that's kind of it.  So monitoring is a good thing.  And like when you put the joke aside, it's actually has some useful stuff to it.  I mean, what you could do with monitoring, the thing we showed in both PowerShell and Bash,  is that you can use that kind of commands, not just for that kind of fun,  like monitoring your BashRC file or profiles or whatever.  If you can actually use it for logging for something like you have a tiny system that,  and you don't want to have full scale logging some environment that would just do like crazy stuff  and monitor the heck out of it, you just have tiny little watcher that would actually go and watch  through the log file.  It would just look at the contents like all the time and look for a special kind of exception,  which is really bad and really critical, and would just send an email or something.  So you can actually do something useful stuff to that.  And that's what we're going to do.  We're going to show you through this kind of over presentation through this battle.  We're going to show you, first going to show you some fun stuff,  and then we're going to kind of try to see and to turn it around and show you actually the useful,  how useful it actually can be in your everyday life.  And then you can decide what you feel is the best way to do it.  I mean, if you're stuck on Windows, why do you want to use Bash?  Because you have SIGVAN.  Because you can.  You have Bash from Linux.  No, I don't like that.  I kind of reject that.  Alright.  So monitoring one folder for changes is quite useful.  So if you want to parse logs, you want to listen for errors, or maybe you have a system that ships a lot of files into one folder.  You might want to ship them somewhere.  It can be useful in many, many scenarios.  Yes, it is.  It is really good.  It is actually very good stuff.  The other good stuff that could be useful for, actually, you can use it together with that,  is actually looking for, it's like searching for files.  I mean, that's kind of thing that you do quite often.  I mean, I'm sitting on a Linux box, like on a server, whenever I have to build something or something,  and then something goes wrong or whatever, and I have to search for the file, and I have to find that,  and I have to look for contents in it.  And let's just show you really, real quick.  I mean, we don't have that much probably time, but let's just show you real quick how you can search for files,  and then look for stuff and replace them just on the fly.  You want to start?  Now you can go ahead.  Okay, I can.  Alright, since I have the machine, let's do this.  Oh, it's fantastic.  It's awesome.  It's like sparkly unicorns all the way.  Yeah, we don't like sparkly unicorns.  And you don't like them.  The rest of the people like, right?  How many like sparkly unicorns?  Yay!  It's not so many.  And kittens.  Kittens is important, right?  Yeah.  Alright, let's see.  Let's see for something like searching for files.  There is a really, really, really powerful command that's called find.  I want to show you one thing.  It's manual pages.  If you want to see what command does, what kind of description it has, whatever.  The documentation of that thing, just go there.  And man page for find is horrendous.  I mean, it's really long.  It's like it's miles long, and it has lots and lots of functions, and it does lots of crazy stuff.  So if you don't know how to use it, if you're not really familiar with that, do that, check it out,  and see how it actually powerful it is.  And it's quick, actually, too.  It's really quick.  So simple stuff would be like saying something like find catalog, which is like here.  And I would say give me something that has name into there something.  Let's see if it works.  Yeah, it does.  So I just looked through it through the folder, and then I look for intruder file.  I have also copied, both of us have this folder, this scary folder,  it's one gig of log files and XML files, which we kind of use for benchmarking stuff.  I kind of ripped it from Microsoft program files and Windows files.  Just basically parsing all the logs and XMLs.  So it's kind of artificially made folder.  Yeah, so it's quite the neat little directory structure just to have a demo.  So you can basically what you can do is like config and then look for something that contains  stars with web.  Oh, that would be a lot probably.  Like this, I guess.  Yeah, just a web star.  Yeah, look, it went through like a gig of files like this and just found everything  and show you the path and everything.  What you can do, you can actually, if you want to look for something inside those files,  you can actually use some stuff like grep.  This is the simplest way to do that.  Minus r just would go recursively.  And then we can say, well, I don't know, let's go for web config.  Well, we probably lost.  Yeah, it did.  Looked like an error.  No, just the red one is just the hit.  So, yeah, this is simple stuff, right?  That's the easy stuff.  Can you do that?  I mean, this is basic stuff that you would probably have to do every day, at least like  quite often, right, for some automation.  So show us some partial magic.  How can you do that kind of stuff?  I mean, let's start easy, right?  Sure, let's just give people some base start.  Yeah.  So as in Bash, you have basically the same functionality here, but instead of using  something like find, we have an easier way.  So you can always, yeah.  So for the people that use the Bash, you have ls, right?  Basically in PowerShell, ls is an alias to get child item.  And this is a really, really powerful command blitz.  So we can say get child item.  We can say recurs.  Let's see.  Let's go to the right folder first, so we'll have some demos, configs.  That's a good folder, yeah.  So basically we have lots of stuff in here.  So I could, whoop, not use find, influenced by Bash here.  I could say.  That's a good thing.  That's a good thing.  I like that.  You're coming over to the light side, like the light side.  List items, get them recursively.  I will filter and I could say, yeah, just give me the XML files in all the subfolders.  And it scans all the different folders and returns them to me.  Takes forever.  Well, I did all the XML files, you matched for web configs.  Still takes forever.  I know.  Okay, so let me just throw this in a variable.  Let's see, web configs.  Let's see if there is any.  Web configs.  There's a queue.  Like a seven or eight or something.  Yeah.  That path is fast because there's not that many files.  But what is really cool here is that actually everything that is returned is an object.  So I can use this for my advantage.  Here I have properties.  These are all full files, system, all file info objects.  So they have a full name.  So you can see the path.  They have the directory name.  Let's see.  They have the directory, get directories, create subdirectories.  And basically you can access whatever you want from the file info object.  That's quite useful.  Let's find another file.  We have the web config in here for replacing.  Well, let's do the bash equivalent.  We could say cats.  So give me the content of web config.  And it prints on screen.  This can be used with a pipe.  Just as in bash.  So I can say for each object, I can show you the equivalent proper command for each object.  Or we have an alias saying percentage.  Let me just go ahead and replace every instance of the string.  I'm going to replace service bus, for instance, as I can see here with NDC.  Let's see if we got that right.  That's interesting.  Replace.  That's cool.  And as you see, the output is now replaced.  Perfect.  So this is unstructured data manipulation in any file.  This can be extended.  So I could replace multiple lines.  So if I wanted to continue, I could escape this one.  And I can use dash replace again.  And I could continue replacing it.  So here I could replace service bus.  And then I could replace emulated and just keep on going to replace multiple keywords.  So this is, like I said, unstructured formatting like in bash.  But we have something also really, really cool, which is very powerful.  So if we wanted structured data, I could say data.  XML.config.  Now I actually have an XML document.  So I could get the members here.  And here I have the complete DOM structure or XML document structure.  So you can manipulate all the nodes and you can actually invoke the data.  Let's see, data.  Save method.  Which takes a file name or a stream.  So basically you can manipulate XML files structured really, really fast.  So it's pretty neat.  That's actually a pretty cool thing, actually.  I have to admit.  The difference is, the main difference you'll probably see here is that...  PowerShell, I mean, everything is objects.  It's like you can access things with dots.  And then you can just say. something,. something.  In bash, everything is text.  So everything is a text.  Your touchpad interface, your network card interface, everything is a text.  Stream of text going back and forth.  And then what you can do is pretty much the same thing, but you can't use this. thing.  You have to.  It's a different, it has something to do with the way of bash was built.  And then it has the idea of spreading the responsibility,  spreading stuff between small commands.  Instead of putting everything in one thing and like shipping something with batteries included,  it would just give you lots of pieces and says like, look, this, everything works.  You can just put together the way you want and it will work and do whatever you want.  So that's the kind of main difference that you will actually see through the whole presentation.  It gives you more manual work as well.  If you need to install third-party, a lot of third-party things or configure them.  I mean, sometimes, but sometimes, I mean, you don't want to do your computer make food for you as well when you come home.  So it's like, you know, sometimes you do.  Sometimes I kind of wish that.  Could you switch the thing?  Yeah, sure.  I'll just show you a real quick one more thing just with the replacing stuff.  It's really simple way.  But as I told you, everything is streams.  Everything is text in Linux.  So then you have a stream editor, which is called said that would do all the replacing for you.  So what you can do is saying like something like, I'm not going to explain that much about the options and stuff.  Just have a look at the man page if you want, I mean, or just ask or something.  I mean, it's pretty easy.  I mean, it's like self-documented.  It's self-documented.  It's like I and E and off of the alphabet.  It's cool.  So what you're going to do is they say that you use stream editor to say that you replace something.  As for substitute, and then you have this string, my string.  Or actually, let's see.  You are my grandfather.  Oh, nice.  It talks.  Yeah, PowerShell talks.  PowerShell talks.  You can do, you can make it make it.  I still have my call.  Yeah, it's really nice.  But does it talk?  It does.  I have, I'll actually show you.  It should be somewhere here.  No, not it.  It's supposed to say this.  I have a tiny little dinosaur saying hello or oops.  Kind of cute, right?  Still, I'm not still going for your dark theme.  I'm still giving it cool and like stuff nice and dinosaurs with hats and stuff.  Okay, go back to set.  Minus something, you would just go like substitute,  internet with interwebs, right?  Something like that.  And then you want to be it like this.  And then you say go through all XML files.  And wait.  I did something wrong.  Let's see.  It's probably a magic command.  It's probably this.  Why it's not working.  Let's see.  So in PowerShell you'd had really easy, complete.  Like this.  This stuff, that's what I used.  I'm going to explain why I used that.  I wanted to do this kind of stuff for some HTML files that I'm going to use later.  And I wanted to replace that.  That's what I used.  And that works.  But it just says that it's not directory because I think because it is set to,  it doesn't like that there are directories there.  But that's all right.  Let's just move on.  And it's actually pretty cool.  But it's pretty much the same.  The only thing that you might see the difference is the performance.  It's the way it works and how fast.  And Bash probably is a little bit faster since stuff are a bit more optimized.  Can we time that?  We can time that.  We can actually do that.  Let's check it out.  But I mean, I'm not really sure about the time.  So we can, can you just show real quick how you do that?  Because that's kind of, this is kind of a good thing.  Let me show you how you do it in Linux.  You just do this.  And let's see.  I have a curl request somewhere here.  Curl.  Yeah, like this stuff.  Let's see.  Curl.  Oh, good.  It was good this year.  Curl.  This is an example that we're going to be using a little bit further on in the talk.  But this is basically something that sends requests, gets adjacent, and parses it in like nice way.  So if you want, if I want to see how long time it will take, I will just say time.  And it would just give me a statistics how much it took time for kernel time.  Yeah, let's look real time.  It took me three, three point seven seconds.  User and sys.  It's like it's how much time it takes in a user user side or system side, which is like system size.  That basically kernel time.  Sir.  Show the same.  Show how it works.  Let's see.  I'm just going to go ahead and switch.  Let's see.  Clear.  And there.  So basically here I can use measure command in PowerShell.  So measure command just gives you all the data you want for a command.  So now I just did the one I did earlier by filtering and getting all the XML files from the catalog.  And measuring command, it just gives me how long it took.  Seconds, milliseconds, takes, whatever.  Yeah.  Pretty much the same then.  So we could pretty much monitor which one that was.  That's good.  It's not sufficient, but we would need hardware I guess.  We probably need similar hardware and stuff like that.  Mine is so much cooler.  Yeah, sure.  My surface.  Sure, sure.  So basically another cool feature here is if I wanted to do like 10 of these and measure  the exact same commands and getting an average, I could just pipe them all through and I could  do pipe to measure commands and I could say, hey, let's measure the objects.  Well, measure objects.  Property, I could say average property and I could say takes.  Let's see.  Yeah.  It will take a while.  Let's just do four of them, three of them.  Five.  So basically now I just iterated the expression three times and I've calculated the average  property of the ticks.  It's quite neat.  Awesome.  All right.  So also for searching files in PowerShell, you have a really nice filter called where  object.  So we could easily filter, say, give me the files again here.  Let's just store these in a variable.  So if you want to do the same thing, you would use define for just with a bunch of options  and it would do pretty much the same thing.  But again, it won't be like objects.something, something, but it would be just options, bunch  of options.  So this is quite readable.  If I say where objects and I could say, go ahead, give me all the XML files, which has  file length greater than a thousand.  Then it will give me all the XML files that is a certain size.  So it's quite neat.  That's cool.  Looks good.  I mean, again, pretty much the same, just a little bit different approach.  But yeah.  All right.  All right.  So have you guys tweeted yet?  I hope you did.  Because the next thing, I mean, it's like since I was talking about interwebs, we're going  to go into interwebs and we're going to do some magic stuff on the interwebs.  Yep.  And show us, show us some cool stuff.  Show us what we did.  So the intention of making you guys tweet is to see what you guys like the most.  If you like PowerShell or if you like Bash and try to get a score.  It's not too late to work on it.  Just have some sense of battle, I mean.  Just tweet.  So basically, here in PowerShell, I just wrapped up third-party DLL just to make the O-Wall  authentication much easier for me.  So basically, I could do this manually, but it's a hassle.  So I took a DLL, just imported it, and I set up a Twitter app.  And I made some nice little wrappers so I can just do searching, searches for stuff.  I can do search next.  I can do check if it has more results or not.  I'm not sure if you're familiar with the Twitter API.  I could also post updates.  So I could say, post.  Oh, let's include this file.  Post update text.  Alt status.  And easy as low.  Let's give me one point.  I want another point.  So I posted an update so you can get the entire structure from here.  But let's get the score.  I made a little wrapper saying, search for it in the Z-A-Low PowerShell.  And basically, my script now just searches for seven days past and you see it didn't  start seven days ago, so it should be fine.  And?  Unless I invented Time Machine.  I'm not too sure about that yet.  So there's six counts tweeting our criteria now, which is an easy as low PowerShell.  Interesting.  If we just, let's try to find your score.  Let's rerun it.  11 counts.  Come on, guys.  Come on.  More PowerShell.  Awesome, guys.  Thank you.  Thank you.  Thank you so much.  Let's wrap it up.  I could get the results of who's actually doing it.  So we could do some real warfare here.  Let's see.  I could, let's see.  I could get these out, out grid view.  See?  Ah, here we get the structure.  Nice.  Nice.  So I'm watching you guys.  It's really fancy.  User interface, of course.  Right?  Yeah, yeah, definitely.  Windows.  Yeah, perfect.  All right.  Anyway, let me just show you real quick because before we go move on.  Can you do this in Bash, I mean?  Yeah, I can do that.  That's what I wanted to show you real quick.  I mean, it's like, we're kind of talking too much.  But the thing is that, are we on?  Yes, perfect.  I want to show you something interesting.  I mean, it just, I'm not going to show you the whole thing, but I'm going to show you  that it's possible to do the same thing.  I mean, since it's battle, we kind of have to show that things could or can't be done.  So I have a library that I just downloaded from internet.  There was another guy that wrote that for us.  Let's see.  Actually, I want to open it in editor.  Then I can say like home.  I should replace all your editors.  User name.  Yeah, sure.  That's all right.  As long as it's not like Visual Studio or something, I'm cool.  Let me see.  The cool stuff is that there is like a wout and stream wout authentication and everything.  And it's actually, it works.  Let's have a look at Twitter.  There we go.  So pretty much the same.  I mean, it's like it looks a bit, maybe a little bit more scary.  It could be.  I have to admit that.  But it actually works and you can do that kind of stuff.  You can do, you can use your actual shell to run like authentication and go into and run  and get the stuff from internet from the rest from soap from whatever.  And it's actually pretty cool.  I mean, it's like, it's not just like your Java code or dot net or C sharp or whatever  code that would actually do that is able to do that.  You can actually use your shell.  And another thing is that, I mean, you see, I mean, I'm running here virtually on a virtual  Ubuntu box, but I mean, what you could do the same thing.  I mean, pretty much, I mean, most of the same things you could do in SIGGVN, which is like  Windows Brother or Step Brother or whatever off a Bash shell.  So SIGGVN would be like, Pash would be on Linux.  I mean, it's not fully functional.  No, it's not fully functional, but you will get most of the things.  I mean, it's way better than DOS anyway.  I mean, like, common line.  Nobody uses DOS anyway.  Well, nobody.  I really hope you don't guys use it really.  Even though you think it looks like DOS.  Oh, it does.  Still does.  All right.  Okay.  Let's let's move on from like joy and fun of web services of Twitter and stuff like  that.  Let's move on into a little bit more kind of work related stuff that would, again,  something a bit more serious, right?  Something you can actually use in your everyday life.  Something you can actually use in your everyday life every time you have to do something.  So what you can do is you can, I showed you already kind of, you got the sneak peek of  that you can use.  We have most of the companies.  I mean, it's like, we do that.  I guess you guys do that.  We use for issue tracking.  We use stuff like Jira or something like that.  And most of those would have a rest user, rest interface, right?  So what we did actually was to, we took a random Jira site that was actually hosted by the  makers of the Jira, Plasio guys.  They had the demo site up.  So we took that we, which is, I made a variable so I don't have to type all that thing all  the time.  So what we did is, which is that's URL.  And we get the project demo project of that thing.  We just get the rest and show you all the issues for that project.  And then you can do stuff with it.  You can, like, get the creators, get dates, get status, get whatever.  So you'd start kind of your imagination that kind of stops you from doing all the cool  and awesome stuff in the common line.  So what I do is like to say curl this, this one, this again, look, in partial, you would  probably do that with like included stuff.  There would be a function that would do that for you and show it and everything.  In bash, you actually split it.  And then you say, like, okay, curl would just return me the output.  And then I can pipe that thing that dash there, that kind of this vertical thing is pipe.  You pipe it, you just send the output into another program, which in this case I use  Python.  I always use, like, look for excuse to use Python.  So I did that, of course.  So basically what it does, it just prints it in a nice way.  What you can do that you can do more with the Python stuff, you can actually, yeah, like this.  And then you can do, like, let's see, I have some more stuff here.  Curl like this.  I do a bit more.  I just import some stuff, just what I need for JSON.  And I print issues.  I look for tag, JSON tag issues.  And I would just print all of them and they would just list them.  There will be probably a lot of them now.  But you can do all that kind of stuff.  Yeah, you see it just outputs every old text and then you can look inside and everything is objects.  And Python, everything is objects.  Then you can actually traverse and do magic and do stuff and do whatever actually you want to do with that.  Show us some of the same kind of stuff in PowerShell.  Sure.  So in PowerShell you don't need external libraries in the same way.  No.  As long as you have the correct PowerShell version, there's a lot of neat little help features for you that does that.  I just wrapped the show score from earlier.  So now we can actually search for both.  At the same time?  At the same time.  So now we're equal.  There's a 13 count on each.  So we're even.  All right.  I think you fixed it.  No, no.  We can show who's tweeting afterwards.  All right.  All right, let's go back to the G-Rack example.  Okay, let's go.  So basically, in PowerShell you have a nice little commandlet called invoke web requests or you can invoke REST method.  Bash guys, you have to tweet more.  Sorry, you were saying?  I'm just going to scroll up here to the tweets.  There we are.  Remember to tweet.  So invoke REST method.  It basically just invokes a regular REST method and it serializes your data.  So I can say g-raw URL.  I just wrapped the demo URL here.  I'm going to say data and invoke the REST method.  It's the same URL, right?  And then you can see it's actually fetching the stream.  So in PowerShell everything as well is a stream.  So you can pipe streams through the chain.  But what's really, really neat here is that I have actually a JSON serialized structure.  So you can just take a look here, data.  I get auto completion.  So there's issues.  There's a lot of issues, apparently.  So I'm just going to go ahead and say, let's see, give me the fields, actually.  I think those are the ones that are actually, let's see.  Here there's a fields property.  I can actually just expand this one as well.  So I'm just using the data structure I'm getting back to actually filter all this stuff.  Interesting.  So here are all the fields that's returned from the JSON structure on all the issues.  So by using this information I can easily just say, I'm going to select something.  I'm going to go ahead and say data issues, fields.  Select.  I'm going to go ahead and select, well, there's something called summary, I think.  At least not summary.  Type O.  So data issues, fields, fields, and select summary.  Summary.  Was that right?  Yeah.  There we go.  So now it fetched the summary.  I could also go ahead and say, is there a creator?  For you non-JR guys, it's basically a description of the issue.  Creators.  Yeah, there we go.  And as you can see, there's a creator object.  And I could go ahead and expand that object in my select method so I could expand the  creator dot something, dot something.  And I could actually make a really neat little list and export this JSON data to any format I want.  So basically, if this is a JSON structure, I could easily just say, hey, give me this  structure, convert to, and you see order completion.  Nice.  So convert to CSV, HTML, JSON, secure string, which doesn't make sense in this context.  Convert to web application, no.  But basically, I have a neat set of conversion methods just to play with the data.  So it's quite easy.  That's cool.  That's right.  So that was the small JIRA integration.  And usually, that's quite useful if you have continuous integration or you have tasks that  needs to be fetched and then combined with other stuff.  It can be a really, really nice.  Like putting together, for example, like your JIRA tasks with the code you committed or  something like that, and you want to pull your commits and you have to put them together  in some magic way and do something like that.  So that's what kind of things you could do.  And that's actually pretty neat.  And I use that in my previous project quite a bit because where I wanted to see who committed  what and what time and what kind of things we deliver whenever we do delivery, what kind  of commits and what kind of JIRA cases issues that we're actually delivering and stuff like  that.  So it's actually pretty cool.  It's actually good, useful stuff.  Yeah.  But also, another really annoying thing during your everyday life is working log hours.  And just as a small example, I have this really neat little site which I proxied.  It's one site I worked with earlier and I proxied it to local hosts.  And it's not working in any other thing than IE.  Oh, god.  This is the fun part.  So basically, if I pull this one up in Chrome, it shows me this.  It works in PowerShell, right?  Well, yeah, well, of course.  Well, no.  This is the thing I'm going to show you.  If you have a really painful website, which only, well, is this IE?  Yeah, this is IE.  Wow, that's great.  It doesn't work in the URL.  I copied the URL.  Oh, perfect.  It's quite bad.  So if I go here, it's working in IE.  And in Chrome, it's not working.  And this is a really great system.  You have to manually register your work hours every freaking day.  And it requires a username.  There's no auto completion.  It requires you to input the date and the project number.  And there is really no help in this interface at all.  No.  And of course, you need to submit every day.  So I could easily automate this.  I could use something like Casper or a third-party integration tool, which might work, but no  guarantees.  Probably will.  Yeah, if you tweak the headers a little bit and says that you are IE.  But I could actually on Windows use the IE com object just because I like pain.  It is a lot of pain.  So I could say, I could go ahead and create a new object.  I'm going to say com object and Internet Explorer, Internet Explorer application.  I'm just going to go ahead and close this one.  Oh, application.  So save that and let's run that one.  Now I have IE.  So it's a com object.  Wow.  Wow.  Yeah.  It's amazing.  Nice.  It's a mess.  Well, I mean, I think common com objects are bad enough.  So I don't want to go back to any further.  So by using the IE object, I could say navigate to.  I could go ahead and say local hosts.  I'm just going to go ahead and do this.  I'm going to copy this to my scripts.  So navigate to local host and I'm going to say IE visible equals true.  So this is a really, really simple workflow so far.  So executed and I have IE running in the background there.  Oh, yeah.  There we are.  Oh, where did it go?  There we are.  So small little window.  It doesn't really matter.  But what I could do is I could say IE documents.  I could say get element by ID, username, value.  I could say my username.  If this works, oh.  Well, it's probably a typo somewhere.  Value, text, text or value, value.  I can't remember the DOM structure.  Maybe something like this.  Yeah, there we go.  All right.  So it set my value.  Nice.  So just by invoking these really small com object commands and using the DOM tree back,  I could automate this process every day.  And I could put it up as a scheduled task running every day at four just by inputting some data.  For instance.  Just random numbers.  Just random numbers just to make the compliance work.  There are a few people just like the numbers.  So basically, how would you do this in Bash?  Well, maybe not for the IE object.  No, definitely not going to do it for IE objects really.  It's, I don't want to do that.  But anyway, but what I can do is to do it a bit more generic way.  I have, let me start my little proxy here.  I also created a tiny little proxy.  And I kind of was looking for an example.  And I was like, yeah, well, you have your hours thing, which is kind of, that would be lame to use the same.  So I kind of wanted to find something else.  So I thought of, I have a gym.  I go to gym.  I like to go there and they have classes and they have a system that kind of sucks a little bit.  I mean, you have to sign up for the classes week before.  And if you do that like five days instead of seven days before, it's probably everything is full and you have to wait and see and you know that kind of stuff.  So what I did is just I made a proxy.  I created a kind of a local version of that and I anonymized the whole thing.  So you probably hopefully won't know what gym it is.  Political reasons.  For some political and legal reasons and kind of I don't want to get sued reasons.  I also anonymized the whole names and everything.  So basically it's like this and then you have your, so it's in a region, but basically it's a your center.  Try a workout like gym set thing and then you go for like, okay, I want to go to this and I want to select, I want to go from Tuesday and it's like, oh, they have spinning on at seven o'clock in the morning.  That's perfect.  That's what I want to do in the morning before work.  Sounds like good plan.  Right.  And then you sign in and okay, it says like, yeah, you're registered now.  Right.  So basically what you guys can do, I can just create a list of stuff and say that I want you to actually sign me up for those and those and those.  And those classes.  And that would be actually really cool.  Right.  So what I did is do to do it a little bit more generic way.  You mentioned actually already Casper Casper jazz and I actually did that.  I mean, again, I mean, I don't have anything built in.  So I have to improvise.  And that's what I did.  And I created.  Let's have a look at it.  I think it's called sample.  I created a tiny little file that does really simple stuff.  I mean, it's like, that's not what you normally would do.  But still, it basically would go and find, let's go to the top.  This stuff would just turn on some debug.  I removed that.  But this is kind of a good thing to know.  You can actually add some verbose mode and debugging and stuff.  What would do what you want to do?  It's like you go to your L and then you go like you set the size of your window.  Just for fun of it.  Because it's not a browser, so it doesn't know how big it is and stuff.  Then you go to the first drop down.  You select some kind of thing.  You change it.  The first drop down, you remember the center, right?  Name of the center because they have different ones.  Then the second drop down would be like a date.  And I select some kind of date.  And then I'll just click on a button.  And let's see if I run that thing and see if demo effect actually, I hope it works.  Well, I hope demo effect doesn't work, but I hope the script works.  So let's see.  All right.  And what it did, I didn't show you that.  At the end here, it actually takes a screenshot of how page would look.  So if everything was right, there should be a page of like congratulations.  You've been signed up for a course.  So let's see.  It is in development and battle.  And there should be a screenshot.  It is.  And it is new, right?  I mean, how, yeah, look, I've been booked.  I have booked the spinning thing.  And just see when it was created just to see that I didn't cheat or anything.  Yeah, it's now.  It's like 1714.  That's right.  Modified.  Initiation termination sequence.  All right.  All right.  That's kind of interesting.  That was actually kind of a hint of what we have to do because we don't have that much time now.  Notice the middle launcher.  We're not going to get.  Don't go there.  Don't go there, really.  So we thought it wouldn't be a battle unless we have some gadgets shooting at each other.  So basically, we do what we did was actually, I basically added a DLL using the windows 8.1 USB hub library.  So I hooked up this neatly USB missile launcher and then I had to think what should I use for something that contracts like a missile thing.  Right.  And then I thought like there are some guys that thought about that before and they almost hit me.  Actually, I thought of you're going to need those.  Yeah, probably going to need those for now.  Then I thought like what kind of country, well, some kind of country that should not be named anyway, but that use something to contract missiles and everything.  So I went for drones.  Right.  Let's see.  Well, actually, you guys in the first row, we should practice like ducking.  Just in case it goes towards you, just should we practice or you're cool?  No, you're right.  Perfect.  Let me see.  And then, of course, I mean, like it wouldn't be like a command line battle if we wouldn't use that stuff from command line.  Right.  So what we're going to do, we're going to actually control both of those things from command line.  He's going to do it from poor shell.  I'm going to control that thing from Bash.  And I'm going to be, I'm going to go nice on you and I'm just going to do what I'm going to do is just go up, stay there, Hoover for a little while and just go down.  All right.  So then you have to hit it.  That's right.  Maybe your laptop is in the way.  Yeah, we'll see.  We'll see.  I can do that.  It's all right.  Yeah, I can move.  And let's see, do you want to switch just to show people what I'm actually doing?  Sure.  Okay.  All right.  I have a tiny little JavaScript here that would actually control the whole thing.  And then I'm going to do like node.  I'm using node.js for that.  And drone.  Remember ducking, right?  Just go down.  Just to be safe.  Play dead, basically.  If anything goes wrong, just play dead.  Let's see.  The moment of truth.  You ready?  Yeah.  Die bash.  Let's see.  Oh, close.  That's a miss.  Oh, that's the wrong way.  That's the wrong way.  That's a miss.  And miss again.  No.  It's landing.  Too late.  I can do it again.  Move down.  It's okay.  I can do that again.  I can shoot while it's down.  No, it's not shoot when it's down.  Come on.  Yeah.  Well, I would probably wrap it up now.  All right.  I have three more measles.  Like, could probably hit it.  Shoulda coulda woulda.  But it just illustrates the point.  You can easily integrate anything you want.  And it's the power of the show.  At the end, I want to really want to show you this one.  It's really cool.  That's how you can convert your server to a Kuku clock.  It would just take the ejector cedar on.  I mean, you have to have cedar on.  You have to have a cedar on.  You have to have a CD-ROM. You see it's an eject CD-ROM, and then it would make the cuckoo sound.  So imagine somebody walking into the server room and just did that thing, just cuckooing there, you know.  That would be so awesome. I just have to show you. Anyway, we're done.  What way is it to show the score? Let's see.  Oh, we have to show the score. Come on, two weeks.  Let's see. Is there any score? Let's run this thing.  Oh, I'm so excited.  Oh, haha!  16-16.  Oh, God.  Oh, that's a good fight, then.  Alright. Nicely done.  Well done. Thank you.  That concludes. So, if you have any questions, feel free to ask.  That's my email and my Twitter.  I'll post my Twitter.  I'll show you mine.  And you can easily find my email. And it's on the start of the slides anyways.  And I can switch.  You can switch and then I can show people my contact information as well.  It's there. Just for the record.  That's my Twitter and my email.  Remember to vote the green for the yellow.  Or the red.  Or the red.  How you like to talk.  Yes.  If you have any questions, feel free to come up here or just ask.  Thank you.  Thank you.  Thank you.
Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_0_803.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_804_1487.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_1488_1535.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_1536_2111.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_2112_2843.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_2844_4163.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_4164_4211.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_4212_4271.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_4272_4319.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_4320_4403.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_4404_4463.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_4464_4511.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_4512_4811.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_4812_6527.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_6528_7691.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_7692_7751.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_7752_8147.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_8148_8231.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_8232_9143.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_9144_10715.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_10716_15167.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_15168_17555.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_17556_17975.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_17976_18731.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_18732_18779.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_18780_20651.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_20652_21635.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_21636_23651.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_23652_24131.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_24132_33299.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_33300_35987.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_35988_37691.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_37692_37751.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_37752_41255.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_41256_48215.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_48216_50507.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_50508_50831.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_50832_54983.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_54984_55403.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_55404_63479.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_63480_64979.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_64980_66071.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_66072_66299.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_66300_67991.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_67992_68423.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_68424_71471.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_71472_72239.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_72240_73379.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_73380_73451.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_73452_73571.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_73572_73643.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_73644_74399.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_74400_74471.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_74472_75191.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_75192_76571.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_76572_78215.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_78216_80531.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_80532_80879.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_80880_81179.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_81180_81731.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_81732_82151.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_82152_84947.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_84948_87347.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_87348_87791.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_87792_87863.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_87864_87923.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_87924_88307.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_88308_88355.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_88356_88427.png Rustam_Mehmandarov_Harald_Fianbakken_-_Ninja_vs_88428_89267.png