Archive

Archive for February, 2009

PowerShell: Windows Scripting Made Fun Again!

February 27th, 2009

Windows Scripting used to be horrible. You got a lousy language to write in – Visual Basic (especially coming from C-like languages) – and it just didn’t seem all that powerfull. Any action you wanted done, required quite a few lines of code, a healthy supply of patience and.

But now, there’s a new kid in town; Windows PowerShell.

And they choose its name right; PowerShell. It IS powerful. Read more…

Matti powershell , , ,

FTP & SELinux: 500 OOPS: cannot change directory

February 23rd, 2009

If you’ve created a new user, and assigned it a home directory, you might run into the following error message when you’re running SELinux in combination with FTP daemons (proftpd, vsftpd, …): 500 OOPS: cannot change directory.

The message is thrown because SELinux is preventing the FTP daemon from reading user home directories.

You can overwrite this setting, by issuing the following command directly from the CLI.

/usr/sbin/setsebool -P ftp_home_dir=1

This will allow FTP access to a user home directory through SELinux.

Ps; don’t replace ftp_home_dir with the home directory you’re trying to access, it’s a setting named “ftp_home_dir” that we’re trying to alter.

Matti linux , ,

IE8: Why?

February 13th, 2009

With IE8 closing up to a final release, and still having a bunch of bugs that don’t get fixed, I begin the wonder why Microsoft even bothers.

Just think about it for a second – they have a big team of IE8 developers, which obviously costs them money. Yet they don’t get anything in return for it.

It makes no sense for Microsoft to be creating another Internet Explorer, because it gets them no profit whatsoever. There are enough open source browsers that are better than IE, and absolutely free to use. Why shouldn’t Microsoft just bundle those with its new operating systems?

It would mean admitting a “small” defeat in the browser wars, but it would also mean a great deal for browser consistency, and an even greater deal for those web developers that are now stuck developing 3 different versions of a website (IE6, IE7 & Firefox/Chrome/Safari).

We know they’d never do it, so it’s futile to ever hope for it. But it would save Microsoft money, and make the world a better place. So what gives?

Microsoft got into a lawsuit for bundeling its Windows Media Player together with its Operating System, because some companies distribute Media Players as an actual product – and this was considered a false advantage for Windows’ Media Player.

This got me thinking: if someone makes a browser, and charges people for it – could he force Microsoft into creating a version of the OS without a browser integrated? Would this person not be considered a God amongst us mortals?

Matti Tech ,

Disappearing Bottom Panel & Top With Firefox + Linux Mint

February 13th, 2009

I had this strange bug using Linux Mint + Firefox 3.x, where every time I would start the browser, it would load in a semi-full screen mode. It would cover my bottom bar (the “start menu”, as Windows-users would call it), and the top bar – where the Application’s Title and Close/Minimize/Unmaximize buttons are.

Turns out, the cause of this issue were the visual effects I specified in my current Theme.

A quick fix to solve it, is by pressing F11 twice. First time, it throws you into a the “real” full screen Firefox. Second time, it minimizes you to what it *should* be.

To permanently change this, right click your desktop and choose “Change desktop background“. Using the tabs on top, go to “Visual Effects“. If you have the issue described above, you’ll have the option set to “Extra”.

Visual Effects Messing Up Firefox's Top & Bottom Panels

Visual Effects Messing Up Firefox's Top & Bottom Panels

Change it to “None“, and the issue will be gone (+ that rhymes!). The options “Normal” and “Extra” both have this problem (allthgough some report that “Normal” visual effects work just fine).

From now on, Firefox will reopen in a normal sized window, leaving your bottom panel & top title bar visible again.

I’m not sure exactly what option made this happen. If anyone goes through the troubles in the “Custom” > “Preferences” theme, I’d love to know what it is. :-)

Not sure if it’s related or not, but my open applications don’t appear in the bottom bar anymore. Switching from app to app now requires alt+tab, since I can’t see which ones are open through the bottom bar anymore.

Matti linux , , ,

Plesk Update 9.0 to 9.0.1: Time To Open TCP 11444

February 11th, 2009

If you’ve recently upgraded your Plesk installation to Plesk 9.0.1, you might find yourself locked out from Plesk all of a sudden.

When browsing to your Plesk Controlpanel on port 8443, the top bar will load, but the login form won’t be visible. That’s because in the background, it attempts to load that form through a TCP communication started on port 11444.

For everyone behind a firewall, this means changing it so port 11444 TCP incoming is opened up as well.

This change was needed for the Single Sign-On feature in Plesk, which operates on port 11444. If you want quick access to your Plesk again, without changing firewall configs, you can disable Single Sign-On through the following command:

/usr/local/psa/bin/sso --disable

If you don’t want to disable it, you need to open the port.

Matti Plesk , , ,

Update A Specific Package With apt-get

February 10th, 2009

Probably default knowledge to most, but I didn’t find it right way. Turns out the “install” parameter, is also the “upgrade” control for a specific package.

If you’re trying to update a specific package, do this:

apt-get install <package>

If the package’s already installed, the latest version will be installed on top of it. Using “install” as the upgrade parameter – who comes up with these things. :-)

Here’s a useful overview of all apt-get options: apt-get package management cheat sheet.

Matti linux , ,

Input Validation: Using filter_var() Over Regular Expressions

February 7th, 2009

Just about the biggest time-sink on any project, is the amount of input validation that needs to be done. You _have_ to assume your visitor is a maniac serial killer, out to destroy your application. And you have to prevent it.

Thus starts our never-ending battle for user input validation. We can’t allow it all (think XSS or SQL Injection), so we check every value presented to us. Correct e-mail formats, IP’s, integers, HTML-code, …. Read more…

Matti PHP , , ,

There’s No Such Thing As Unlimited

February 2nd, 2009

un-lim-it-ed [uhn-lim-i-tid]
–adjective
1. not limited; unrestricted; unconfined: unlimited trade.
2. boundless; infinite; vast: the unlimited skies.
3. without any qualification or exception; unconditional.

Here’s the short version: it simply doesn’t exist, because nothing is unlimited

And especially not a webhosting company that claims “unlimited bandwidth” or “unlimited diskspace”, such as Dreamhost or Servage.

It’s not my intention to burn both companies into the ground, because I’m sure *something* about them is good – but it’s ment to raise questions about their “unlimited” part, and the business model they encompass. Read more…

Matti hosting , ,