ubuntu

Speed up your Linux Boot and normal use ( openSUSE )

Sunday, October 26th, 2008 | SuSE Linux, Techie, Ubuntu / Kubuntu | 9 Comments

In a world where faster (in most sense) is better, people are always looking for ways to increase the efficency of their computers. While i’ve read other peoples thoughts and recommendations regarding speeding up your linux installation, many I just clearly do not agree with. Here are things I have done, and things I could/would have done if I was on less adept hardware:

First: I want to get out that clearing the terminals launch at boot via /etc/inittab will not help as much as many guides try to say. This uses just a very minute amount of RAM, and you’ll rarely see a difference. However if you do feel you want to chage this, you can disable (comment out) the following lines in /etc/inittab:

3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

I recommend not removing any more then those. Again, this will give you minute gains in RAM usage.

Second: A great practice on any operating system (Microsoft and Linux alike) is to disable un-needed processes. This can be done quite easilly via YaST. To do this open YaST, click on System and click on System Services (Runlevel) see Figure 1. (note if you do not see this run the following to install it:)

sudo zypper in yast2-runlevel

YaST Runlevel
Figure 1

Things I have disabled are:
joystick (I do not run any joystick etc)
nfs (I don’t attach to any NFS mount points)
ntp (I don’t care to attach to any NTP source)
(Note: I won’t tell you which ones TO disable as it is up to you to determine WHICH services are not needed, be sure you know what you are doing here.

Note: In Ubuntu the application that will do this for you is sysv-rc-conf. You can install it via:

sudo aptitude install sysv-rc-conf

Third: Is a great and simple way to increase the effectiveness of the RAM on your machine. This modification will allow more of your process to be stored into memory and not be sent to your swap (RAM is faster then Disk).
Note: This modification is for the machines with quite a bit of extra RAM to hand out and not for systems that lack usable RAM.

First you can check what your current swappiness level is (the higher the swappiness setting, the more often it will write to your swap (again which is located on disk). You can do this by running:

cat /proc/sys/vm/swappiness

I believe openSUSE ships by default at 60, but most distributions ship with swappiness set to 50 - 60.

Now to test this setting before making it permenant. You can run:

sudo sysctl vm.swappiness=0

If you feel the performance gains, are good, or you just feel like setting it permenantly you must modify /etc/sysctl.conf. To do this edit the file in your favorite editor:

gnomesu gedit /etc/sysctl.conf
kdesu kwrite /etc/sysctl.conf
sudo vi /etc/sysctl.conf

Add the following line to the end of /etc/sysctl.conf:

vm.swappiness = 5

(Note: You can choose your value, the lower the value the less swapping that will take place).

Fourth: Disable IPv6 if you will not be using it. I won’t go too far into this, you can do this in YaST –> Network Devices –> Network Settings.

Fifth: Tune your applications.
OpenOffice.org Will allow you to change it’s memory consumption. You can do this by opening any OpenOffice.org application, then going to Tools –> Options –> OpenOffice.org –>> Memory. You can play around with this setting for your need, but changing the number of graphics in cache, and increasing the amount per object may be quite useful.

Compiz Most people consider this to be a great “eye candy tool”. I honestly consider it a functionality and productivity tool and use it for this function day by day. If you NEED to run it, make sure you trim what plugins load, and just slim it down to the functional features you use. If you don’t need Compiz just disable the desktop effects. This will free up a good amount of resources.

Sixth: Replace bulky applications:
Firefox I actually didn’t want to touch on this because FireFox 3.1 looks like it will actually lower the memory consumption by Firefox, but with that said, 3.1 is in Alpha (or pre-Alpha so I have to mention this). Use Opera, which can be install via:

sudo zypper in opera

.
Opera is a full feature browser, and uses quite a bit less memory and overall resources then firefox does. If you’re running KDE you also have the choice of Konqueror, but again I would highly recommend Opera if you’re low on resources, or looking to conserve.
OpenOffice.org You have many other word processors avaliable to you in Linux. If you just need a basic editor use gedit, kwrite, or if you need a more feature full processor and can’t afford the hit from openoffice use obiword, or koffice.

Change your Desktop Environment. Most people will run GNOME or KDE. Those are some of the higher resource intense DE’s and on a machine where resources are really in need can be replaced with lightweight DE’s like XFCE (blackbox, enlightenment, icewm (note: these ones are for more advanced users)). XFCE can easily be installed via YaST. To do this open YaST –> Software –> Software Management. Under Filter choose Patterns and check the XFCE Desktop Environment option.
(Personal Experience: I find that KDE uses fewer resources then GNOME, and find it’s functionality to be even greater. This is one reason I have chosen openSUSE over Ubuntu. Sure, you can install Kubuntu or KDE packages within Ubuntu, but it is not developed upon like it is on openSUSE).

Those are the basic things that can be done to help speed up your machine for daily use, and to speed up your boot process.

Now onto some other things that I’ve done on my machine just from personal experiences:
Run

ps -ef | more

Check what is running that I don’t really need. Kill the process. After i’ve killed the processes I don’t care for I save my session ( I do this because I have my KDE set to start on the last manually saved session ).

Another modification I’ve added to try to increase performance with EXT3 is adding

noatime,nodiratime

in my /etc/fstab mount point for my /home.
This is how the line looks in fstab:

/dev/system/home /home ext3 acl,user_xattr,noatime,nodiratime 1 2

Install a Vanilla Kernel. This will remove all the patches installed by the SUSE developers, but will increase your boot time by about 10 - 15% (dropped my boot time by about 8 seconds). This is for advanced users, if enough people as for this, maybe i’ll blog about it.

I also removed that damned dog Beagle, and the security feature apparmor. I removed beagle because most my files are kept on a offline disk, and again this is one of the main reasons I removed apparmor.

I’m sure i’ve done other things, and I just can’t remember right now. I’ve just pulled these off the top of my head and can’t really think of anything as it is bed time.

Shameless plug: You can read a previous posting of mine which will allow you to check your before and after boot times. Check out the posting here for that.

Hope this helps someone and please feel free to add your comments to make this a better comprhensive list.


Tags: , ,

Switching from Windows to Linux, what you need to know

Monday, October 20th, 2008 | Fedora Core, Microsoft, SuSE Linux, Techie, Ubuntu / Kubuntu | 4 Comments

Switching from Windows to Linux and what you need to know:

Since we are in touch economic times the most important question is “How much will this cost me”? The answer is nothing, zero, zilch or nada. Whatever phrase you want to use (unless you’re really a stickler and want to divide your monthly Internet bandwidth cost against the time it took you to download the application and (well, you get the point). Hell, I would go on the edge and say it may actually save you money. How? You’ll be in touch with your computer, you’ll be excited to learn do stuff on it again, you’ll be heading the charge with changing the way a Corporate giant in Microsoft does it’s daily business, you’ll be FREE. (Man.. too much braveheart lately).

What is linux?
In the past years the phrase Linux has been mis-represented as a full blown distribution and not it’s original meaning. Linux, actually derived from the “Linux Kernel”, which was originally written by Linus Torvald in the early 90’s. So it is important to not refer a distribution as Linux, but as a Linux Distribution.

What is a distribution (distro)?
A distribution such as openSUSE (SUSE), Ubuntu, Fedora, PCLinuxOS, and Mandriva are all contain the basic Linux Kernel, and a bundle of applications which would provide your X support (GUI, Graphic User Interface), your Desktop Environment (Gnome / KDE / XFCE etc), and all your other basic and advanced functions. The major differences between distributions is their packages of choice (.deb (Debian, .rpm (RedHat package manager)), what packages come included with the distribution, and their management interfaces. The confusion of the many distributions may be one of the factors that turn people off of Linux, as they view it as “too confusing”.

What distribution is best?
This would be impossible for me to get up and say “Here is the best distribution for everyone”. Ever distribution has their good and their bad points, and each distribution does something better then the other. I personally use openSUSE, which is supported by Novell. I originally converted from Fedora Core (around the 4 days) to SuSE because the robustness of the distribution, and the choices it has always given. With that said, other popular distributions are Ubuntu, Fedora, Mandriva, Gentoo, Linux Mint, PCLinuxOS, and for historical reasons Slackware (one of the original distributions).

Can I still run my .exe programs?
The quick answer is no, but the more in-depth answer would be yes. Out of the box, the Linux Operating System does not allow you to run .exe binaries (which are Windows Binaries). However, there is a project called Wine (which Google has been great at helping advance) which allows us to install some Windows Applications and run some of these binaries. However, support for everything is not in place, and would be a per application basis.

What is a Desktop Environment?
I touched earlier in “What is a distribution” about Desktop Environments (typically referred to as DE). A DE is a an environment which consists of what most consider their “Desktop” and is comparable to what we see when we log onto a Windows workstation / server. These DE’s consist of our icons, wallpapers, folders, windows, taskbars etc. This is our functional GUI which runs off of the X system. The chosen DE is another thing that may separate one distribution from another.

What is the best Desktop Environment?
Much like Distributions. This is a hot topic especially between the 2 major DE’s Gnome and KDE. Another major player in the DE environment is XFCE, and a up and comer is called Enlightenment. The only thing I am going to say about these to not spark any type of debate is to try them all yourself to see which fits your need best. I personally find KDE 3.5.10 to be the sweet spot for me. KDE 3.5.10 is being replaced by KDE 4.X, but for my uses (every day production use at work) I find that KDE4 has not yet filled all the features in KDE 3.5 that I use. GNOME however is very popular in the enterprise work force, as it’s very easy to navigate (although I find KDE to be a friendly swap for you Windows users reading this).

Ok, now that you know what the Linux Kernel, Linux Distributions, and Desktop Environments are we’ll get down to the part where we replace Windows with Linux.

Here are some general uses for Windows users in the home space. After this we will go into what
you’re used to in each version of Windows, and try to compare it to Linux.

General uses:
Web Browsing: Some Windows applications for this task are: Internet Explorer, and Firefox comparable Linux applications that can do these tasks are Firefox (look familiar?), Opera (many more). For most home users, we use our computer as a way to browse the World Wide Web. A computer running a Linux OS, would be the perfect replacement, if this is your main need. Why you may wonder? Because a computer running a Linux OS is less susceptible to getting Malware / Viruses / Spam / Popups. This helps save the data on your machine, the personal data you type in at a web site, and in many other ways. I could write a million reasons here, but if you use your computer for only the internet, you should highly consider trying Linux, to save you heartaches with Viruses, etc in the future.

Word processing: Some Windows applications for this task are: Works, Word and openoffice, the major comparable Linux application is openoffice (again notice a trend? What is on Windows, may already be on Linux). If you run openoffice on Windows, a switch to Linux would a simple. You’re not doing anything different and using the same applications? So why the hesitation?

Spreadsheets: Some Windows applications for this task are: Works, Excel and openoffice, the major comparable Linux application is openoffice (again notice a trend? What is on Windows, may already be on Linux). See Word processing.

Email: You are just doing mail via the web (ie Gmail, Yahoo! Mail, Hotmail etc) then this does not actually refer to you, as that is considered “Web browsing”, and you should re-read the security implications I’ve mentions in Web browsing. If you use a client like outlook, you have 2 major replacements in Kmail (which ships with KDE), and Evolution (which ships with GNOME). If you are pulling from a Exchange Server, I would recommend Evolution (which could actually run on KDE (gotta love the flexability of Linux).

Multimedia: Some applications for these tasks are: iTunes, Windows Media Player, etc. The applications that would replace these in Linux are actually way better then both the applications mentioned for Windows. These applications are Amarok, Mplayer and VLC. I won’t get into the gists of why they are better, just know that they are in every way. Note with Mplayer and VLC, you can run nearly any format including formats that are for “Windows (yes, some video formats are actually Windows only). Also for DVD playback you can install libdvdcss (which is kind of a touch subject due to it’s legality in the US, I recommend checking it out, and fighting for the cause).

Ok.. off the high horse now, and on to migrating from Windows to Linux and what you can expect.

The Windows Vista user:
So there you are, with your new Windows Vista box, super excited because you now have something called Aero. You’ve been awiting years (about 5) to come out with something other then Windows XP, and now you got it an annoying thing that pops up every time you want to do something (User Access Control/UAC), and a kick ass way to switch between applications. You’re living in a euphoric stage until you find out that Linux did that before Vista was out, and can do about 90 even cooler functions. This is courtesy of Compiz/Comiz-Fusion. If you’ve seen someone with a modern Linux distribution, then you’ve undoubtedly been awed by their 3-D Desktop, and the different methods of seeing what applications are open. So you wonder, how can I get that? Easily, just install a new version of a major distribution. Yes, most major distributions ship with Compiz enabled by default. That means these awesome features right out of the box. You can enable them, and disable them by running their configuration manager (won’t get into detail here, but there is plenty out there to get you started). Now that I’ve broken your heart, and kicked you while you waited 5 years for the new version of Windows, I’ll let you know what to expect when you switch from the most prevalent Windows Operating System out there, Windows XP. (Vista users should also read the XP section).

The Windows XP user:
When you hear Linux many of you off the bat thing “It’s better, it’s this, it’s that”. I do agree with you on that front, but it is not without a learning curve, or without a possible headache or 2. Do you remember all the major headaches while learning Windows for the first time? All the crashes etc? Think of those headaches minimized by 85%. If you’re then willing to take the adventure, and going in with the mind set that there will be a learning curve, that may introduce some headaches, then please read on.

When you install, you’ll notice that the installation is very straight forward, very manager based and just as easy if not easier then a Windows XP installation. Once installed, and logged in you’ll notice that you won’t have to install tons of different applications (ie Office etc) as most packages ship with the distribution. You may or may not see an increase of speed (if you have a 3 / 5 year old installation of Windows XP then heck yeah, you’ll notice a speed increase). If you are a basic user, here you’ll notice no difference, other then the lack of Administrative privileges. These are not given to users, as it introduces un-needed security risks (we’re all just used to running as “Administrators” in Windows). To run something with elevated privileges we use sudo, but again this will only need to be done with certain administrative tasks, and most needs will prompt you for your or your root (or administrator in windows) password.

That’s it.. If you’re a regular user, that is all you’ll notice (if you even notice that). As a power user, or someone that like to tinker, you’ll notice that there is no registry, you’ll also notice you have the ability to modify a lot more, and have the freedom to do anything to your machine (include break it, which you power users will probably do while you’re in your “learning phase”, with power comes problems for us curious ones).

Sorry this is all over the place, I hope someone finds it useful, feel free to leave me a comment, and i’ll add to it. Thanks a ton.

Great external links:
openSUSE
Ubuntu
Mandriva
KDE
Gnome
openoffice

Here’s a great list of comparisons between Linux and Windows also (man, if I knew this existed before hand, I would have just linked this instead of writing everything out).
Wikipedia Comparison of Windows


Tags: , , ,

Password protecting website without using .htaccess

Thursday, May 22nd, 2008 | SuSE Linux, Techie, Ubuntu / Kubuntu | 1 Comment

Do you host your own website and since you have control of the /etc/apache2/conf.d directory you would rather not enable .htaccess usage?

Now you wonder how do I password protect a directory without having a .htaccess file in the directory. You actually use the same options etc you would use in a .htaccess.  So here is a sample configuration file which requires authentication for the directory /var/www/stats

Here is the location of the file below:
/etc/apache2/conf.d

<Directory /var/www/stats>
AuthType Basic
AuthName “Statistic Tracker”
AuthUserFile /etc/apache2/htpasswd.setup
Require valid-user
</Directory>

To create the required htpasswd file (with the name above) do:
sudo htpasswd -c /etc/apache2/htpasswd.setup username

Now you will have to reset apache:
sudo /etc/init.d/apache2 restart

I will be adding this to my Wiki later

Tags: , , , ,

Search

Polls

Do you think having RDP on a Linux Host important in the enterprise space?

View Results

Loading ... Loading ...

Powered by