Archive

Author Archive

Recession vs. Linux

January 3rd, 2009

The food and restaurant industry might be down across the board, but some areas seem to be doing quite fine. Amazon is reporting record sales this year. http://usnews.rankingsandreviews.com/cars-trucks/daily-news/081230-Amazon-Reports-Record-Holiday-Sales/

I was in a mall today and saw a line 20 deep in the food court for Taco Bell. People gotta eat, and they need their latest and greatest software too. I’m sure the net is lagging behind the economy, but in some regards I guess it might not turn out to be a bad year for Linux. I’m sure the usual suspects will be feeling a nasty bite soon and although they might not really have their hearts behind anything that has to do with free, according to Bruce Byfield, “when the talk turns to free and open source software (FOSS), suddenly the mood brightens. Whether their concern is the business opportunities in open source or the promotion of free software idealism, experts see FOSS as starting from a strong base and actually benefiting from the hard times expected next year.” http://itmanagement.earthweb.com/osrc/article.php/3793286/Linux+in+2009:+Recession+vs.+GNU.htm

Economy, Linux 2009, Economy, foss, free, gloomy, GNU, Linux, recession

Apache on a diet: Tune for optimal memory usage and speed

January 1st, 2009

Lets get a running start… Make sure KeepAlive is set to ‘On’, HostnameLookups is ‘Off’ and comment out most of the modules loaded in your default Fedora, Ubuntu, Suse, other bloated distribution’s choice for default modules. Most of them you won’t need or want to have available. You’ll probably need rewrite and php, but depending on what kind of site you’re running, you might not need all those auth modules, etc.  If you’re hosting some apps that handle their own authentication and permissions and you dont want to allow directory browsing, statistics generation, ldap authentication, or apache statistics then by all means get rid of all those modules! In Fedora you’ll find they throw in the kitchen sink to start you off.

[image]http://blog.rootninja.com/wp-content/uploads/2009/01/treadmill.jpg” alt=”apache on a diet - running on a treadmill” class=”alignleft” />

Putting your apache on a diet and then restarting might be all the oomph you need, but you’ll probably see only a slight difference. Also, don’t just look at the memory usage right after a restart. Until your servers are actually called upon for battle, they’re just going to allocate the minimum requirements, so you might have a bunch of httpd’s running using say 10 meg each, but once they’re stressed, you might see them jump to to 20-30 meg and not let go. You’re probably going to get the most mileage out of tuning the number of servers running, maximum clients, minimum and maximum spare’s, etc. If you’re not expecting a lot of traffic and your memory is limited, you probably shouldn’t run a boat load of servers. Keep your MaxClients low so you don’t spawn so many that you start swapping right from the word go.

Your site, your traffic, and the type of content being loaded is going to affect your optimal settings. So just dive in and play around with the numbers.  Stress test your site and let it run a little while. If it gets better, then you’re probably pushing the numbers in the right direction! I’m sorry if you were looking for a “type 123 at prompt xyz” type of tutorial here. What’s working for me with 128 meg of memory is probably a little slim for the next guy.

I just hate to see people jump ship from apache to something like lighty just because they hear apache is bloated or experience that from their distribution’s default setup. Switching to another web server may just give yourself more headaches in the long run because you’re probably going to have to tweak lighty to work with the apps you’d like to run — apps that are already set up to work with apache right out of the box.

Linux apache, bloat, diet, lighttpd, lighty, memory, modules, requirements, server, tune, web

Howto install Fedora 10 on ReiserFS or JFS

December 30th, 2008

When you get to the first prompt when installing, instead of just letting the default continue by itself, type:

linux selinux=0 reiserfs

Replace the ‘reiserfs’ with ‘jfs’ if you want that file system.  You’ll have to include the selinux=0 because you can’t use SELinux with ReiserFS or JFS.

All too easy…[image]http://www.rootninja.com/images/darth-vader-helmet2.jpg” />

Linux fc10, fedora, howto, jfs, reiserfs, selinux

New 404 page

December 29th, 2008

I put up a new 404 page. Hopefully Chuck Norris will allow it to live. I’ll make it a regular page linked from rootninja too.

Uncategorized 404, chuck norris

Iterators in python are about as easy as “hello world” in most other languages

December 28th, 2008

Iterators in python are so easy. I saw some articles on random sites about building generators to do stuff, but in the end they were only trying to iterate through a file line by line so why make it harder on yourself. Declare an iterator of the type you’re dealing with, like lines in a file, and vrooom, off you go.

f = open(infile,’r')
lines = f.readlines()
i = iter(lines)
while true:
.     try:
.        line = i.next()
.    except StopIteration:
.        pass

programming code, easy button, iterators, python

news reporting done zoo animal dung throwing style

December 21st, 2008

I just read a horrendous article on a wannabe news site called “The Hollywood Reporter” where the author, Paul Bond, devastatingly butchered definitions and skipped any attempt at providing even a miniscule speck of detail from the report he sourced.  It basically looked like he strung together a bunch of single sentence paragraphs and flung them into what he describes as a news article, shockingly similar to the way an orangutan throws poo in the zoo.
http://blog.rootninja.com“>[image]http://blog.rootninja.com/wp-content/uploads/2008/12/orangutan.jpg” alt=”news reporting done zoo animal dung throwing style” width=”185″ height=”199″ />
I had to post this because I completely agree with faptzu’s comment,

“This article is complete bunk pulled out of the **** of the author. Paul Bond, did you actually attempt to report anything accurately? How about you first check the age ranges of who you’re calling Millennials, Generation X, and Babyboomers.. Second, you’re saying Millennials don’t care about news and current events? How about they don’t care about the **** that’s on TV that they call ‘news’ and ‘current events.’ The Internet has the real news - after you filter out all the big media ****. I can get more news in 2 minutes on the Internet than I can in 24 hours of flipping through CNBC, MSNBC, Fox News, CNN, BBC (yes.. even the lovely BBC) combined. So many sweeping generalizations and errors in reasoning in one small article.. The author is contributing to the reasons why Millennials don’t pay attention to the ‘news.’”

http://www.hollywoodreporter.com/hr/content_display/news/e3ic41d147829e712a6a6ecd990ea3a349c

Almost random babyboomers, butcher, comments, current events, fail, genx, hollywood, news, poo

Stop SELinux from blocking flash using iced-tea firefox plugin

December 6th, 2008

If you see this message when firefox tries to load flash content:

SELinux is preventing the npviewer.bin from using potentially mislabeled files (/home/admica/.icedteaplugin/icedtea-plugin-to-appletviewer).
Source Context: unconfined_u:unconfined_r:nsplugin_t:s0
Target Context: unconfined_u:object_r:user_home_t:s0
Target Objects: /home/admica/.icedteaplugin/icedtea-plugin-to-appletviewer
Source: npviewer.bin
Source Path: /usr/lib64/nspluginwrapper/npviewer.binPort:<Unknown>
Host: somehost
Source RPM Packages: nspluginwrapper-1.1.2-4.fc10
Policy RPM: selinux-policy-3.5.13-26.fc10
Selinux Enabled: True
Policy Type: targetedMLS
Enabled: True
Enforcing Mode: Enforcing
Plugin Name: home_tmp_bad_labels

Then do this:  (replace with your home dir)

$ restorecon -v ‘/home/admica/.icedteaplugin/icedtea-plugin-to-appletviewer’

restorecon reset /home/admica/.icedteaplugin/icedtea-plugin-to-appletviewer context unconfined_u:object_r:user_home_t:s0->system_u:object_r:nsplugin_home_t:s0

and you should get that response and it should work the next time you try as long as you’ve got the right plugin association and the file you’re trying to load really is flash!

Uncategorized blocking, firefox, flash, iced-tea, plugins, selinux

How to automate just about anything using cron jobs

November 24th, 2008

Cron is so simple yet so useful I think it’s often unappreciated! Being able to toss a command into a cron, or execute a script at specific times of the day, days of the week, etc. That’s good stuff!

You could call a script that checks your mail once an hour, cleans out a temporary directory, or archives a special directory where you dump files to get saved without ever having to visit the server manually and tar/gzip the files yourself.

My latest use for cron is a nightly build script for building code checked out of subversion.  I’m doing this on my system for personal use, but also at work along with a python script i’m writing that also runs from a cron a few hours later.  It parses the build log looking for errors.  If it sees errors, it sends them out in email.  Python is wonderful… /off topic.

# +———— minute (0 - 59)
# | +———- hour (0 - 23)
# | | +——– day of month (1 - 31)
# | | | +—— month (1 - 12)
# | | | | +—- day of week (0 - 6) (Sunday=0 or 7)
# | | | | |
* * * * * command to be executed

If you want to run a script called check-for-rootkits.sh every 10 minutes, its as easy as:

*/10 * * * * /root/check-for-rootkits.sh

You could also get fancy and use “run as” to run crons as specific users.  Users can do this on their own (”crontab -e”), but you could force things to happen for them with your root crons if you wanted.  Fedora makes use of this for running hourly and nightly cron directories.  If you want anything to run along with the standard Fedora cron jobs, you just drop your script into those directories and they fire off alongside the defaults.

Linux cron, fedora, Linux, subversion

Hydrogen anyone?

November 18th, 2008

Mmm… Hydrogen. Leave a comment if you’re an HHO’er. If you don’t know what HHO refers to, or you disagree with the definition. I’m curious to see if anyone stops by!

http://www.youtube.com/browse’>Watch the latest videos on YouTube.com

Uncategorized

How to unban my Google Adsense account

November 18th, 2008

The evil google empire has singled out my website and banned me for no apparent reason what-so-ever.  Those pricks couldn’t handle stroking the big $11 check once every few months for my super duperest blog.

The Google Team is out to get you, how to make them pay in 4 easy steps:

My Adsense account got banned.  Help!

Take a deep breath, calm down, and try to figure out why your account was banned. Know thy enemy.  You’re going to want to find evidence that there has been a mistake and to do that you’re going to need to know what the problem was in the first place.  While reading this, in your head it should sound something like, “well duh”.  Google might just tell you there were invalid clicks and that doesn’t exactly say much.  If you get slashdotted, dugg, or any variation of those with all the other social networking sites out there, you may get an influx of clicks.  If you’re under shared hosting, there’s probably a bunch of miscreants among you, physically sharing your server.  If you’ve ever had a VISA or American Express credit card, you’ve probably been hit with the hold on your account because of irregular usage patterns.  Your problem with google could be this simple in the end. Contact Google Adsense. After you’ve calmed down!  Be professional and courteous to them.  Treat the problem with a cold and calculating seriousness that makes no bones about it.  It’s nothing personal, just business.  Don’t acuse, assault, or in any other terms annoy the people you’re asking to help you out. Do you homework. If you have logs or other forms of evidence that you think proves you and your websites innocence, then by all means send it to them.  Include this type of information in your initial contact.  Don’t wait until your follow up to provide any proof or it might look made-up. Patience Danielson. You may not get an instant response.  And by instant, I mean any time soon.  If you don’t hear anything after a few days, send a follow up message to them.  Wait a few more days and try again.  It would be better to have patience than to irk or otherwise annoy.

Uncategorized adsense, ban, google, money, silly


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser
Mobilytics