Archive for March, 2008

A case for virtualization

Saturday, March 29th, 2008

Virtualization may be a term some reading this may not know about – so I should start there :) So what is virtualization? Virtualization in the sense of what I’m talking about here is the ability run an entire operating system, more or less, within an application. Why would anyone want to do this? Well, I’ll get to that soon :)

How do many people develop right now? The diagram below hopefully will illustrate it somewhat:

Many people take their base machine, install all these services on it, and develop right on it. Is this an OK solution? Of course – I mean if people feel comfortable with it then that’s OK – but in my opinion is it the best option? Definitely not.

why?

Virtualization allows you to abstract the services you’re using for that specific purpose. If you’re developing web applications, you may want apache, postgresql, and other services installed to test your web apps. Do you only do web app development on that machine you’re using? My guess is no. No one spends 100% of their time on the computer doing one single thing. For example, for myself, I spend maybe 40-50% of my off hours developing whereas the rest of my time is spent listening to music, browsing web sites, and so on. Why do I want to run postgresql all the time? Why do I want my test environment running all the time? The answer to all that is that I don’t want it run all the time. I really would rather have my development environment available when I need it, but turn it off when I don’t. This allows me to reduce the total number of wasted resources which would normally end up being used (unless I created scripts to kill services when not needed – I have done that in the past). Furthermore, from a security standpoint, less services accessible from the internet the better. So running all your experimental stuff in a virtual machine, without as much worry over security, is a nice peace of heart thing.

So with that giant bit of why to do this, what do I propose one uses instead for development?

What’s different about this? On my host machine, on my macbook pro in this case, I have absolutely nothing checked in my sharing tab – nothing :) This makes my machine a tad bit more secure overall than before. So what about the virtual machine you might be asking – what about its security? Well, my fine friend, basically if you set your virtual machine to use NAT, it gets an IP address from your host machine. Why use NAT? The reason I use it is because I’m only accessing the virtual machine from my macbook pro, I don’t want it accessed from outside it. Furthermore it can access the net when it needs and when I’m doing development, I don’t actually need the net for anything. Cool huh.

To summarize the benefits and negatives of virtual machines:

Benefits:

  • Abstraction of the entire development environment – much more control
  • Easier to update many packages (from a mac perspective, ports and fink aren’t always reliable)
  • Considerably more secure than trying to secure all these services while running on your host machine
  • Overall CPU cycles and memory use could be improved, this assumes you keep the virtual machine off sometimes.
  • Backups are extremely simple. Want to install something risky but afraid of messing up the system? Copy the entire virtual machine file, then run the code
  • VMWare (and I’m sure others by now) have great integration with the host machine. Shared folders, to keep the code accessible on the host machine (say if you want to use textmate, but test in the VM).

Negatives:

  • Slightly more disk usage space. You have the overhead of the virtual machine. My test vm is roughly 2.5Gb right now and has everything I need installed – it can get larger and larger depending on what you use it with.
  • Memory use while the VM is on can be high – you will need the RAM to do this. I have 2Gb of RAM in my machine, and have roughly 500Mb either free/inactive with my virtual machine on. It has 512Mb of RAM dedicated to itself. Ram is pretty cheap, though, so having some won’t hurt much I’m sure
  • sshing to test stuff may feel awkward at first. This is only if you use linux, but I do – and have shared keys all over to make sure I can log in without a password, and have scripts that run here and there that help ease the problem of virtual machine integration. Overall, this is a very weak point for me, as I rarely have problems with the integration given what I’m doing

I hope this gives a brief overview of virtual machines and what they are capable of. There are many projects out there that virtualize including VMWare (for all operating systems – my personal favorite), Parallels (for the mac), and VirtualBox (available for most operating systems – free). There are others too, you can find them through google. While I’m a huge fan of VWWare (especially their fusion product for the mac), I’d try VirtualBox with whatever you want first to see how you like it before switching over to VMWare if you so desired.

How to live like a monk

Saturday, March 22nd, 2008

Zen habits is a nice blog that I like to frequent, and recently they posted a really nice article here:

I read this, and I felt this really chimed in for myself. I have the upmost respect for monks, and while I am not one, I do like to spend a weekend when possible at the Ryumonji Monastery in Iowa.

1. Do one thing at a time: This is really important to being with less stress. To illustrate what happens here is when I’m cleaning my home. I usually dislike cleaning, and when I’m cleaning I think of everything else but the cleaning of my home. I think about the computer, about people I’d rather be talking to, or the book I’d rather read, or the practice of the piano or the trumpet…the list goes on. I think about those things, and frequently visit the computer – and to do what? not clean. I’m too busy doing multiple things and cleaning isn’t done as much..so I waste more time, and cleaning takes longer and I just hate it that much more. The key is really to do one thing, and only one thing at a time.

2. Do it slowly and deliberately: I wouldn’t really agree with this in that things should be done slowly, in that it should be done with mindfulness on the the task currently being done. This follows with their next point, Do it completely, but really I’d say both of these are one point. Do it as slow as necessary, but the speed doesn’t matter – what matters is where your mind is at during the task. Don’t go too slow just because this says so…but don’t speed through it and be sloppy either. Balance is key.

3. Do less: This is something I really try to work on, and really this is more saying be realistic than anything else. What do I mean? For myself, I routinely spend time creating a huge list of things I want to get done – and I get done with roughly half of them, and that’s rushing through it. It’s nice to set goals high, but to set goals realistically is probably a better option than setting really high goals and not meeting them. This builds a lot of self esteem

4. Put space between things: Anyone familiar with the 7-habits of highly effective people will understand the importance of this. Basically we have stimulus produces action – and the space in between these two is the planning and the free will portion of the equation. The key is really to give time to really think about the task, instead of just jumping right into things. The point on the article isn’t described this way, but this is another area where I disagree with what they are saying. Having actions close together is fine, but the space between the stimulus and the action is way more important.

5. Develop rituals: I’m reminded a bit about how people are effective in anything, when looking at this point. How do people learn how to do something, and be good at it? How do people lose weight, learn to play the piano, learn to drive, learn to speak another language? It comes from constant repetition to really learn something. You can work out really hard one day, and not work out for 5 more days and be less close to a goal of less weight, than if you worked out all 5 days for 1/5th of the time and intensity. Setting a time for doing things, a block of time, is the way things can get done – and be on the “radar”. This doesn’t mean have an absolute perfect schedule, that’s impossible. What this does mean, though, is say from 6 to 6:30 PM I plan to work out. Put it on the calendar. Does this mean you’ll work out every day? Of course not, what it does mean, though, is when 6:00 comes around and if you’re paying attention, it has a better likelihood of being completed. I think this is really important, and something I personally need to work on more and more. This follows their point, Designate time for certain things, which is #7

6. Devote time to sitting: People don’t necessarily need to meditate here to really get this part working. As the author of the article writes, she uses running as a way. Personally, I like meditation, but I also enjoy reading and also listening to music. So…where this comes down to is dedicating time, every day, for just YOU. If you’re married, have kids, doesn’t matter – a good half hour is something that’ll really refresh your soul to speak. During this half hour, you should pick an activity that you enjoy doing – but isn’t related to other people. I discourage the use of television, or video games for this because both are really a waste of time. For myself, I enjoy picking a listing of classical songs, and playing them during “my time”. I do nothing else, only listening to the music – so no computer, no reading, just listening to the music. It really helps, and I’m sure it’d help out a lot of people if you give it a chance.

7. Smile and serve others: I encourage everyone to volunteer some of your time. Personally, I work at a food pantry in North Liberty. While I feel that some take advantage of the pantry, I can feel also that some are being really helped by going there. Giving a bit of one’s time to others is a fantastic way of seeing the world in a new light. I don’t know how really to explain this – but one becomes a little less greedy and self centered when helping others.

8. Make cleaning and cooking become meditation: While at Ryumonji, I heard about a monk who cleaned. I don’t recall the entire story, but basically a new monk came and was didn’t pay that much attention to the monk who cleaned, because he didn’t do his sitting meditation like the others did. He, and probably a lot like him, feel that meditation is only when sitting down – and that the “wise monks” come from those who are in seated meditation. He learned, though, that this monk who was cleaning and cooking was greater than the others in wisdom and knowledge. He was disregarded because of what he did, but was really great. The morale of this story really is that meditation isn’t only at the cushion. Meditation is something that should always be taken with you – cleaning, cooking, typing up a blog message, listening to music, whatever.

9. Think about what is necessary and Live simply: This is one of my hardest things to overcome. I am a gadget freak to a very large degree. I have 3 computers, television, ipod and headphone setup, ebook reader, lots of books, video games, and so on. Much of these items were purchased before I really took up the study of zen, but I think it’s really important to try and see an item but say – “Is this really necessary?” I have a really hard time doing this, and it’s something I constantly need to remind myself of, but I think it’s also pretty important to do. Does this mean not to give yourself “fun stuff”? Of course not. What this means is try not to overindulge as much.

/I have a lot to learn too when it comes to how to better live and to live with less. This article really struck a cord with me/ because it speaks so strongly of what I should and shouldn’t do. There’s a lot to learn from monks. I encourage people to read the original article, hopefully everyone can pick up a little something from there

Site Mission Statement

Tuesday, March 4th, 2008

Hey all,

I thought it may be good to go over what I plan for this web site in the upcoming months, and how it’ll be different than my previous web site(s).

First, I had a number of requests to increase content, so I’m going to start by moving all the stuff I had on my old site to this one. This includes my scripts (which I’m going to add to – I have a lot of scripts I use almost on a daily basis now), new applications (I’m going to omit the old ones that I don’t want to support. Larger apps will have their own subdomain). Another thing, and I was quite surprised by this were the two following used items from people:

My art – I’ve had a lot of hits on my old photography and art areas of my site. I’m really pleased about this, and some of the most hit stuff I moved over already and made it compatible for how they were using it (some people like my backgrounds for their myspace sites – I didn’t know this, hehe)

RSS Feeds – I had some subscribers using google’s RSS reader to view my site. I am planning on implementing an RSS solution for the web site, and will make it backwards compatible for those who had my RSS on google (unless that changes between now and when I get this done, in which, I’ll improve upon the feeds)

More as well… I’ve been in a big kick about the whole zen-way of living one’s life. This includes trying to live with less clutter, being more proactive, and so on. I’ve taken some classes, am reading some books, and I feel that I can share this information. I’m also contemplating giving programming tips-n-tricks/tutorials as well. Once I get all the bugs worked out, and a bit more content added, I plan to have a vote which I hope people take into account. I’ll put the languages I know the best on there, and will let people vote on which one they want represented the most. From those results, I’ll prioritize the way I do articles. They will probably end up like blog posts, but that’s not bad anyways because I can create RSS feeds for these too.

I see good things for this site in the future. I want to thank John, Jay, Yelena, Shane, and Mark for their feedback in the site so far. You all have been really helpful :)

Warm but wet day

Sunday, March 2nd, 2008

Trying out a 2nd blog post tonight.

It has been a nice day today, reaching almost 50F. I went outside to double check on the motorcycle running ok (it just got back from the shop recently) and it ran perfectly. I sat out there for a few minutes thinking how nice it’d be to go for a ride. Unfortunately, because of the cold weather, there’s not a lot I can really do.

Outside that, I think the site is coming along pretty well :) Some areas are still not working 100%, but I ran out of time tonight, I need to finish a review paper for my class and prepare for the week.

New Site

Saturday, March 1st, 2008

Hey All,

I’m finally switching from my old site to this one. This has been an on and off effort for roughly 3 months now it feels. I spent a lot of time developing the site, but even more time trying to remember what I did last..haha.

While it did take awhile to finish this, I think in the end that it’ll be well more worth it though.

So what engine am I using for all this? I decided upon Django with Python. The code itself for this site is extremely small as far as code is concerned. The content, of course, makes up the majority of the site.

So what all changed since my last site’s last update. Well, quite a bit. I moved jobs to the University of Iowa some time ago, but am also a graduate student.

The goal of this site is a bit different than before too. I hope to put more effort into this site, and into trying to help teach some stuff. I’m really excited about the class I’m taking right now (22C:242 – Data Mining) and hope to put some information here as I learn more about it.