 Welcome to the stage dear party people this is the chaos west stage self-organized sessions and the next talk will be held by Injun a very good friend of mine as you can see he makes funny face movements it will be about scripting and he has a special effect for us the so-called ring of fire one yeah there it is all right I sit down but I will stand up soon so Nanook asked me to tell me something about this absolutely brilliant title which is called habitual automation what I mean by this is actually that I at some point in my life realized that I can't help it but like this your microphone is off all right that I can't help it but start to script stuff instead of just doing it so I ended up wasting days of my life or wasting away days of my life to script very simple tasks to automate them like creating a curriculum vitae instead of just writing it down a small table have a curriculum vitae in the next time I need it which is not that often just do it again and work it over and at another point somewhere later I realized I actually didn't waste that time it was actually time well spent and everybody who is not doing it the same way is losing out so I at some point created this table which this title which actually should have become a whole table around here but well that will come up next time and at that point I decided I want to share this with all of you because maybe some of you are in the same situation or some of you are even in a situation that you're still thinking that you're wasting away your time scripting stuff and the other thing is that I want to motivate you which is probably preaching to the converted but that's the most fun because you don't get that many arguments from them and you don't get hurt all right and then I thought all right let's hijack my own talk and that's what I'm doing now the other thing we wanted to do around here is has actually to do with scripting and automating stuff that should not be automated and that we called the ring of fire for reason that will become obvious to you in a few minutes or in a few seconds the first thing I need you to do and you can do that over the next 20 minutes is to start your engine which is your computers as long as you don't have a free BSD running around because tests failed on every free BSD and if one of your computers is failing the whole ring of fire will be failing which is probably the thing that has to do with the structure of a ring if you have a ring a ring of fire for example if any of the ring links is failing the whole ring is failing so the general idea of this ring of fire is that we do something very non-secure and are very important it is sending around packets and we only want to send around one package which is a UDP package and the content is I can disclose this to you is fire because every one of you is seeing it on your screens very soon at the end of the talk so please open up your computers open up a command line interface if you have so if you have not installed so cut I have not written it down here but if you know what if you don't have installed so cut which is the thing you find on the upper right here then please install this and if you have not installed TCP dump which is the thing down here then please do so over the next 10 minutes the other thing you should do is join the IRC chat on the hack int which you should do nonetheless because the 34c3 chat is also situated there do you want to take the call okay thank you and then post your IPv4 address sorry no v6 around here yet in the internet relay chat that's not a really private data set because well you will be changing your IP address soon afterwards can everybody who has a anybody who has a computer on his lap that is somehow able to run so cut raises hand alright thank you then proceed okay in the beginning of everything you all probably know was the command line the command line I'd like to argue is much much much more superior over the things that you find around offices everywhere in the world which is the graphical user interface the thing we use this tally thingy around here and actually only one finger of your five digit hand I mean you could nail down your hand on your mouse and have some clicking item around here but you only need one finger so what you have if you use a command line obviously is much much more control and a much higher input bandwidth because you have ten fingers around there you have a lot of keys so you should at least be much faster but you also have more control in terms of doing knowing known what you're actually doing because when you click on some icon that you have on your your graphical user interface you actually executing some kind of command but I doubt that most of the people who do the do so know that they actually just firing up a command on the command line or on some command line sensitive thing the other thing is you have a much more interesting learn curve if you have a graphical user interface everybody of you probably has observed this you can do quite a bit on the graphical user interface from the start it looks very fascinating and everything is fine you fire up your graphical user interface and you just click to something and something is happening then you move your mouse around and the move mouse is moving around and you are actually able to do stuff not much but you're able to do stuff if you start up a command line interface it's quite the opposite if you set sit a put a kid in front of a command line interface it probably will not be able to do anything from the start except maybe at some point it will start typing stuff and then it will get one response from the computer which is command not found so this is kind of disappointing from the start but if you then proceed on the command line maybe finding out your first command which is probably show me the contents of this directory and move to that directory you slowly but continuously progress on your learning curve while using graphical user interface you at some point will hit something that feels like a wall because you will not be able to parameterize your your clicks you have only one finger after all you will not be able to do anything beyond clicking some somewhere there and if you want to advance from there you have to learn something completely new some kind of shell command line interface for example where you have much more control over your commands where it can use something like loops like conditions and all the stuff and from there on you can progress but first you have to get beyond this wall so why in the beginning start to learn one interface when you can just directly start with the other interface that is much much more better so sorry it is ring of fire has everybody found the the IRC channel yet all right I just go forward and go back to this slide every now and then you don't have a computer on your lap why okay the last reason why you actually should use your command line interface is because manuals on the graphical user interface suck I don't know if you have realized this but if you try to teach somebody probably on the internet on your web page how to actually use some kind of Windows machine or so you actually end up posting a set of screenshots with your mouse pointer conveniently situated on some on some knob and after a while you can you are able to follow all these images you have to find where is this mouse point on this image then you have to compare this with the image you have actually on the other screen and then you have to move your mouse pointer to the to the button can click the button and then you proceed to the next step the problem is this changes frequently because it's it's only the display this show of the the buttons and everybody changes the look and feel of his graphical user interfaces now and then so you find a lot of lot of aged manuals on how to use the graphical user interface of 10 years before which actually doesn't help you with now as compared to manuals on the command line which provide to you if you're lazy some some list of command that you can just copy and paste put into your command line and you're done or on the other hand something that you can grow on learn on what is this command doing what is that command doing can I can I change it and if you need something else you can just start from this set of commands and figure out how to make it red instead of blue or blue instead of red so as it happened to be I as probably many people of you had at some point do work and the command line interface brings it to to the point where you not that fast when you do things for the first time so if you start to work you have to somehow put yourself to the task of automating stuff but once you automated stuff you have them in your at least external memory and that is another problem I have I cannot remain remember much of the programs and commands I ever used but if I made the five minutes effort to put them into a shell script I just have to look up the script which is somewhere in my binary directory and which I can somehow find so what what I found by by looking at my binary directory was a lot of interesting scripts at that one point helped me to learn actually stuff so I learned to calculate interest rates somewhere in my life because I borrowed money from a friend and I want to pay him back some some money and there's a script telling me how to write interest rates that's not very interesting but at another point I found out how to copy files without deleting all the doplicates or without without deleting duplicates or copying over stuff that is already there so that's very useful but I probably have forgotten how to do it I just have to look up my script hello hi call you I hope you haven't been in cognitive here all right other things that are very important is for example other script that I found myself looking up now and again is how to get a video into some kind of music did anybody of you know YouTube they're nice videos they're very bulky if you download them and if you don't need the music you can just comp encode them into into a music file but and then Coda or mPlayer has a lot a lot of parameters so if you found your set of parameters and you can remember them two years after you're lucky I am not so I have them in a script probably the most important script was to get my calendar dates which you often get by email in ICS into my task warrior which is managing all my tasks or has been managing all my tasks or you want to kill all the people who is who are tedious and are sending you email probably with a nice message telling them back that you don't read their emails anymore which is a little bit more polite so you put this in a script wasted two years of your lifetime but from that time on you don't have to read all these emails from tedious people you don't want to read emails from and you're not even impolite because well you tell them that you don't read the emails every time they send you an email or very easy if you have kids children they need a command that says hello to them on their computer that isn't simple alias one liner well and the most fascinating thing I probably ever did was writing a markdown EU research proposal and working it over with a bash script to make a really actual PDF out of it and collaborate with 12 people the script is still somewhere around and I got some kind of praise for that that's nice but it's more or less kind of one liners if you go on from that you find yourself probably sometimes having talks somewhere to present somewhere here and you have yourself traveling so you need your computer to be in a certain state and the thing that evolved with me over a certain time is the shell script that actually set this screen up there I well you cannot read it but it's not important you don't want to read shell code on in a talk nonetheless so what what do you do you have a shell script let's call it shim scheme punked as hard and this can do everything from setting up your X Randa to present actually these slides to bring up your office setup if you have a coffee machine that is internet aware probably to cook your coffee making your screen being upside down because I don't know how many of you remember the correct parameters to make your screen upside down but now you have your one customized script to do so and being mobile in general for example switching off your top proxy because it's draws your battery and so on and you can put up everything on that on github so everyone else it can be completely confused by your shell code what did I learn but from that actually I had to learn how to find out which monitor on my computer automate in an automated way is actually the presenting monitor on which one is the monitor up there and now I have forgotten how to do so but I have a script to look it up again which brings me probably to the most useless thing I've written up to now which is the science organizer I'm probably like many people meeting people sometimes I am actually people at least the last time I looked into the mirror I was no robot I go to conferences not every now and then like those here and I meet people there people write text they sent me email they make pictures they create stuff and I have a problem with people because I cannot actually remember very well who I met every time I meet somebody when I met them and what they did so I wanted somebody to help me with this and this somebody has to be my computer because there's nobody else around and so it all began in a sense it's completely unfinished I have to add so I started with an RDF database because I mean linked data is hot shit so we have to use it it makes things couple more complicated but at least you have one format how to do all your stuff and I wanted to try that so we go there and the simplest thing you can have to can do is do an address book after all I wanted to remember people so I have some text file in there which is in a turtle format and a lot of people in there which I still have to add manually which is a hassle but after all you don't your at least you're not forgetting how to write your RDF data then I needed a curriculum vitae and that is actually something that it can do it needs all my addresses that I had in the past I don't want to delete stuff so I put in all my addresses every address has some kind of begin and end date because sometimes I move and then I leave my thing you need all the events and you will find out that all the RDF people had not yet defined all your curriculum vitae in that detail so you have to put them in yourself if you write stuff you have publications you want them to show be shown on your CV or in your web page and so on so you have to put everything in there in your database so creating your database actually it already takes a lot of time instead of well firing up word creating a table use it once and next time you need a CV created again it works kind of nice it works kind of nice in the sense that my current address is actually my current address in my CV it works less well in the sense that my publications actually come from a big big taking file that I have to convert into RDF and then have to convert into my CV but well it kind of works last time it took me let's say four hours to rework my scripts and then 10 minutes to have my CV ready and it took me two minutes to enter my new address so science organizer it's called you find it actually on github because I am very afraid that at some point my hard disk will break down and I will not find it again so I put it up on github it's not that complete but you probably want to use it what it can do is actually create my CV I used it at least twice in my life yet so it probably saved me about minus 20 hours and it can do a friend of a friend enriched web page for me which is probably read by nobody because it's somewhere in the me.rdf file that nobody will be searching on my web page but it's nice nonetheless to have something like that and after all the European research proposal I wrote had something to do with that so I needed to create something to be a little bit more coherent with which what I wanted to research but what it should be in the end is a complete social network plug-in most of you like me probably have one or two identities on social networks and I want to distribute everything to those social networks because I'm lazy and I don't want to write everything twice have anybody of you ever written a publication and then find himself writing it in a BipTec file then on his I don't know social network A list social network B list and in the end in his company on this publication list I did so I wanted to make things easier but it's not yet working but nonetheless I get my publication file and I write them still manually I actually wanted to do a contact publication graph it's in the making and I want to find out who I met at conference XY that someone in 1960 whatever it could have been I met you I probably recognize that what actually was created is the thing you cannot see out there on that the code on the right side is creating my curriculum vitae so that is working it's working kind of kind of nice you only have to write down the sections you want to have and then you're finished if you entered your data beforehand and nothing breaks down which brings me back to the original reason I actually learn kind of a bit on that for example on writing the science organ or still writing the science organizer I learned programming Haskell up to a level that I now want to rewrite everything I wrote up to there because in the beginning everything was kind of modeled I learned quite a little bit of bash scripting I learned kind of a little bit of Ruby because my email client was written in Ruby at that time I learned kind of a bit of Python and in the end I never lost contact to my computer which happens if you write papers and not code so that brings me to the conclusion that probably hopefully nobody of your needs if you learn to code you can put stuff into algorithms if you can stop into algorithms then you in the end can test whether you finally half understood what you have been doing because as Richard Feynman put it you only understand and yeah what you cannot create you do not understand or the contract point is if you can create it you probably have understood it so if you try to create stuff like your curriculum vitae you at the end will recognize that your CV is nothing more than a list of sections that somehow has to be compiled if you knew that beforehand you're lucky I actually learned it there so now we come to the final point can I get a show of hand who has fired up a computer and somehow find himself able to connect to the IRC client all right one two three four five six seven all right if I leave myself out we are seven potential points of failure let me switch switch to the can you hold that for me okay yeah can you can you enlarge this can you can you enlarge this this in any way all right you're all in the IRC chat so the title of the IRC chat is the actual line that you have to insert into into your shell it's actually the the last input I put in there if you want to watch what we're doing now you need sorry you need this last line here okay you try try to me does that work you probably can read that now this is the final test of a very useless exercise so what will happen if if we if you can paste your IP address in the in the IRC then we create a list of IP addresses you local I locate your IP address in the chat window and below your own IP address you find the next IP address the next IP address you insert here after UDP for datagram and before the seventy seven seventy three port number this is the peer that you will forward your packets to then you fire your shortcut line maybe maybe uh Yannick can you put up your email your IP address in okay I'm not seeing it it's not working shit yeah but it it's not helping obviously my internet failed yeah I'm completely offline okay can you can you start this okay of the people who have half the IP entered the IP address can you find your IP address Yannick can you insert your your IP address as the last one now I'm online again I okay who has I started this shortcut line with the correct IP address now this is yeah correct we will see in a second two I need three down there somebody's typing I never wanted to comment sports so that's Yannick is done who has the TCP dump run in that's the only way you see something because my computer off obviously is offline I need I need some some line from down there still hello ah Yannick just try it does anybody need another explanation I need all the IP addresses but I don't have them in the ISC chat anymore so we lost that we had interconnection when I started to talk whoever heard of lost internet connections on the on the con it works you have send the packages coming round are you seeing packages no you're seeing packages once or twice four times so it came around four times four who's who is seeing packages or every time you see a package raise your hand six it works what did work actually so what happened who wants to know what happened all right some volunteers I don't have a graph but we can't can imagine some kind of a circle so we had a bunch of volunteers here everybody with armed with a computer and computer a set up a proxy port something that receives messages on one port and sends them forward to the next let's call it computer B computer B did nothing else than sending the packages it's receiving to computer C to computer D and computer D decided that it's very intelligent to route them back to computer A so what happens if anybody has the clever idea to insert a packet at any point of the ring well the packet starts to go from A to B to C to D and then starts again to A to B to C to D to A to B to C to D at infinitum if you're lucky so in the end if your message contains for example the word fire you're now entitled to listen to Johnny Cash until you stop your computer I thank everybody who participated I wanted to make that work in some way and by the way you learn to to use so cut in a some kind of way to forward your packages and I hope you learned something new if not you hopefully learned something like that it's not very useful to link your computers in a circle it still works I keep it up any questions by the way Nanook it's your task and thank you for listening questions from the audience nah I didn't expect questions then I will what's the most useless thing you ever coded oh actually that code is not from me it's from you once on the congress I left my computer open just like that yeah and then you open the terminal and add it to my bash file to say you should lock your computer every time you leave your computer that's not useful that's a very useful reminder so if we do not have any questions from the audience my last question is where can we find you if we have questions concerning so-called CVs rich data text files ah yeah I forgot my well you you find me on the internet somewhere um yeah I'm from Bremen and you probably find me around there or if you're very lucky you find me down in the kids space where I'm lounging around in some of the hammocks or in the what's Bella but in English bowl bath with all the funny balls nah okay yes thank you again for your for for listening for coming here and good luck wasting your time on code it's very very very very funny thank you