So yeah, I guess we can go ahead and get this thing started. My name's Kyle Browning. This is the native mobile application development talk. I'm going to start off talking a lot more about some concepts for developing your applications and kind of what you should be focusing on when you start working on your app and the things that you should be aware of when you're working on them just in a general native sense, not so much as a direct connection to Drupal, but it does save you some time and energy in the end. So this is just kind of an overview of what I'm going to talk about today. I'll kind of explain some whys and why nots for native. I'm sure most of you are here because you want to do native application development. But it's good to know the ins and outs of the whys and the why nots for both sides of titanium and things like that. I'll go through some development process stuff. I'll kind of give you an idea of what the mobile stack looks like, where Drupal fits in, where the phone fits in, and I'm going to give you an overview of services, which is I'm going to cover it kind of lightly because there is a services talk right after this one that will go into much more detail about what exactly services is and how it works. But I will give you a good enough ground so that you can understand what's actually happening. I got some tools in libraries that I want to show you guys and then I'll get to the examples and sometime after that we'll do QA. So I wanted to start with why not native. I think that titanium and being able to support multiple devices and pushing to multiple devices, that's an absolute need and you need to do it really quickly. Developing natively might not be something that you want to do. Also, if you're rapidly prototyping something, it's a lot easier to write JavaScript than it is to do a bunch of memory management stuff. Again, it's just not as hard. When you're writing it with titanium or app accelerator or any of those, you just write a bunch of JavaScript and it builds down and pushes to all the other devices and it's just a lot easier. It makes you want to go down that route. Some of the problems that I've had with titanium are like just APIs didn't exist that existed in native code that you could write Objective-C with or Java. That was always kind of annoying that I couldn't have the latest and greatest stuff. Then there was memory management problems that they still haven't solved and things like that. I personally like to do native development. Why native? I've got a lot more talking points here, but it's faster performance on the device. I've always felt that way. You have a lot more control over what you do. The things that you're working on are actually supported by the operating system makers like Android or iOS. You can go on to their bulletin boards or their forums and make support requests. They'll actually help you with what's going on. Whereas titanium, you're kind of like with Drupal. We're left up to the community and sometimes that can be extremely frustrating, so it's nice to be able to pay for something and you actually get support. Like I said, you're not waiting on API updates. Maybe you're going to write a game that's OpenGL because I don't know why you would use Drupal as a backend for that. And then six, for me, it's obviously a personal preference. So just talking a little bit about the development process here, you want to get your idea onto a piece of paper and the reason for that is so you just kind of get it out there and try and figure out what exactly you're building. And then I move on to the wireframe space. Design is not really something that I do, but I think the design is a really important part and the engineer that's working on any app should be aware of what's going on there and then finally your actual development. Getting it on paper will basically help the entire process just go a lot more smoother because you know what you're building and it's not necessarily a moving target and that's why all of these are good ideas. It's way easier to fail on an app in your wireframe. I've built in so many apps that kind of didn't have wireframes. It was kind of like, oh, I want to work on this and I want to work on that, so I go build it and then I'm like, that doesn't really work, right? So if you do these things, you kind of lay it out. I have it easier to fail on wireframes twice because it's important. There's things like briefs, which is not necessarily a wireframing application, but it will allow you to write sort of a config file that will show images and you can actually walk through the entire app that you have with just images as opposed to building it out and actually taking all that time and then realizing that you don't want to do something a certain way. Examples are like, I don't know, logging a user in, like sometimes that's an important part of your application and you want that to happen first, but you've kind of buried it in the setting somewhere and it's not really usable, so you wouldn't really notice that unless you're actually on your device moving these things around and interacting with your app and that's why I have briefs here and things like Omnigrapher will definitely help because you can walk through the workflow of your application. I'm probably not going to spend too much time on design, but there's some concepts here that need to be thought out. Is it going to be on multiple devices? You need to attempt to create a user experience that's similar across your website and your mobile device, so that's an important part of the process and I think that you guys need to, like the developer needs to be involved in that because things change and sometimes the designer doesn't really understand the concepts behind the actual development. So yeah, you kind of want to figure out what your features are for the entire app when you start building and then you kind of have already done this step if you've done the wireframes and the design and all of that and you should have a pretty good idea of what kind of resources you might need and that's a services term that I'll explain when I get to services. But I personally like to build an API communication layer that is basically just all of the API calls that I'm probably ever going to make in a file or maybe some sort of hierarchical subclass type system on whatever environment you're developing be it Java or Objective-C. And that's always given me like a nice, just one place to go to change an API call, add parameters, whatever it's in one spot and they're all there so you can just kind of go through and change them. If things are constantly changing I highly encourage you writing tests for this API communication file that you've written and there are tools that write that for you for Drupal but I'll get into those later. And you want to tackle the larger, harder problems first because you can be like, oh, well we can just bang out all the easy stuff and then when you get to week three and it's the final week of the app and you don't really have any time to work on this large, hard problem because it needs to be on the store on Friday and so it can be on the store next week. So I highly encourage tackling the harder problems and those are usually like session management just being able to log in the user and things like that. Maybe you're doing more complex things like creating types of content on the fly like writing your own content types and stuff from an app. I mean, that's like a really complex thing so you want to make sure that you get that working first and then move on to the easier stuff because it's easier, right? So this is kind of the mobile stack as it stands right now. There's Drupal, you know, it's kind of on the bottom and then there's the services thing that sits in front of it and then you have your mobile app and that's pretty much it. There's some things that you can interject in between these if you need to, obviously, but that's more or less it. So I just wanted to talk about services a little bit which is it's basically, you know, an API for Drupal and it allows you to get all sorts of different response formats so if you have different devices or things that maybe you don't want to include well up until iOS 5 but pre-IOS 5 you didn't really want to use JSON because every JSON serializer was a piece of crap and would crash your phone. But that's fixed. So I just kind of listed some things here and this is actually taken from the module page but it gives you your connection into Drupal and you're going to be spending most of your time making calls and messing around with services and services module and so it's definitely a part of this talk. I'm just kind of going to go over what servers are, authentication, how that kind of works, end points and some versioning and then I'll just kind of touch on some things that might be of interest to you. So servers are kind of like this, they're kind of like you basically define what you want to accept response formats like for example you create a server and I'll go through and create one later but you create one and you say I only want to accept application slash JSON and I'm only ever going to return application slash JSON and then you say I want to do session authentication which is just basically PHP cookie session management and that's pretty easy to deal with or you can go with something more complex like I'll often get into those in a little bit and then it's the actual object that will execute the function call that you might be writing. Some of you will probably use the standard services resources and it's probably something to talk a little bit more about in the services talk but resources are for example we have a node resource and that takes care of everything that we want to do about a node. We can retrieve nodes, we can create, save, update, delete and those are your basic CRUD functionalities and when the server basically takes care of sending the call to whatever function that it is based on the path or the parameters that you've given it and things like that so it's kind of what makes things run. And then you know authentication is probably an important part of I'd say most apps. You might be writing some consumption based things that really only pull in views and nobody is really creating content or tagging content or uploading photos or things so you don't even have to select an authentication if you want and everything can remain anonymous. One of the gotchas with that though is you'll be making a call and you don't have session authentication turned on and you're like why am I getting 401 unauthorized and it's a permissions thing usually and sometimes it's not fun to track down. I mentioned singletons here because when you're writing these apps you're going to have a user object that's going to exist through the entire app so you want one instance of this object and you don't want to create any more otherwise you could have people that you might... it just kind of gets confusing and things like that so I've always told people that singletons are the best thing for authentication because your user object is not going to be changed and you don't really want it to. You might be doing some user update stuff but that's like the only time that you would update the user on this singleton object and so when you do that, when you attach this object most of your calls through your application can just pull that user object from that one thing and then you have a user anywhere inside of your application as opposed to making the call to Drupal and checking that they're logged in and things like that like you don't want to really be doing that so it's nice because you don't... like I said right here you don't... if you do it right which I will definitely go into you don't need to log in when the app opens. Endpoints are another services term and they're basically the URL that gets generated when you start setting all of this up it's basically a configuration object they have all of the resources enabled on them you actually enable the servers on them as well and what authentication methods you want what response formats that you're going to accept which ones you're going to return all those things are handled on the endpoint and that's kind of where you can start doing some cool things with like versioning and maybe you want to give some developers access to one thing and some developers access to another thing and you need to separate that out and endpoints allow you to do that so versioning is in a feature branch on versions and I just wanted to lightly touch on it because I think it's really important one of the problems that you'll run into when you're building this API or turning these resources on for your endpoints and stuff is that you'll break something your app that's on the app store will literally break because you added a required parameter or you'll just have unintended features I can't think of the word but basically you don't want that happening and versioning allows you to say hey this is API version 1.0 and in your client code your session management code which is all in that one doc that you wrote with all of your API calls you can just say hey I want to point at 1.0 and then when you're sure 1.1 is working and everything is good to go you update everything to 1.0 and your app will be good when you update to 1.1 everything will be good but these people that still have the 1.0 version they'll be able to access all of the old information that existed in the 1.0 state and it's kind of a complex thing that we do on the services side but it's in a feature branch and it's definitely going to be there and I highly recommend checking it out and we'll talk about more of that in the services talk these are just kind of some example calls I think that slide is kind of out of place but curl is something that you can kind of do in any programming language so this is just the curl command line and what it would look like to get all nodes by topic ID 8 or that's not supposed to say get by topic but the second example's supposed to be like user login and it's really neat when it's all working so some things to note views has been in like this weird services views has been in a weird experimental state for some time but it's actually been very cleaned up there's no issues in the issue queue and one of the things that I was talking about with versioning is if you start using views to manage the content for your apps you could break your app again by removing a field or maybe you turned on content permissions and now you no longer have access to that field and your users are like why the hell can't I see my content so when you're using views you really want to make sure it doesn't change and I suggest using something like features for lack of a better module there's just some problems with Dom and I were just talking about this actually with changes on production that kind of get overridden and things like that but features basically allows you to take that view and put it in some strong algorithm code and make sure that it's in code and not necessarily the database so that nobody really mucks with it and if anything ever breaks god forbid you just go hit the reverb button so you just have to really be careful with views another question I constantly get asked is images inline body content so let's say you're using like a wissy wig editor on your site and like your content editors are just like throwing their sunset picture that they took last weekend on the site so that HTML gets put into this into this node and then when you display that content body in the app you're like why are there HTML tags in here you know so what we have done on the services side is basically there's a module that's in the sandbox right now that I've been working on that basically is a solution that we worked out where we'll strip the images out of the content and basically attach it to the node as if it were a file actually attached to the node so that when you do like a node get those images are just attached to the node and you can like throw them on the sidebar or if you want you can put a little tag that you strip out and put the image in yourself with you know whatever but you get more control over where those images go you know a lot of the times you don't want them in the middle of your content body on like the iPhone or so I highly recommend using image cache you know just because it's awesome and I guess in 7 you don't really have to install anything because it's core these are just a couple of tools that I wanted to tell you guys about and talk about a little bit there's those URLs are kind of hard to read and I apologize but I'll leave the slide up for a bit while I talk about them there's the there's a the Drupal iOS SDK which is basically and I have a mobile stack picture here for it that just kind of sits right in front of services in your mobile app and Dios and Dandy are both libraries for the iPhone and Android so that you can natively communicate with Drupal extremely easily and they're there there to help you move things along faster so the iOS SDK has all this code written to do your session management and your user management I mean I'm sorry they're the same thing but do your user management get all of your nodes, get views basically everything that's in services core is supported by both of these libraries and you can get your app up and running in way at most time because you're not worrying about all of the things that I've been telling you that you need to do the majority of it I still write that API communication file but it just calls functions that exist inside of these libraries so another great one is services log which just kind of hooks into services and logs everything it it'll allow you to see that when you're you know getting a 401 unauthorized it's because you you know you don't have the permissions to access it or something along the lines of you know you sometimes you basically need to be able to see what's going on like you know you forgot a field and you can't figure out why so you turn logging on it's a lot easier to go through Drupal watchdog than it is to you know dump objects in an editor and crawl through them and stuff I like the way I raise look and watch dog personally so now I just kind of wanted to show you guys some of this stuff and maybe see if there's any questions yet there's a microphone in the middle of the room if anybody wants to walk up and ask a question otherwise I'll just continue on did everyone get a chance did anyone need to see this slide any longer so the examples that I'm going to be are all on the iPhone just because I don't have an Android emulator on my Mac but this is sort of you know you get into native development I don't know what you guys are familiar with and things like that but this is sort of you know your environment that you're in all day so I'll just go through and show you guys kind of what services looks like and stuff and what you need to do to kind of get your app up and running so I'll just go right here to services this tools example is actually supplied by a module but services API is one I wrote I'll just make a new one but I'll be using this one during the demo just because I know it works and I don't want things breaking while I'm showing you so when you add an endpoint it's pretty standard we give it a name so we'll just call it new endpoint and then you select your server like I was talking about you have multiple options this was REST or XMLRPC there are others like I said there's SOAP and multiple others but we're just going to stick to REST because it's a lot easier than XMLRPC in my opinion and we'll just do your path to the endpoint is and I realize that's kind of hard to read but your path to your endpoint is basically what you're going to call when you make these calls to your API this debug mode is add some zoom out here the debug mode basically adds on some extra watchdog functions that are useful it's kind of a work in progress I think services log does a much better job than services actually does and then you choose your session authentication methods and I guess I didn't really talk a little bit about OAuth it's something that you guys are interested in because in services 2x there was this API key that everybody loved but there was like we would just get security advisories like once a week because it was just a really complicated way of handling all of that so I highly recommend using OAuth you can use what's called the two-legged authentication method which is find your requests and send it off or if you want to get fancy and you have like a I mean it's a prime example Facebook does it, Twitter does it they all do it three-legged OAuth authentication which is hey this is who I am I want access on this other site and they send you to that site and then they say hey log in we need to verify that you're you and then when you log in yeah you were verified and now you have a user object and you don't really have to give your login credentials to like it basically was created so that you didn't have to give your login credentials to other people like a developer that wrote an app could be malicious and just record all of that information over the course of time whereas with OAuth it sends you to the original site and you don't really have to you trust that site obviously if that gets broken into then you have bigger problems but you basically trust that it's a lot like open ID but for APIs so I'm just going to choose session which is like I said standard PHP cookie stuff can't have spaces so let's just do new endpoint and so yeah this is all on C tools so you're probably pretty familiar with this if you use views the server settings here is basically your response formats and I can't get it all on the screen but actually there we go so you have your selection of response formats JSONP is not selected by default because it's kind of you have to know what you're doing there it allows you to do cross site requests with javascript and things like that so it's turned off by default same with application XWW formula code there's some security implications there that people need to be aware of but that's not for this talk I'm just going to leave on what's on but for the application we only need JSON so yeah I don't even need to do anything there there's no settings for session authentication if you were using OAuth this is where you would select your context for hey this is what consumer context that you want to use for this for this endpoint so you can say one endpoint is session authentication and that's trusted people and then everyone else gets to use OAuth these are a list of all the resources that I was talking about and this is kind of like where it gets into what you're actually how you're actually interjecting data interjecting data into Drupal I'm just going to expand this real quick and you can see the API version stuff because I have it checked out this is a list of everything that we can do with comments we can create, retrieve, update, delete and index them and then we can do give me a account of all of the numbers on a given node which you could argue that it should be in the node section it's just this is where we put it and then count new the number of new comments on a node you know pretty standard stuff here I usually just turn these all on but on a production site you probably don't need to turn on file maybe because they're not uploading something file is basically the same thing and one thing to note here there's a create raw function because currently the create function uses a base64 encode which is kind of bad on mobile devices really because you have to you have to base64 encode the entire file so if your file is like 5.5 megs you better hope you have that in memory available to base64 encode that and if you don't your apple crash so create raw function uses a multi-part forming code and you have to just another gotcha you have to enable that in the server down here so that's just an idea of what resources are I'm just going to go ahead and turn all of these on just for funsies and then there's obviously the export this is all based on ctools so you can do some hooks and get all of the stuff encode there's a little bit of work on the ol side to get that configuration management encode but services is all ctools based so it all works so here is just basically it's the site I'm going to clear cache just because I always do it let's clear it twice and I just have a question here that I did and I wanted to work a lot more on this app than I had the time to do but I tried to think of an app that might you know show a lot of things and what I came up with was a question app so that you guys could ask questions during the during the speech but unfortunately I didn't have time to get either of those on either store so that's not happening but I have an app here that I can show you on my emulator that's sort of those exact questions that you saw the test one is anonymous you can do all sorts of things register and log out and I'm going to go ahead and attach this to my Xcode real quick so yeah you know if we go in here and we delete that test node that I made that's pointless you can actually see that when we rerun the app here it's not there anymore so this is all using DOS the library that I was talking about earlier and it uses this file right here which let's see if I can have a much better screen resolution than this projector so I know this code probably looks like very scary but this is like the basis of the node object and this gives you all the things that you can do to communicate with Drupal so here's a node save you just basically pass the node and it will call your session it'll post to that path that gets generated based on some static variables that I have set it'll call it delegate I've actually updated this to use blocks a lot better but I didn't have time to do it for everything so that's kind of the heart of the DOS library and the node part of that I don't even know how to get that back really? alright so we'll use this so just looking at some other ones just like adding a content question which I'll do here in a moment this is the create a question function let me make that bigger for you it's pretty straight forward objective C code nothing fancy here just kind of creating a hashed array or a dictionary and sending the data off as you see here there's some tricks to filling in the content for services because it all uses Drupal form execute or form submit whatever it is in 7 now whatever it is in 6 so you have to basically build your node exactly like it looks on the develop screen if you have a where a lot of people get confused is if you have if you look in 7 at least if you look at field body which is a field now it has a language array an indexed array inside of that and then another hashed array inside of that that has like raw values and safe values and things like that you know so you have to actually build all of that and send it off but it's pretty straight forward if you just look at the develop tab and you know how to build basic array structures in whatever language you're using be it java or objective C you should be fine just making an array with objects with the question body text and setting some keys like let's see if I can go down there the value and you know the value and there's that UND that you see there is that easier to read you guys are awfully quiet anyways UND you see there that's that language variable that I was talking about that exists in 7 and it's kind of really annoying but it is what it is so yeah we just call our we instantiate our DOS node object and then we in it with our delegate which will basically that's going to change a little bit but for right now it'll call back node save did finish down here and that's kind of where I you know I could probably be doing a lot more things here but I hide the heads up display and then I I check that the status is true and if it was then I'd dismiss the screen let's just show that really quick like I said I'm not a designer so don't laugh at my program so since nobody had any questions I'll have to make one up we'll just do you know why does base64 encode how about why is base64 encode so lame and I added a session name just because I was going to try and make it usable for all of the sessions but I didn't want to start I basically didn't want to do all of the work of getting all of the session information and importing it into this Drupal site if I had DrupalConChicago.com's database or sorry DrupalCon Denver would have been a lot easier anyways and then the question would probably be this is just like an extended field so I'm just going to that's not what I copied whatever I wasn't logged in so my username is not showing up I apologize for that I should have logged in but as you can see it added the node it refreshed and did everything it was supposed to do and if we go back to Drupal there's our node so it's pretty straightforward thank you the same stuff exists for Android so don't worry about that but I just wanted to show you guys kind of an example of all of that and I think that that's kind of where I want to leave things off and see if there are any questions come right up we've got an app that we're building it's still in the in the wireframe design stage but we've got nodes that we're wanting to push that are going to have somewhere between 60 to 100 images and node and video and so one of the challenges that we're going to have is to try to push these things and handle the potential of a dropped connection or different things like that so I don't see that we're going to be able to push we've got to find a way to not atomically in the database sense of the word push especially the image and video data do you have thoughts on that challenge I mean obviously you can do all sort not necessarily with the images but one thing I didn't mention is caching and caching your responses and stuff like that but yeah I mean that's a tough problem and you definitely don't want to load all of that for every node every time it comes up you know and so I would probably write a custom resource to get to just basically you could probably use views to do it but I would write a custom resource that batch to those images and gave me the ones that I wanted I would try and solve it that way if you need all of the images for the node then you need to figure out how much you're going to display to the user and actually do the batching yourself I'm actually talking about pushing the images from the iOS device to that's my concern okay so this user is going to select 100 images on their phone right so they're doing an inspection of a piece of equipment for example I want to take pictures and we've done some tests with the challenge we were into and breaking connections just trying to figure out you know Drupal is kind of difficult to just upload a piece of information per node unless you get down to database or make the fields are required to do some kind of junk stuff yeah I mean that's a tough problem you're going to need to batch the sending basically and do it in the background you know unknown to the user and if anything fails just run it again later you know and make a note that it failed and try and figure out why and if it's just a network thing you know it sucks but we can't really do anything about that and compressing the images obviously helps do you have any thoughts or experience with exposing Drupal search or solar through a mobile app I have done some testing with exposing the search form which would give you basic search I don't know how that would work with with solar but I would imagine since solar does the same exact thing using the search form that the integration would be very very similar but services doesn't expose services does not expose by core there might be a contrib module that does and we're more than willing to support anything that's in core Drupal but we're not going to all of the maintainers agree that we're not going to support things like 5-star that's for 5-star to do they use our API to write the integration and the same can be said for solar but for core Drupal search we definitely want to have that in there and it's just not done so could you do something like exposing it through I know there's solar for views so you could maybe expose it that way yeah you could probably do that because all we do with views is a views execute and grab the results you know so can you mention two strategies either code generation from javascript or writing your own full native application what about native HTML HTML5 applications wouldn't that sort of solve the problem about missing libraries you can melt at least a non-nandroid you can melt the local APIs to javascript to have any experience with the native HTML5 applications I have done some native HTML5 application stuff the we just need to write a javascript library that does the same shit that deos and dandy do basically and then that problem will go away but yeah you can definitely make those same let's say you're using jQuery or whatever you can just make a request to the URL and it will return your response and I can show you some of those responses if you want I think I have one up right here this was I was changing stuff but I was going to create a node here so this last response here was I logged in and that was all of my information so you can see my session ID you can see the set cookie getting returned when it expires and all of that stuff I might be out of date here but could you give an update on OAuth and security I understand like OAuth 1.0 was hacked right and services originally supported so what is the status of OAuth OAuth 2.0 is not final so what is the status of using OAuth with services so it works I've tested it in both 6 and 7 7 is a little bit more wonky with OAuth because I actually just recently picked up maintainership and I haven't gone through the issue Q yet but it does work OAuth 2.0 will be supported when it comes out when that happens I don't know right now it's not in the pre-draft or whatever it is is not in and it's only OAuth 1.0 but they work in both 6 and 7 yeah so Friday my day consists of a documentation sprint for both services and OAuth hopefully we can get through most of that and if anyone is willing to come help that would be awesome because we're the developers of the stuff and sometimes we use the app because we know how it works and that kind of makes your documentation poor quality because you just using your app and using your code you kind of get accustomed to how it works and then you just kind of skip over that step when you're trying to explain it to other people so yeah yeah well the talk that's going on right now with Carl Larry Garfield Garfield the whole WSSCI initiative whatever it's called is trying to do that they haven't really been in communication with us about getting services into core using the same methodology or how did we solve these problems and we've tried to be involved in the past and we just kind of didn't really get it going anywhere so we just refocused our efforts on making sure that services is great quality code and that it works so I would love to see the basics of services in core but you know if that happens it's going to depend on the community yeah actually that was one of the questions I wanted to put in the app so the question was ASI HTTP request in DEOS and ASI HTTP request is no longer supported by the original developer of that CF networking library for iOS so the code that I have written actually rewritten that is in a feature branch for DEOS which is supposed to be DEOS 2.0 uses AF networking and they fully aim to support ARC and this fully supports ARC on iOS so I've already moved it all over to AF networking and gotten rid of ASI HTTP request so you can download that now and mess around with it it's all in a feature branch on this GitHub page yeah you're going to have to rewrite it I didn't really do any sort of backwards compatibility because session management is handled differently in AF networking and they kind of take care of the cookie stuff for you so I also wanted to get rid of I wanted to make it fully asynchronous and so DEOS 1.0 is not by default but you can do sort of things like network operation queues and things like that but yeah for sorry I lost my train of thought there but yeah does that answer your question or okay yeah so if you yeah you're going to have to rewrite it I'm sorry but that's why that's why I suggest putting it all in that one file because you really have to touch that that updates everything for your API and as long as the responses are the same you should be good to go anything else? alright well thanks for coming out guys I appreciate it


Hello and welcome to the session. In this session we will discuss a question which says that in an AP, which is Arthematic Progression, the first term is 2, the last term is 29 and some of the terms is 155. Find the common difference of the AP. Now before starting the solution of this question, we should know some results. And that is, sum of n terms of an AP when first term and last term is given by, that means the sum of n terms is equal to n by 2 into A plus L the whole, where is the first term, is the last term, are the number of terms also, the last term in AP, that is L is equal to A plus L minus 1 the whole into D, where D is the common difference. Now these results will work out as a key idea for solving out this question. And now we will start with the solution. Here the first term is given as 2, the last term is 29 and some of the terms is 155. So here it is given the first term of an AP, A is equal to 2, the last term of an AP, L is equal to 29, the sum of the terms of an AP, SN is equal to 155. And we will have to find the common difference D of an AP. Now by using the formula which is given in the key idea, n terms, that is SN is equal to n by 2 into A plus L the whole. Now putting the values of SN, L and A here, this implies 155 is equal to n by 2 into 2 plus 29 the whole. This implies 155 into 2 is equal to n into 31. This implies 155 into 2 over 31 is equal to n. Now this implies here, 31 into 5 is 155 and 5 into 2 is 10, so 10 is equal to n. All you can say n is equal to 10. Therefore the number of terms in an AP is equal to 10. Now using this formula which is given as a key idea, we have last term that is L is equal to A plus L minus 1 the whole into D. Now putting the values of L, A and L here, this implies 29 is equal to 2 plus 10 minus 1 the whole into D. Further this implies 29 minus 2 is equal to 19. This implies 27 by 9 is equal to D. This implies here 9 into 3 is 27, so D is equal to 3. Therefore common difference of an AP that is D is equal to 3. So this is the solution of the given question and that's all for the session. Hope you all have enjoyed the session.


Selamat datang, semua. Untuk sesi ini, saya akan mulakan dengan Virtual Machine. Saya, Leonard. Saya dari Malaysia. Namun, saya sekarang berdasarkan di Oslo, Nore. Saya bekerja di sebuah perniaga yang menghidupkan infrastruktur cloud membantu pelanggan dan klien untuk memperbaiki infrastruktur cloud dan servisinya. Dalam masa lalu, saya bekerja dengan perniagaan hardware yang mengeluarkan solutions CICD untuk perniagaan hardware mereka. Jadi, ia di mana saya mendapatkan sedikit pengalaman dengan KVM. Ya. Ya, mari kita mulakan. Jadi, jika anda ada pembanyakan, perhubungan untuk membuang tangan anda dan perniagaan akan bergerak atau anda boleh bincang dengan baik-baik saja jika anda mahu, ya. Dan mari kita mulakan dengan konten. Jadi, saya sebenarnya menerima ini untuk menjadi sebuah sesi tutorial atau sesi kerja tapi nampaknya ia menjadi sebuah session berbincang. Tapi bila-bila, mari kita dulu berbincang dengan anda supaya jika anda ingin bekerja bersama dengan material yang di tempat ini, anda boleh buat begitu. Plan saya adalah bahawa semua orang boleh mendapatkan tangan 30 dengan KVM dalam session ini. Jadi itu kata-kata untuk menjelaskan. Saya akan menunjukkan kata-kata ini satu kali sebelum kita pergi. Semua orang dapat kata-kata. Saya akan menunggu. Bagus. Ya. Okey. Kena berbincang dengan virtual machines. Berbicara, berapa banyak anda sebenarnya menggunakan ini untuk menggunakan virtual machines? Okey, itu banyak. Jadi ini mungkin sebuah repetiti tentang apa yang anda sudah berlaku dalam masa lalu, tapi mungkin anda boleh beritahu saya sesuatu yang baru. Jadi mari kita berkongsi bersama-sama. Jadi kata-kata anda telah menjelaskan di deskripsi. Jadi saya tidak mahu menjelaskan. Jadi ini sebuah session ini menjelaskan untuk menjelaskan ini untuk mengikuti teknologi KVM dan menggunakan virtual machine menggunakan interface Koma9 dan juga menggunakan interface penggunaan grafika. Jika kita mempunyai masa. Dan di tengah-tengah tutorial, saya akan menunggu semua orang di sini dalam penonton. Mungkin anda tahu bagaimana menjelaskan laptop hardware atau jika KVM digunakan. Dan juga, jika anda tahu bagaimana mencari, mengubah, mulakan, dan mengubah KVM. Itu... Ya, kata-kata saya untuk hari ini, untuk kami. Ya, itu agenda 90 minit. Jadi pertama-tiga, kami akan menjelaskan bagaimana kami menjelaskan KVM. Jadi kami akan menjelaskan instalasi, konfigurasi, bagaimana menjelaskan sistemnya untuk menggunakan model KVM dan sebagainya. Dan keadaan kecil-kecil ini adalah bagaimana menjelaskan KVM menggunakan interface Koma9 dengan CLI. Dan menggunakan kata-kata ini lebih berbeza tapi hanya menggunakan interface grafika. Ya. Dan, ya. Ya. Pada pertanyaan, selamat datang. Jadi, senang- senang- senang, dan mikrofon atau... akan digunakan. Dan kita boleh berbincang lebih jauh-jauh. Ya, OOV KonoBase Virtual Machine. Jadi... ia adalah teknologi virtualisasi-virtualisasi terbentuk Linux sendiri. Jadi, ia sebenarnya mengambil Linux untuk mengubah menjadi penghantaran. Dan kita akan kembali pada termasuk penghantaran jika beberapa orang tak familiar dengan kita nanti. Ia bermaksud juga bahawa ia menolak komputer host, bagi contoh, laptop saya. Ia dapat mengubah banyak virtualisasi-virtualisasi terbentuk atau virtual machine... virtual machines, maaf. Atau dalam beberapa dokumentasi, ia dipanggil domain. Jadi, kita akan kemudian nanti. Dan jika sistem kamu memiliki Linux 2.6.20 atau lebih baru, kamu sebenarnya mempunyai KVM support ke dalam KonoBase Linux. Ya. Dan teknologi virtualisasi-virtualisasi terbentuk bagi contoh Ubuntu, ia adalah KVM. Dan untuk hardware Intel dan AMD, KVM membutuhkan kawasan virtualisasi. Kita akan kemudian kemudian. KVM juga mempunyai KVM-Z, Linux 1, dan juga ARM. Tetapi, saya tidak mempunyai kemungkinan untuk bermain dengan KVM pada platform ini. Jadi, terutamanya, konten hari ini saya akan mempunyai menggunakan KVM dengan platform 8x86. Jadi, KVM mengubah Linux yang di-engan K1 kawasan tersebut. Kawasan tersebut yang di-engan K1 bermaksud KVM lulusan kawasan tersebut. Kehidupi KVM diperkenalkan sebagai proses Linux diberi dengan kawasan laut dengan komponen hardware yang dihidu. Macam mana, kita boleh melakukan atau actually plug-in dedicated virtual hardware such as network cards, graphic adapter, CPU, memory and this, and so forth. Ya, we got a hypervisor. So, the term hypervisor is to mean that the software stack that to create and one that's a typo I have to fix. So yes, virtual machines. And sometimes a hypervisor is also called a virtual machine monitor, VMM. So it actually isolates the host hypervisor operating system and the resources from the virtual machines and enable the creation and management of those VMs. And also we would not be talking so much on a quick emulator, but we will be seeing quick emulator being used while we sort of interact with the kernel virtual machines. So quick emulator is part of the KVM experience behind the user space backend for it. But it also can be used for the hardware without virtualization extension by using its tiny code generator. So regarding the tiny code generator, it's actually the core binary translation engine that is responsible for enabling Q Quick Emulator to emulate foreign processes on any given supported host. Ya, and sometimes as I mentioned earlier on, virtual machines are called domain. I did some research on it. It has some history with Xen in the past. So the term sort of lingers around. So sometimes we will see this term domain zero. So domain zero is the first domain started by the hypervisor at boot and we will be running the Linux OSX, for example, on this machine. So this domain is a privilege. So it may access the hardware and run tools that manage other domains, so other guest virtual machines. And the other virtual machines is referred sometimes as a domain U or DOM U, which the U stands for user. They are unprivileged and it's equivalent to the guest system or guest virtual machine. So the first task, if you would like to follow along, you can open your laptop and we can actually check how to verify that your support actually have virtualization features enabled. So, for example, as we mentioned earlier in the earlier slides, KVM requires a CPU with virtualization extensions. So the most common to the Intel virtualization technologies called Intel VT. And the CPU flag is VMX, which stands for virtual machine extensions and MD virtualization, which is known as AMD-V. And its equivalent CPU flag is SVM, which stands for Secure Virtual Machine. So we'll get back to this later on. So if to actually check your system, whether it's supporting KVM, or not KVM, but supports a virtualization feature, you can actually try to grab how many to check the flags, whether it exists in the CPU info. Let me try it here. And you can try it on your laptop, too, if you want to do so. Screen's up. Yep, that's good. Yes. Yes, please hold on. I can share the link. Yes, let me share it here, actually. Let me just share the link. Sorry. Yeah, this is the link to the presentation. I will share it for like 30 seconds. All good? Good to go. Okay, here. So we can see that it actually managed to find VMX, the last red line. You can see that VMX which indicates that my system is supporting virtualization by means of Intel CPU with the VMX flag. Do you have screen? Yes. So by chance that your system, if you cannot find any flags on these two, probably that one, it means that your virtualization features is disabled on the biosystem level. So you need to check whether it's enabled on your biosettings. Second is that your CPU doesn't support the virtualization extension. The third one is that because this command is only searching for these two flags. So if you are using a different processor, you might need to find a different flag for that and to search for it in order to check it's enabled. But yeah, and ensure that if the flag is not there, KVM is still could be run but the emulator would fall back to software virtualization, which is much slower. So for example, after we have checked the CPU support on our system, the next step is to actually install the related packages that enables the virtualization environment on your host machine. For example, I have these instructions for Red Hat Fedora or Sennoy system that you can actually install the virtualization group packages, for example. And yeah, and other systems like Ubuntu and Sennoy, it's pretty much similar packages that you need to enable on your host machine in order for KVM to work. And the next thing to check is that after we have installed all the required packages, so we need to enable the virtualization daemon library service, which is known as LeapWritD. So it's a server-side daemon and driver required to manage the virtualization capabilities of the KVM hypervisor. So here we have given two commands here is that we have, if you want to start the virtualization service, so we can system CTL start LeapWritD and if you want to enable it on boot, so we just add another extra command so enable LeapWritD. And one more step to verify that the KVM kernel modules are properly loaded. We can actually do LS modules and then grab for the KVM like AMD or Intel or if you use other processes, you have to check the related flux. Yeah, we can actually do this on my machine here. Let's see. Press mode. So if you can see on the screen here, yes, KVM Intel is there. For example. And next, this is much more for my own current testing for like, if we usually work a lot with KVM, it's a good idea to add, sorry, for the slides. I forgot about it. Yeah, is that better? That's good. So yeah, so if we work a lot on KVM using our local user account, so it's a good idea to actually append ourselves into the KVM and LeapRT groups so that we can create and manage virtual machines without the pseudo command. So it depends on your use case, but for me, for me to play around with KVM, this is much easier for me. Yeah, and for it to be recognized by the system. Yeah, log in and log out again. So yes. So yeah. And yeah. And one thing to know is that whenever you use the graphical user interface later on to create a virtual machine, if you don't have these groups that set up properly, usually you need to do pseudo or whatever privileges manual enter your privileges there. So so everything will be created as a privilege file system. So sometimes when you go back to your normal user, you cannot find the file system or cannot access the file system. So yeah, that could create some issues there. So another thing that we could do besides adding groups, append the groups, append ourselves to the groups to manage KVM. We also would like to append ourselves to the quick emulator configuration. So we actually append ourselves to the LIP virtual group and also we we start the LIP O2D so that the LIP O2D can recognize the quick emulator's recent changes. And yes the second task is that we manage KVM with the command line interface if everyone on the audience have set up their KVM support or follow along can we proceed to the next task? Yeah you still have you can follow along but just be mindful of the typical sudo versus non-sudo execution. Yes, I guess so. Yeah, yeah, yeah, yeah. Yes, I'll give yes. I can say at all did you mean this one? The second command? There are another group named the LIP O2D DNSMAR LIP O2D dash QMU QMU Yeah, which Linux distribution are you using? Okay, okay. I'm using Fedora so it might differs a bit but maybe you could check the yeah, I guess the documentation has that. I'm sorry. But why not if it would be the use of? Yeah, because yeah but this is it's good to have but if you don't have it's not the end of the world.  It has the installation when well? Sure. So so the next task is that we want to manage KVM using the common interface. So I chose this Debian example because it's I guess it's the lightest. I'm not sure. Disclaimer, I don't know whether it reaches lightest and reaches heaviest but it's quite quick to run on my system. My system is quite with comes with limited resources. Yeah, let's see. Let's turn on the terminal and we can install it from command line. You can see the terminal and there's a lot of flags here.  It's pretty well documented in the word dash install that dash dash help or the main pages. So it's quite clear for most of it like for example if I want to use the word install command to install a virtual machine I can actually give it a name OS variant Debian 11 description how many virtual CPUs I want to give it how many RAMs I want to give it locations network bridge and graphics and so forth and one extra thing or two extra things that here the second last line no reboot and no auto console is that to indicate that whenever the installation is progressing I don't want it to automatically reboot so that I want to see the status of the installation for example and no auto console which means that it doesn't pop up the console after this command is executed so usually when you run word install it would all pop up the console for you to view the virtual machine progress and the extra arguments are which means the extra the extra arguments is actually I need to read it out because it's a long description so this tells the kernel to use the TTYS0 or which means the first zero port with settings of 115 200 CPS no stop bits and eight data bits so it's a lot of information there so the zero port of the host and the target should be configured to match the speed and the speed the stop bits and the data bits so usually Minicom is used as the common zero communication program to access the console from the host ya, kita akan melihat itu dalam contohnya dalam perjalanan jadi ya mari kita menggunakan dan kita lihat jadi apa yang kernel ini buat sekarang adalah saya menggunakan dari net eksternal jika anda melihat itu saya menggunakan dari ftbdebin.org jadi ini seperti internet network installer jadi saya tidak perlu sebenarnya menggantikan ISO untuk sebenarnya menggunakan installasi dari tempat yang berlaku tetapi bagi itu kita mempunyai internet bandwidth jadi sekarang untuk kemudian yang kami ingin sebenarnya menghubungi pergerakan pergerakan jadi kami menggunakan pergerakan pergerakan jadi kami ingin menghubungi pergerakan pergerakan yang bermaksud penggantikan di tempat yang berlaku dan menunggu pergerakan 11 ya ini sedikit mudah tapi saya tidak mengharapkan kami menghubungi segala-galanya dengan pergerakan jadi ia sebenarnya menggantikan pergerakan ia hanya menggantikan pergerakan seperti pergerakan pergerakan dan menggunakan di tempat yang berlaku di tempat yang berlaku dan sekarang ia sebenarnya menggunakan pergerakan installasi dan saya tidak dapat melihat apa-apa dari sini jadi saya telah melakukan ini beberapa kali jadi jadi, sebenarnya anda tahu segala-galanya tempat yang berlaku tempat yang berlaku semua perkara ini ia sebenarnya dapat menghubungi kami akan menghubungi itu pada akhirnya kerana ini sedikit berlaku jadi sebenarnya kami dapat menghubungi pergerakan installasi tanpa saya menghubungi setiap pergerakan saya ingin menghubungi pergerakan saya akan melihat saya membuat penggunaan lokasi ke permainan banyak konfigurasi ok, mari kita periksa ini tidak berlaku ia melakukan menghubungi ke pergerakan jadi ia sebenarnya menggabungi pergerakan pergerakan installasi dari tempat yang berlaku tempat yang berlaku seperti tempat yang berlaku anda tahu pergerakan linux pergerakan semua perkara ini sekarang ia menggabungi dari internet dan menggabungi di pergerakan jadi ini akan mengambil masa kita akan biarkan ia berlaku di setiap pergerakan iya oh ya, anda boleh menghubungi pergerakan network dan ia akan menggunakan pergerakan default terima kasih iya anda boleh berubah iya, anda boleh berubah untuk membuat pergerakan dan pergerakan OS anda boleh sebenarnya mari saya periksa pergerakan OS beri saya sekejap saya beri anda komentar yang saya rasa pergerakan berbeda ada pergerakan OS yang berbeda jadi mari saya cuba pergerakan system saya aha yang ini anda dapat melihat jadi jika kita melakukan pergerakan pergerakan minus-minus OS minus pergerakan jadi ia akan beri anda pergerakan pergerakan OS yang anda boleh sebenarnya mengambil sebagai parameter iya iya seperti yang anda lihat di sini banyak perkara iya iya, kita dapat di sana sekarang jika anda kembali ke pergerakan tidak okey, mari saya periksa ia datang ke dalam kemudian saya saya sepertinya anda ada ini mari saya periksa pergerakan ini dulu iya iya, okey sebelum kita dapat ke pergerakan itu jadi satu perkara yang mengalirkan dari pergerakan ini juga bagaimana kita mengalirkan pergerakan ini yang digunakan oleh pergerakan pergerakan jadi kita tidak meletakannya di sini jadi ia sebenarnya membuatnya menggunakan pergerakan dan ia akan juga digunakan melalui dokumentasi dari Quick Emulator dan ada beberapa sistem yang kita perlu mengalirkan dan apa yang ia sepatutnya mengalirkan bagaimana satu apa maksimal yang sepatutnya yang kita dapatkan untuk pergerakan pergerakan ini untuk mengalirkan bagi contoh tetapi kita tidak akan meletakannya hari ini untuk sebab masa jadi, tetapi anda tahu anda boleh sebenarnya mengalirkan diri anda sendiri pergerakan ini menggunakan pergerakan ini jadi anda sebenarnya boleh mengalirkan ini jika anda ingin membuat seperti parallel 4 atau 5 sama mesyuarat virtual menggunakan data yang sama bagi contoh iya anda dapat mesej ini, kan?  So transient would mean that transient gas or gas virtual machine, it will not survive reboot. So it's like a system that exists every model. It's not persistent. Dan a persistent virtual machine, it would survive reboot and exist until you actually manually deleted it. During the life cycle of a virtual machine, the virtualization daemon would actually categorize this gas virtual machine in any of the following states. Undefined, which means that the gas virtual machine has not been defined or created. So at this stage that leap virtualization would not be aware of any gas in this state and will not report about the gas virtual machine that has this undefined state.  So the virtual machine is defined but not running. So it's turned off, there's no process running on the gas machine. It's just put in a state that it can be started again. Running, which means the gas virtual machine is active, has been defined properly and it's running. So the running state can be used by both transient and persistent state gas virtual machine. And pause would mean that the gas virtual machine execution on the hypervisor has been suspended or the state has been temporarily stored until it is resumed. So gas virtual machine that is in this state are not aware of they have been suspended and do not notice that the time have passed when they resumed. So we have to be aware of that. And save, it's quite similar to pause but the gas virtual machine configuration is saved into a persistent storage. For example, on your hard disk. And it's the same as the pause state that it doesn't know that it has been paused. So it doesn't know that the time has already passed when you actually restarted it. So these are some of the states that we need to be aware for the lifecycle of the virtual machine. Yes, I have a clear answer on that because I haven't tried it out myself. I'm so sorry. But if I encountered that situation, I would prefer to put it in a save state so that it could be resumed later on but I cannot confirm it at this point. And yes, we can also display the... Ya, this is more for debugging purpose so we can actually get the info of the virtualization library version and if you append the minus time as the day month so it's actually a useful argument that we can ask the day month to display the virtualization day month information too. So we can actually try that out actually. Let's see. Yes, you can see that here it has the last line is running hypervisor and then it has another extra information that it says that running against day month it wants zero. So it helps for you to debug sometimes. Yes, and let's go back to... Yes, and now we come to the stage of... we can actually connect to the hypervisor using the word SSH connect and give it a whole stem or the UI and optional arguments read only. So the most commonly used URIs are QIMU 3 slash system if the guest virtual machine is running under that domain or that UI it means that it... because slash-slash-slash system is owned by root group and the triple-slash session is usually unprivileged users like local users. So you just have to be aware of the differences when you try to root SSH list guest virtual machine sometimes that we cannot find our guest virtual machine using a local user because it was created using a privileged user such as root for example. So don't be worried if you cannot find your virtual machine if you have created or sometimes it's just to check whether are you running it against the correct UI. So this we have to just to be sure about. LXE is the local Linux container but we will not touch it in this example. So do you have a question? So to establish a session to connect your guest virtual machine with view as the local user so you can root SSH connect and click emulator using the triple-slash session. So this actually means that you are using virtual shell to connect to the session as a local user. And usually this connect and with the UI you can actually skip it when you use the root SSH command because it will get the default or the options that you already set it as a default value. So for example in my next slide, this slide you can see that I did not specify the connect argument there because I'm assuming that the root SSH would grab the default UI to use in this example but we can try this root SSH list or let me check whether the presentation yes, yes, it's still installing so we don't mind it so let's open the new root SSH we can try to use connect queue emu list all yeah I have to check how do we configure maybe I'm giving it the wrong command but yeah I might be wrong about the root SSH connect command I'll get back to that later on if I have the time so in the current slide yes, this one so if you want to list all the existing virtual machines that we are managing to our hypervisor or on our host machine we can actually do a root SSH list or if you just want to see the inactive ones you can pass like inactive see the SSH list let's help so there's some arguments here we can actually give it inactive to list inactive domains or give all list transients with snapshots, without snapshots for example and what kind of state they are in so yes and if you want to list the uuid or just the name or the id in the table format there are some options that you can always explore using the main pages or the help command let me check the root SSH connect command it's a root only this is built in command of the show okay okay, that's just to reconnect the hypervisor my bad and still wrong yes let's continue on to also we can display to get the information regarding our hypervisor hostname and sysinfo we can try that now hostname yeah this is my hostname sysinfo i'll put xml string to check why it's not fail to get maybe i need sudo i'm not sure yeah i need sudo yeah so this well sysinfo would actually get xml representation of your host system if you can see it yep and taking screenshots of virtual machine this might be helpful for some cases let's try this one you give it the domain you can actually specify the domain id which is like an integer id or the name in our case it's WN11 capital D or the UUID yep and if the guest virtual machine have multiple screens attached to it you can actually specify which screen that you want to take for the screenshot yep so it's save to display yes this is the screenshot that i have it's asking me to reboot so i'll reboot it yeah and if you can see in the top terminal you can see that once it reboot it doesn't actually reboot because i already specify in our installation instruction no reboot so it doesn't really actually reboot even though inside the guest virtual machine that we click reboot so in order to and if we check the status of the virtual machine again it's the state is shut off and let's say UUID yep and yeah that's how you get the UUID or ID i think do a table yeah ID is zero because it's not running yep in order to study again it's the next slide yes um yeah to study it again it's quite simple for SH start give it the identifier of the virtual machine you can pass in console and all the other optional arguments and for example console it will attach the terminal running versus to the domain console device for example this would be running on level 3 and pause for example and if this is supported by the KVM driver it actually start the guest machine from a pause state and auto destroy would mean that you want it to be automatically deleted after the guest virtual machine no it will be automatically destroyed when the virtual SH disconnects disconnects from the virtual machine yes and other other options you can go through the documentation there are tons of very good documentation online and let's see our let's try to study it again let's go back to this one and let's say virtual SH start WN 11 and then I don't press enter first I want to SSH connect no console yes console so I want you to see the console messages form the guest virtual machine doing boot and first virtual SH start WN 11 and then virtual console yes you can see the sorry yes I'm sorry for that you can see that immediately when I enter virtual SH start WN 11 and then when I use the virtual SH console WN 11 it will show me the console messages directly from the guest virtual machine inside my terminal okay let me yes it's running and if if I want to see the quick emulator screen yes as we were so you can see there it presents me the locking screen for the newly installed virtual machine that we have just run early on so if you enter the credentials according to your settings that you enter during the installation step you get to the desktop environment yes and let me go back to the presentation yes start we have seen it already so start we start the virtual machine that was already created earlier and currently is in inactive state for example shut off so if we want to configure a virtual machine to start automatically at boot we can actually use the auto start sub command of the virtual shell and this would this will automatically boots up the guest virtual machine every time the host machine boots up so if that's what you are looking for and reboot virtual machine we can actually try that actually let's see where is the root viewer so you can see partially yes and then show you the terminal let's see exit so so that it's being reboot let me check the status now it's running but yes it's running if you can see the yep so that's one way that you can interact with virtual machine if you want to reboot you can reboot using the virtual shell and there are a few reboot mode name that you can read in the documentation like for example in this command let me show you the slides again yeah so in this example I can actually pass in it CTL reboot mode for example so this is something extra depending on the time we just go through it verbally so we can actually save the guest virtual machine configuration as an XML file for various purposes yep so we can actually you save and then put in your guest virtual machine identifier and then the file name and then running is we have to explain this running and pause running would means that when the save occurs it will overwrite the state recorded in the save image to start the guest virtual machine as running and if we put in pause it means in the same way so it overwrites the save state that is recorded in the XML file to start the guest virtual machine as pause state virtual machine so that's what was define the documentation and define so if we want to define our guest VM by hand like from scratch XML we can actually do that you can actually using the define command I will not get into that I am not an expert in that and we can actually one thing we can actually also extract the guest XML file maybe for backups or for future analysis but let's try out this I haven't try it out myself so save image save image xml file to open this will okay this will actually require the virtual machine to be in a save state so because my machine is still running so I cannot run this and virtual shell save image edit it's also it will also indicate that when the guest virtual machine is save the resulting image would indicate that the virtual machine should be restored into running or pause state as the optional arguments so this one would it also would save the image edit file I will just list this for reference but I will not run that as an example and resuming maybe we could try this will actually resume let's try this one here you can see my state okay good let's try sh resume pause does anyone know how to pause it I haven't try it myself sorry but yeah there is a command to resume so I have assumed that it must have command to pause but I will look it up later but yeah so this yeah let's try that's true suspended thank you very much and you can see that when we suspend it's in pause state and we can actually resume the state it's running again thank you yes word viewer you mean it's not taking an XML file I can go back to the slides again let me show you this one you mean this one the XML file I think I mis explained we can actually define actually good question so the question was asked there was a question that was asked here that is there the difference between word sh and word sh create and word sh define let's see create it create a domain from an XML file create a domain and define sorry define yes so the difference what I understood from the documentation is that create would create the XML file and also start it automatically but define is just defining the XML file but that's it normal action is done against the XML file resume resume we have done that display host physical machine name interesting maybe we can try word sh dome info to get some information word sh dome info Dapien 11 for example ya it would actually show you some statistics regarding the guest virtual machine running underneath your hypervisor so we can see that the UID CPU time and those sorts of interesting information word sh dome ID is just to get the ID of the virtual machine so I guess this is one because I only have one running this is something extra which I cannot show you because I'm not running I'm not running a job but inside the virtual machine but usually when we run a guest virtual machine we run some tasks like maybe CICD pipeline running inside the guest virtual machine so this would actually pause or try to abort the job that is running inside the guest virtual machine and this would also list some information about the job I'm not sure this is running anything but we can try dome job info Dapien 11 ya there's no job inside the virtual machine ya so this is just some helper tools to translate the guest virtual machine between ID name and UUID so ya domain state if you want a single state yes yes if you can see here dome state running and ya shut now everyone must know how to shut KVM so the command is simple which will show shutdown and same as reboot you can give it the shutdown mode name and in this example ACPI mode so let's let's see this is our Dapien desktop running it's not running anything now so let's shut it down shutdown Dapien 11 so it's being shut down and if we list the state the state is back to shut off ya suspend ya I forgot about it and reset with this is like the you know the reset button that we have or you know we long press our laptop to force it to shut down I'm sorry I need to share the slide so yes shutdown we have covered suspend as we have used earlier to suspend and then to resume and then to reset and this is as I mentioned ya this is the same as we press the reset button in our old computers where we have this reset button or we long press on our laptop power button so this would actually sort of kill the power and we initialize the internal state so this would mean also there are risk of data loss if we use this command so just use this if you need to do so ya and stop running gas virtual machine to restart it later so this command saves destroy or stop running gas virtual machine so that it can be restarted from the same state at the later time it's a bit complex to explain here but so when it is used with word shell start command it is automatically started from this save point so in short it's like you want to save and destroy but you also want to sort of keep a part of it so that you can actually resurrect it in a later stage so to speak ya this is some extra commands that is dealing with listing, creating, applying and deleting a snapshot in managing virtual machine usually we want to take a snapshot to have a history of the changes in the gas virtual machine so this command would help us to actually do this first and yes undefined would actually mean that we undefined undefined and remove it completely so if it's if the virtual machine is active which means it's running when we run this command undefined it would mean that the virtual machine would transition from a persistent state to a transient state because the definition of the virtual machine has been undefined by a virtual shell but it's still running so whenever so when that execution ends or it shutdown so that would be gone so let's and and if we want to force gas virtual machine to stop immediately we can actually use would destroy command so this is like this is to mean a forced shutdown it's an ungraceful shutdown so data loss would be expected so in short we have various way of terminating virtual machine shutdown would mean that okay i send a signal to the gas virtual machine i want you to shut down properly take your time to do it but please do it everything gracefully and the other way is that you use the destroy sub command which like okay power off now and undefined which means that it would remove the definition of the gas virtual machine from virtual shell listing so it no longer recognized by the world ashesh command so yes this tree just have to be aware of and some other related commands is like a rule ashesh node info edit we could try that actually and node info let's exit this one let's do this one is it there okay good rule ashesh node info terbian 11 is it running yes i think we stop it earlier ya it's being shut off okay let's try rule ashesh edit them so if we go back to presentation you know rule ashesh edit remember that we can define virtual machine using the xml file so to edit you can actually use world ashesh edit so you can actually go through the xml file and to modify it manually so usually we don't need to do this manually by hand but it's good to know where you can find the configuration and to investigate what went wrong and with the ftop it's just to list the file system that is being used by the gas or by the hypervisor i assume let's try sorry fs to list fs display free size world top this would actually be similar to our top command when we run the top command on our localhost local machine so since that we already shut down our virtual machines nothing is running in the background and we have go through the virtualization dash viewer you see the graphical user interface of the gas virtual machine and the pool list all ashesh pool list all yes this would mean the list of pools that the virtual machine is used for organization you can set up multiple pools for for segregation purposes or organization but i haven't used it quite much so i would not go deep into that would install os wearing list so i guess we have experience here at the audience that it's also depending on your linux distribution whether it returns updated list or not and yeah i have few more examples like you can install ubuntu fedora or what sort from the network and also from iso image if you have and some of the troubles that i have not troubles but some of the issues that i experience is that sometimes it refuse to undefined and because the domain manage safe image exist so i actually have to use the manage safe remove to remove the image for the domain virtual machine and then only i can undefined so these are some things that we need to be aware of and sometimes the network virtualization network devices are not there it's because i'm not sure why but i did a restart of the virtualization services and when i do a bridge CTL show my example here so it works again so sometimes it's good to check whether a restart of the virtualization service helps or not because it just refreshes the virtualization configuration and in some linux installation you would probably the installation hangs at the bios screen with probing edd equals off to disable so it just hangs there so what we need to do is actually have to actually add another extra kernel arguments with edd equals off so that it would just bypass that edd checks so edd means that bios enhance this device services and this is the fail to get domain so we need to ensure that the specify storage pool has correct permissions and path we can actually try that just to show you pool.maxignal yes so if we do this pool.maxignal command it will actually list which path that restore our file system for our virtual machine for example in my context it's under my home actually local share read images and the permissions we have to also check that are we allowed to write and read from there so sometimes if we run as sudo against a different pool with a different file permission then it might create some issues for us yes get back to that here we go yes so yes if we encounter fail to get domain check that whether the storage pool have correct user permissions and the correct path are we loading it for referencing the correct path cannot access storage file from the QIMU command so same like the word SH append group so we have to append ourselves to the QIMU configuration into the proper groups and yes and sometimes if for example if we did do the sudo append groups sometimes to face like this example word SH net list or why I cannot see my default network which should be access on all services yep I have 2 minutes or 1 minute left so yes I don't have time to go through the graphical user but it's quite straight forward for the virtual machine manager I have some screenshots there so you can go through at your own free time yes I'm open for questions if anyone has some that I could answer yes yes the question was asked here is that the word install command and the word SH define XML it's just a different approach to create a definition for the guest virtual machine yes yes just just have to try it out I think the word SH install I'm sure that it pretty much translated to an XML file when you do that yeah when you install it will talk to the word SH and then will define that as an XML file in the background yeah I have some bonus task if you want to do it at home try to do preceding or kickstart you know skipping all the yeses no no thing on the installation process and try to assign a host USB to your guest virtual machine just for a test it's fun and thank you very much if there's no further questions yes, I appreciate everyone spending time here and I don't want to interrupt your lunch


The federal government of Nigeria has approved the first-generation technology, also known as 5G. So, it's a 5G policy that the government has approved, and we know that the Minister of Communications and Digital Economy, Professor Issa Pantemi, went ahead to say that the Nigerian Communications Commission, the NCC, should go ahead and ensure a nationwide roll-out of this new technology in the country. But there are lots of speculation among Nigeria as to what exactly the impact of this 5G technology is regarding their health. We know that the 5G technology was at the heart of the COVID-19 conspiracy theories, but we'll be speaking about that, and we're spelling all those myths with the Business Growth Consultants, Gamaliel Sanimo Moor. Good morning. Thank you for joining us. Good morning. Good morning. Yeah, so I want us to first talk about the 5G technology. What does it mean, and how can it help Nigerians? Okay, once again, good morning, Lagos, Nigeria. But 5G is the... I mean, 5G means five generations. It is the latest cellular technology. And if I'm going to explain this to a five-year-old child, let's put it on a scale of 1 to 100. So we have one, two, three, four, and five. So we are on number five, as it's way, on that spectrum of cellular data technology. And that is what 5G means, is an improvement on 1G, 2G, 3G, 4G, and it's way. Thank you. Oh, well, explained to a five-year-old, like you said, but I want us to understand what 5G brings into the technology space in Nigeria. Because a lot of Nigerians might be a little ignorant as to what even 4G was. They would simply interpret it as faster internet services and being able to maybe download faster or anything like that. So help us understand what it really brings into the science and technology space, the business space also, here in Nigeria. And why do we even need it? Okay. So we need the 5G because of its multi-dimensional impacts on the economy. So looking at 3G and 4G adoption, we have evolved from calls to data to multimedia messaging, and then we have gone as high as video streaming and all of that. 5G will help us and nest the potential of the technologies of the 21st century, which includes artificial intelligence, robotics, machine learning, internet of teams, and so on and so forth. So it is good for us as a country because we are keeping in pace with the other countries who have adopted the 5G. South Korea has adopted 5G. Norway has gone a step further to 7G and even 8G. So as a country, it is good for us. But the question is, how have we optimized the 3G and the 4G respectively so that this doesn't become some sort of psychological satisfaction for the government? How well have we maximized? How well can the average man on the street relate to the gains of the 3G and the 4G technology? But broadly speaking, it is good for us because that is the next big thing. But go ahead. Go ahead, Mr. Tanimo Amor. Talk about maximizing the potential of 3G and 4G here in Nigeria. Because we have, I think some of the things that they always speak about is internet penetration and some of all of that. But have we, or would you say from your experience as a country, been able to maximize 3G and 4G technologies here in Nigeria? Okay, thank you. So let me keep in a little bit of data. According to the NCC, the 3G and the 4G adoption in Nigeria is slightly above 40%. And for me, that is not even a pass mark. The internet speed in Nigeria currently, as I speak, is 1.5 megabyte per second. And in the ranking of two oil and seven countries that was profiled, Nigeria is 176th on that scale. Ghana has an internet speed of 3.2 megabyte per second, which about 100% of what we're currently doing. So we have not even harnessed the potential of 3G and 4G. Let me divert a little bit and go to the Nigerian National Broadband Plan 2020 to 2025. One of the four critical pillars is number one, infrastructure. Number two, funding and incentive. Number three, policy. And number four, demand drivers. Right of way is a conversation that is ongoing right now. And I know that you are aware. Equity state has granted right of way to main one to allow it to lay fiber optic cable on a state road. But as I speak, right of way from the federal government is 145 per linear mile. But some states charge as much as 3,600 per linear mile, representing about 1,200% increase. So the question is, as an investor, if I want to come, does this make Nigeria a destination for me? If I look at all my variables, so I have to pay for right of way, then I have to pay for local government. I have to pay for area boys, area girls, area children. That's a lot. And that is an infrastructure lecture. I do not think that we have optimized 3G and 4G much more jumping on the 5G trade. Take you up on the first point you mentioned regarding the national broadband plan, which is infrastructure.  And does Nigeria have what it takes to go ahead and roll out nationwide? Okay, nothing is impossible. So if other countries have achieved it, we can also achieve it. But growth in itself is not linear. So one of the infrastructures we need is fiber, lane of fiber option, broadband penetration. And currently, that is low in the country. And for an economy that is struggling like every other economy post-COVID, we need to encourage growth in all oil sectors. It has been proven that if we can achieve a 10% increase in broadband penetration, there will be a jump in GDP between 2% to 3%. And if we are also talking about taking our own side or size of the cake in the global economy, then we need to do more around infrastructure. Infrastructure is very critical. And we are at an all-time low when it comes to deploying infrastructure. Of course, 5G is still in its first stage because of the cost of deployment. And that is why we have to also tread carefully in that regard. Also talk about some of the myths that we've seen during the COVID-19 pandemic. We heard people say, oh, it was the time where the federal government was actually laying this fiber up to cables on our streets. We saw those happen. So people went on to say that this is costing the COVID-19 pandemic. It's making people find it hard to breathe. And this is not the first time we've seen something like this. Why do you think these conspiracy theories come up that 5G technology is harmful for our health? Do you think the religious organizations that we've seen put our messages online, have something to do with that? Or do you think it's lack of information, lack of communication from the government? Where is that information gap and how can we fix it? I think it's a blend of several factors that you have mentioned. So one of the things is my people perish for lack of knowledge. People do not have sufficient knowledge on what 5G means and all of that. So it's one of the conspiracy theories that is as emanated, and particularly from the Christian faith. So our leaders, our religious leaders need to do a lot about sensitization because religion is the opium of the people. If we hear something from either your pastor or your Imam, the chances are that you are likely to hold on to it without personally verifying the truth. Another thing is also, I mean, advocacy and information. The government needs to do a lot about sensitization. So look at the rollout of the vaccines. There has been little issues here and there, blood clotting, et cetera, et cetera. But the government has the judicial responsibility to drive this awareness, advocacy, to distill information into its granular state so that there's no ambiguity as to what 5G means and as to what it does not mean. But I think it's a conspiracy theory because the water organization has proven it that there is no correlation between the 5G and the pandemic. All right. Also, go further into fears that may exist with regards to 5G. Is there maybe any fears that data might become more expensive or it might be a little bit more technical and any of that here in Nigeria? No, no, no. I do not subscribe to that school of thought. In fact, the more we achieve broadband penetration, the chances are that data becomes relatively cheap. Now, referring to the Nigerian National Broadband Plan, the strategy is to achieve the costs of one gigabyte at 390 Naira. That is a plan. That is a big, audacious dream. So I do not think it will need to increase data costs. I don't know about that. However, I worry about the quality of the data that we will have at the end. So those are my worries. These are my fears. Also share a little bit on some of the things that you mentioned earlier. Why our implementation or maximization of the potential of 4G, what do you think might be the reasons we didn't do so well with that? Okay. So objectively, I think one, it is from the policy angle. Government is the biggest influencer. Government is the biggest spender. So if we must do anything right, we must avoid policies of assault. So we can take one step forward and take several steps backward. So this might be out of context or out of discussion, but look at the Twitter ban in Nigeria. A lot of Nigerians have risk. Sorry. Go ahead. It's something I was going to bring up or eventually, but go ahead. So a lot of Nigerian youth are resorted to microblogging, which Twitter has afforded them the opportunity to do. But all of a sudden the government came and placed the ban on that. Imagine how much has been lost to the Twitter ban. If I'm exaggerating, it should be about 100 days or more that that ban has happened. So if one of the critical pillars for the Nigeria National Broadband Policy framework is policy itself and government is the one driving policy, then we should not speak from both sides of the mount. There should be a coherence in what we say and how we do what we say. And that is a problem with Nigeria. It is where execution has always been our problem. We speak all the English. We like all the cliches, enabling environment right of way. But when it comes to implementation, we really allow things to slip to our hands. Okay. Can you also speak about the excitement of artificial intelligence and robotics? It has been in the minds of people since the 80s and hoping that we get to that place where there is now more fascinating artificial intelligence with our communication. And maybe robots might be more involved with doing business here. Across the world and here in Nigeria. So is that something exciting? It is. It is. It's a privilege to be alive during this season. So in 2018, I visited Rwanda for the Smart Africa Summit. And a robot came and spoke to the audience. And this robot can speak six languages fluently. And that is a power of technology. We need to ride on that. So it is the latest thing. And I'm using this opportunity to ask for the federal government to, as a matter of urgency, look into our educational sector. Our curriculums have become outdated. A 17th century syllabus cannot produce a 21st century graduate. Let me say that again. A 17th century syllabus cannot produce a 21st century graduate. So let's begin to introduce all of these new technologies into our syllabus. Let's introduce robotics, artificial intelligence, and away from medicine, away from law. Those courses are good. But we need to increase the attractiveness of our human capital index. We need to increase investment in human capacity. And that is very, very important. So that is a new normal. And we need to align with it. All right. Finally, Mr. Tani, one more. What difference would 5G policy make in Nigeria? How would it benefit Nigerians? And talking about investment into our technology space, what do we expect to see? Okay. Let me say that growth is not linear. Growth is a sum of averages. So you can't hold 5G in isolation without looking at the things that will fit into 5G. So if you must look at 5G, can we also move power generation up a little bit? Currently, our power generation is about 4,000 megawatts, which is grossly inadequate for a country of over 200 million people. So we need to look at all those conversations. So it is good we are looking at 5G. But let us also add several other things. Let us reduce a little bit. Let us grant tax incentives, tax waivers. So if you and I are going to set up an investment in this country, let us look at the policies. So it's not just the 5G itself. It is the averages, the law of averages. That is what will make 5G become a tool for economic growth and development. But if it happens, I'm sure it will have positive spiral effects on our economy. Because like I said earlier on, a 10% increase in broadband penetration will lead to a 3%, 4% increase in GDP. And we need this GDP growth now as a country. Is there any fears of job losses as we involve more technology into our workspace? No, I disagree. In fact, there will be more jobs. Because right now people are going to go remote. The gig economy is the biggest economy right now. It's worth trillions of dollars. So people can work remotely and can work with several employers and have the ability to hone their skills and make it a global appeal. So people are not limited to one employer. So I'm not just with GlobalCom. I'm not just with some brands. I can work for my laptop and freelance my skills. So I don't think you need to do lots of jobs. Maybe initially, yes. But like I said, looking at the law of averages, it will lead to more jobs. All right. Gamalil, Tani, Momo. Thank you very much for your time this morning. It's an exciting place. We are across the world with regards to technology. And I hope that Nigeria can tap into it. Like you've said, it's important that we maximize the potential of 3G and 4G before we simply just dive in at first into adopting 5G technology. Yes. And developing other sectors of our economy like power. Thank you. Thank you for having me. Good morning once again. Good morning to you. All right. It's been a very interesting Monday morning. Thank you very much for staying with us all through the program this morning. We want to wish you a great Monday ahead. It's rainy, I believe, here in Lagos. I'm not sure what it is like in other parts of the country. But drive safe. And we wish you a very great day ahead. If you miss out on any of the conversations, remember to catch up on our social media platforms. It's simply at Plus TV Africa on Facebook and Instagram. Same with our YouTube channel at Plus TV Africa and Plus TV Africa Lifestyle. You said it all, Sao-Gi. Thank you very much. Thank you too. I am Annetta Felix. And I am Sao-Gi O'Born.