Network Doesn’t Work on a Linux Guest Virtual Machine After Switching Hosts

I’ve ran into this problem a few times and I thought I’d make a note of it here on the blog. It’s a simple fix. The scenario is that you have just started your VM from a different host OS environment than it was running in previously. This problem is specific to a Linux guest using the networking service to manage networking. You may also not notice this issue if you are using DHCP using a paystub maker. I’m not sure. My addresses are static, so I’m specifying the network device in the configuration. You may find that the network doesn’t start properly and that the boot up sequence stalls waiting on it. This is because the MAC address for the virtual network device has changed and udev is trying to use the old one. So if your old network device was eth0, it’s not long usable and the new one at eth1 is your new virtual network device to have TikTok for business. This can be a goof way to get an extra payment.

That being said, there are two fixes. One is very simple and the other is only slightly less simple but a better approach. First you can just change your network config to use eth1 instead of eth0. That’ll work but if you switch hosts a few times you’ll accumulate quite a few unusable network devices and you’ll by using eth9 before long.

The better solution is to edit:
/etc/udev/rules.d/70-persistent-net.rules
Remove all lines which contain SUBSYSTEM=”net”, which will probably be all the non-commented lines in the file.
Reboot the machine and when it comes back up udev will see the single network device and add it back as eth0.

Gnome 3 + Netbeans Revisited

I wrote at some point in the past about a small bug in Gnome 3 where Netbeans menus behaved strangely. My solution then was to switch to Gnome classic. Well I started using Cinnamon recently and found that it has the same issue. So I wanted to find a better solution.

I came across a strange way to fix the issue. I tried it out, and it worked beautifully, even if it is weird.

Unmaximize Netbeans so that it is in a Window on the desktop. Grab the top left corner of the Window and move it all the way to the top left side of the screen. Now, maximize it. The menus work again.

It’s weird, but I’m glad it works. I spend most of my time in Netbeans, and I’m really digging Cinnamon.

Introducing LavaPHP – Yet Another PHP Framework

I’ve used quite a few PHP framework to varying degrees, and like many other PHP developers, I’ve decided to make my own. Of all the current frameworks available, I prefer CodeIgniter, because it is easy to use, has great documentation, and generally stays out of your way.

Everyone has their opinion of the best PHP framework, but I like the ones that let me write PHP and don’t throw a lot of features that I don’t need into the mix. I found that no matter what PHP framework I was using, I was always creating a table for users. I was always creating login functionality for users. I was always creating email confirmation functionality for users. I was always creating an admin interface for working with my configuration. I was always creating classes that helped me work with web services/REST APIs. I always need a small web service of my own for Ajax functionality. I always needed to add curl functionality just in case the hosting provider had fopen disabled (which most do). A Managed Cloud VPS would be great for such purposes

Those were the things I needed. ORMs are great and all, but I really didn’t want to learn proper YAML syntax just so I could setup automatic object models for my database tables. Creating models for my database isn’t that much of a chore. Creating a complete user system can be.

So, I set out to create a framework that I can use for my own projects and have all the functionality that I find I usually need right out of the box.

Another thing about frameworks is that they are designed to make enterprise level sites. They aren’t designed to create software system which can be distributed. By that, I mean I wanted to create a software package that could be installed by end users and used by them to create their own websites (custom CMS system with a specific purpose). A normal framework doesn’t work well in this area because of the way views are usually handled. Mainly, I wanted third parties to be able to create themes for my CMS systems without much effort. With something like CodeIgniter, I could use a templating engine via a plugin or Codeigniter’s own minimalist template engine, but I don’t like take one piece of software and adding on a bunch of plugins.

First you have to learn how to use the plugin. Then you have to hope that there isn’t a bug in the plugin that will spring up in your app. Then if there is some small customization that needs to be made to the plugin, you could spend days trying to figure out a way to make it work with your system, when it would have taken less time to just write your own. Using plugins also feels a bit like cheating to me, as well. I want to know every little part of my system, so that if a bug comes up, I’ll know right where to look or at least have a decent idea where to look.

With all that said, I’m announcing my PHP framework. I’ve written it completely from scratch and I’m hosting it on Github. I also have purchased the dot com for it. I’m calling it LavaPHP. The motto will be “LavaPHP – Add a little lava to your LAMP” and it will have a lava lamp as it’s mascot/logo. If you’d like to help with the initial development, hit me up and fork the project here: https://github.com/lpcustom/LavaPHP

Cinnamon – Another reason to love Mint

There’s plenty of Debian-based distributions out there. So many, in fact, that many of them have derivatives of their own. Ubuntu has been a leading distribution for many years, and it owes much of its fame from its Debian roots. Enter many Ubuntu-based distributions which add to the great works done on Ubuntu.

LinuxMint is probably my favorite of the derivatives. It started out as a more feature-rich, multi-media version of Ubuntu. It also added its own (better looking) theme. I’ve always disliked the default themes in Ubuntu, whether it be orange, brown, or purple, although I give them point for originality. LinuxMint brought a minty green flavor to the Linux desktop.

I’ve recently posted that I can’t stand Unity or Gnome 3, and I was searching for an alternative in a more modern distribution. I could have went with Debian Stable or CentOS 6, which still use Gnome 2, but I wanted a distribution that uses more up-to-date versions of software like Blender, LibreOffice, Firefox, and such.

The problem with that scenario is that there aren’t many “modern” distros which use something other than Gnome 3 or Unity as their default desktop environment. I tried to use XFCE4, but it just wasn’t for me. I can use it in spurts, but I wouldn’t want to use it permanently. I wanted something that looked fresh.

For a few days, I tried to adapt to KDE4. You know things are rough in my Linuxland if I’m trying to adapt to KDE. I was getting by and actually liking the experience until I tried to do a little Java game development. For some reason, anytime I switched my Java app to fullscreen and then back to a window, it would disable my second display. This peeved me off enough that I just installed Windows 7. I’ve been using it for the past month.

Today, I was messing around on my laptop, which happens to have LinuxMint 12 installed on it, and I remembered reading something about a Gnome 2 fork that the LinuxMint crew was working on called Cinnamon. I thought, “what the hell, I’ll give it a shot”.

It was impressive. It was actually more than impressive. It was exactly where I thought Gnome should have went. It’s like a better looking version of Gnome 2, with all the same Gnome 2 features. It felt like home, which is coincidentally like the subtitle of the Cinnamon homepage:
“Love your Linux, Feel at Home, Get things Done!”
This is a great slogan, because it really goes right along with how I felt about Cinnamon. I loved using Linux on the desktop again. I felt at home. I bet I’ll be able to get things done in it as well.

I rarely use that laptop, so next I’ll be installing LinuxMint on my main desktop again. I’m going to cross my fingers and hope that their isn’t some annoying bug that makes me wish I’d stayed on Windows 7.

It’s pretty sad when a Linux advocate, that loves working in the command line, doesn’t want to use Linux because of the sad state of desktop environments. I wish the main developers of this type of software would lose the “unify everything” mentality and make the desktop just work.

Hopefully, I’ll be able to give Cinnamon a thumbs up on my main desktop and just stay in Linux heaven. I’ll post my results later.

Netbean’s Menus Don’t work in Linux Mint 12

Gnome3 has some issues. I really like the look and feel of Linux Mint’s Gnome3 + Mate interface. However, looks aren’t everything. Functionality is important as well. Almost everything works with it but Netbeans is an exception. The menus are completely unusable with it.

The quick solution is to select “Gnome Classic” when you login. I like the look of it as well, and at least everything works in it.

While I’m on the subject, why did Gnome decide to take the path it did with version 3. It’s too much like Unity, and I hate Unity. Why are they moving to this type of desktop? Gnome 2 may not be the prettiest thing available, but it has been the most usable desktop environment for years. They should have just concentrated on improving the look of it, added a few new features, and worked on any bugs they had laying around. Most people don’t like Unity or Gnome 3. This doesn’t leave much of a choice other than KDE and XFCE4. Of those, I’d pick XFCE4, but if you have a large userbase like Gnome has, why screw that up by making your new version look like and act like the DE most people are wanting to avoid? I just don’t get it.

Couldn’t Load XPCOM

If you are like me, you like to use the latest plugins for Firefox (when you use Firefox). Things like Firebug have become a staple for my web browser usage. I also love using Debian as my OS, and the stable version comes with a much older version of Firefox (sans logos and with the name iceweasel). Unless you download older version of plugins, most of the time you’ll have trouble installing the plugins you want.

The simple solution is to download and install the latest version of Firefox directly from Mozilla. There’s not much of an install process. Just download and uncompress the file. You’ll get a firefox directory, which I moved over to my home directory and proceeded to create shortcuts for on my desktop and menus.

If you are using the 64 bit version of the OS, you will quickly run into the “Couldn’t Load XPCOM” error. It’s obvious that it is a library issue but the error doesn’t give you a big clue as to how to fix it.

Good news, the fix is extremely easy. You are lacking some 32 bit libs that are required to run the program.
Fix is by running the following as root or with sudo:

apt-get install ia32-libs-gtk

After that, you should be able to run Firefox. Enjoy!

Reddit’s Interview with Richard Stallman

Recently, Reddit users were given the opportunity to ask RMS (Richard M. Stallman) questions. The top 25 were answered by RMS here.

For anyone who doesn’t know who RMS is, he is the founder of the GNU project. He wrote Emacs and the GCC compiler. Much of what makes up a “GNU/Linux” (don’t ever let him hear you call it “Linux”), is the GNU tools. Linux itself is just the operating system kernel. Although the OS kernel is a very important part of the OS, a base GNU/Linux system has a ton of software from the GNU project as well. The OS doesn’t work without the kernel, and it doesn’t do much without the GNU tools.

RMS answered most of the questions as I would expect. The one question that stood out to me, although I haven’t made it through the entire list yet, is number 7. The question relates to how the open source world can’t create tax software and games that can compete with proprietary software. It’s a very good question. RMS mentions that the Free Software Foundation in Latin America does have free tax software. He also says

I don’t know whether our community will make a “high end video game”
which is free software, but I am sure that if you try, you can stretch
your taste for games so that you will enjoy the free games that we
have developed, or you can try Roulette Games.

Now, this is the part that really made me think. I’ve always been an advocate of free software, but do I really want to rely on free software to produce video games that compete with some of the games I play on PS3? I truly wish that they could make them, because I’d love it, but I don’t see it happening. Another major point to that comment is that games have always been the driving force in computer hardware improvements. The computer systems we have right now are only this good because of games.

That may be hard to believe, but for anyone that’s been playing PC games for decades, it’s common sense. Video games are it. That’s what all of this technology was built on. You were either playing games or writing them. Sure, computers have many other useful features, but games are responsible for these beautiful user interfaces and awesome sound.

Games kept getting better. Hardware kept getting better. A huge majority of the research and design came from game sales. All of that wouldn’t have happened without proprietary games.

RMS knows that, but RMS isn’t worried about games at all. RMS is worried about software freedom and he has many good points. Those same points could be applied to many industries. To me is seems like the old communism vs. capitalism debate. Extremes on both sides suck. It’s the happy medium we should strive for.

LXDE – The Light-weight Linux Desktop Environment

I was reading a post over at the Linux Mint Blog and found that I’m a bit behind on my Linux news. I’ve never heard of LXDE. Now my desktop environment of choice is Gnome, usually. I also like XFCE, but Gnome has all the features and rarely lets me down. I like the variety in Linux so I was glad to see yet another desktop environment.

LXDE seems to be geared toward netbooks and other cloud-client computers. Linux has many light-weight desktop environments, and even though I like variety, sometimes I wish that they would all come together and work together.

This leads me to a pitfall of open source. It’s also an advantage. Those are complete contradictions, but there’s really no other way to explain it. I lean more toward the advantage side of things but sometimes I wonder if the different projects could be merged as much as they are split.

It seems that it’s perfectly logical for developers to split from a project and create a fork, but rarely do two projects merge to form a super project. Perhaps open source in general needs more merging to balance out the massive amounts of forks….just a thought.

Eclipse issues in Linux Mint

I’ve been wrestling with IDEs and OSs for the past few days, trying to decide which would be best for Javascript and PHP development. I had been using Netbeans. I absolutely love Netbeans, but I found that editing Javascript in it was somewhat lacking. I was having trouble keeping up with my nested anonymous functions and thought it’d be a good time to try out other alternatives.

I bounced around between Linux Mint, Mac OS X, and Windows 7. I find that I would really like to program on my Macbook Pro, but it just doesn’t feel comfortable. There’s something about the keyboard setup or something that just annoys me. It’s more of a problem with my familiarity with the keyboard, I think. At any rate, after messing with Eclipse, Netbeans, and Textmate on my Mac, I decided it was going to be a no-go.

Windows 7 presented a problem in the fact that XAMPP seems to have issues with sessions. They work but almost at random, creating a new session will lock up the entire web server. When you are developing a website which uses Sessions for user logins, that creates a problem. So, I decided it would be in my best interest to use Linux, which seems to be made for programmers, because most programming related things work great in it and the fact that you almost have to be a programmer to get some things to work correctly in it. Though, that is an outdated misconception, but everyone still seems to believe it.

I had been using Linux for most of the development of my new project anyway. So, there was no transition there. I’m using SVN on a server machine so it really didn’t matter which OS or IDE I decided upon for that. They are all pretty universal in their ability to handle SVN. The major exception was Mac OS X which didn’t include the ssh-askpass command needed to tunnel SVN through ssh correctly. I was able to find a shell script that handled the ssh-askpass function, however. Textmate didn’t really work well, either, because it didn’t really have robust SVN integration. It was pretty much just like manual SVN. I also needed separate programs for Diff and Merge. That was lacking and clunky. I was spoiled by Netbeans’ built-in Merge, Diff, SVN, and so forth.

I thought I’d give Aptana a try. It is a PHP developer plugin for Eclipse. It is also available in a standalone package. I had various problems with the standalone version of Aptana so I decided to install Eclipse from the LinuxMint/Ubuntu repositories. Eclipse worked great, and Aptana installed perfectly. However, I needed the SVN tools that are Aptana add-ons. They wouldn’t install. There was a version conflict with the version of Eclipse in the LinuxMint/Ubuntu repositories.

So I decided to install the latest version of Eclipse. I downloaded and ran the latest version and found that there were UI issues. This brings me to the subject of this post. The UI issues were a major roadblock, so I searched for a solution. The problem, I believe, stems from compositing inside Gnome. Unlike Ubuntu, I couldn’t find an easy way to turn off compositing inside LinuxMint. OH, I’m sure I could disable the compositing extension inside the xorg.conf file, but I really wanted a light switch option. The normal way I would handle this is the Fusion Icon. It didn’t seem to work. I also tried disabling effects from the Gnome Appearances menu option. Compositing just wouldn’t turn off that easily.

So here is the solution for Eclipse and Aptana inside Linux Mint.

GDK_NATIVE_WINDOWS=true /opt/eclipse/eclipse

That will work if eclipse is installed in /opt/eclipse, but I just had mine downloaded to my home folder. It doesn’t really matter. You would just change the /opt/eclipse/eclipse to your actual executable path. The key here is to add the GDK_NATIVE_WINDOWS=true before the eclipse command.

I’m about to create a shortcut to do this for me. Now all my buttons will work when I click on them. That’s convenient huh.

Resetting WordPress Passwords Manually

I’ve had to do this for my wife and her mom both, so I thought I would share this with anyone who needs to reset a WordPress password. I personally love WordPress. You can build any type of site with it, not just a blog. If you have created a WordPress site but haven’t visited the admin dashboard in a while, you may have forgotten your password. I thought that WordPress would email you a lost password, but maybe they didn’t put in their correct email address. It could have also been the installation script they used through cPanel. Whichever the case, they couldn’t get into their dashboard and they needed their passwords sent to them.

There’s a very easy way to reset that password through SQL. Whether you are using phpmyadmin or some other SQL client to access your databases, you’ll want to use the following SQL statement to reset your password:

1
UPDATE `wp_users` SET `user_pass`=md5('password1') WHERE `ID`=1;

You can change password1 to whatever you want. I’m amazed that WordPress passwords aren’t stored with more encryption than a simple MD5 hash. It’s secure enough, don’t get me wrong. I’m just surprised that the WordPress developers didn’t opt for more.

Oh well, I hope that helps someone in a pinch.