Tuesday, October 19, 2010

What's revision control?

This is the css directory for one of my clients, just for one file:

++main.css
__main.css
main-17-october.css
main-1st-nov.css
main-23rdfeb.css
main-3-8-9.css
main-bk1.css
main-extra.css
main.css
main.css.bk
main14April2009.css
main15April2009.css
main_bk.css
main_old.css
main.css.bak

Not only are their 14 versions of that file, but their are 5 separate conventions for assigning dates. Truly remarkable.

Horrible Javascript Code

      var class_schedules_text = '';
class_schedules.each(function() {
class_schedules_text = class_schedules_text + $(this).html();
});
parts = class_schedules_text.split('</strong>');
class_schedules_text = parts[1];
class_schedules_text = '<div style="width: 280px; margin-bottom: 10px; float: left; margin-left:
5px;font-size: 12px;">'+class_schedules_text+'</div>';

What it was replaced with

var class_schedules_text = class_schedules.html().replace(/<[^b].*?>/g,'');

Remember, there are two ways of doing layout

  1. Know what you are doing and do it
  2. Use excessive markup to eventually coerce the elements into place


For instance,

box_content += "<p><div style='overflow: auto;'>
<label style='float: left; margin-right:3px;font
-size: 12px;'>Schedule:</label><ul style='margin
:0; padding:0; float: left; font-size:12px;'>"+c
lass_schedules_text+"</ul></div></p>";

Becomes:

box_content += "<p>"+class_schedules_text+"</p>";

Monday, October 18, 2010

Stupidity example: Whm

So you have this things "WHM" installed. It looks like the default apache page. All you need to do is put things into /usr/local/apache/htdocs/ and you are done right? Override the default script and that's that.

NO, Bitch, You Are Wrong


If you do this, then you will get a bunch of errors; apache is looking for sys_cpanel or something somewhere. It will not actually feed the index.php file. It will feed a subdirectory and it's content listings. So if you wanted to look at /usr/local/apache/htdocs/mydocs, you will see the contents of the directory, but as soon as you click
on a single file, KABOOM!

How the fuck do you make it work then?


Good questions.

Let's back up

The old way, clearly too difficult



  1. # touch /usr/local/apache/htdocs/index.html
  2. Point your web browser to http://ip/


The new way, clearly easier



  1. Point web browser to http://ip_address/whm
  2. Log in
  3. Click on the 14th icon, "Account Functions" between "Account Information" and "Multi-Account Functions"
  4. Click on the 2nd icon, "Create a New Account"
  5. For the domain, give it the eventual domain you'd like to use
  6. Enter a Username
  7. Enter a Password
  8. Retype the Password
  9. Enter in an email and scroll down to the bottom
  10. Click Create
  11. SSH to the ip address using the new username/password pair
  12. Run touch public_html/index.html
  13. Go to the machine you need to access it on and open up your etc/hosts file. On Windows its c:\%WINDOWS%\system32\etc\hosts, on MacOS and Linux is /etc/hosts.
  14. Add the domain name you used in the above step and the ip address. This is a temporary mapping so that you can see the empty file
  15. Save the file
  16. Restart your web browser to clear out your dns cache
  17. Enter in the domain you used above


It's so much easier the new way, right?

How did you figure this out?


It took days. Literally. Who would have thought that you needed to create an account through WHM in order to view a php file on the web server? What kind of stupid is this?

Fuck Cpanel

Is it really excessively hard to learn how your website stack works? Really? Do you realize that all the complexities of the site are just presented to you in different packaging through Cpanel? It doesn't actually make things easier, all it does is rephrase the same shit in a new way.

While, at the same time, overriding all of the traditional ways of doing things.

If you have the slightest idea what you are doing, this bludgeoning piece of crap software will just randomly regenerate its wrong and broken configuration files over the ones that you manually configured.

Furthermore, they insist on protecting me for some reason and requiring me to do things there way ... instead of doing things the way that has worked since about 1992 - no that wasn't good enough; finding a file through locate, and editing it directly just was way too difficult. Now we need 5 levels of colorful icons amongst a collection of 140 and I have to remember "Services Panel" > "Web Services Panel" > "Web Server Configuration" > "Permissions for Web Server" or whatever the fuck they have decided to come up with.

It's called "httpd.conf" it's in the /usr/local/etc directory or the /etc directory. It's under the apache config, I use vim to edit it, just like I did in 2005, 2000, and 1995. Why must you insist on splicing the file into a spewed out mess of 85 different menu options.

Why?



Because the old way didn't use a fucking mouse. That's why. It wasn't user friendly enough, I'm guessing because it didn't look like the Windows Explorer shell - the epitome of ease of use, of course.

Now I need to find this shit that accesses that single fucking line of the file, and still type in the same damn configuration directives as if I was editing it manually in vim; but now it's through a web app; That's Progress!

I still actually have to have the knowledge of what to change to what; but now I need to know a bunch of additional information so that Cpanel won't overwrite it next time it decides to regenerate all the files from some stupid innocuous command, like an apache restart.

What files does Cpanel like to rewrite?

Who the fuck knows! Really. I don't know at all. I'm thinking that the entire /etc directory is becoming a black box where I would need to start up KDE4 on tightvnc in order to edit like, /etc/hosts in a way that won't get reverted every 5 minutes. If I knew any better, I'd know that I'd have to go into 6 configuration files and rewrite a bunch of Python and XML to disable it, along with running a bunch of distribution specific command line tools. Because you know, putting 4 layers of abstraction on a key/value pair text file is totally awesome; and people are totally capable of modifying the value of two input boxes, but are totally incapable of modifying the value of a single line of a file.

This shit is totally moronic. What is wrong with people?

I see where you are going. But what, pray tell, does Cpanel actually do?


That's easy!

All it does is that it takes a previously rather straight-forward Layout and piles shitpile after shitpile on it to create this crazy obfuscated interface where the obvious and important things are littered 4 menus deep and strewn about like some fucking 12 year old with ADHD and Photoshop decided to start making webpages last tuesday and then jizzed out some sorry excuse for a piece of software and called it Cpanel.

It takes very straightforward technical models and tosses them out the window, instead opting for some exponentially more complex "natural model" which is actually still a model, thus an abstraction, thus providing a barrier to entry, thus requiring a learning curve, and thus being counterproductive and extraordinarily detrimental to the intended purpose of further trying to simplify an already simple task.

Oh I see, what should I learn from this triage?


When webdevs get the rapt as being the stupidest, densest, dumbest programmers in the industry, I can clearly and emphatically agree when they turn to, and speak anything but with the most vile of contempt for this awful veneer that just smears and blurs otherwise obvious, straightforward processes.

For the love of God, if you want to be a programmer, learn to use a fucking computer.


For a more detailed example of this type of mentality, check out this posting on WHM
---

Followers