Tuesday, December 16, 2008

HTML errors messages

Do you want to know what is the meaning of those weird error messages in your web browser, such as "error 407" or "error 400", whenever you try to access an internet page ?

Here is a helpful table, mainly when you are reading Squid's access log file. I found it in Stretched Out site:

Code

Description

Comment/Reason

100

Continue

101

Switching Protocols

200

OK

Action complete successfully

201

Created

Success following a POST command

202

Accepted

The request has been accepted for processing, but the processing has not yet been completed.

203

Partial Information

Response to a GET command, indicates that the returned information is from a private web.

204

No Content

Server has received the request but there is nothing to send back. (Empty Document)

205

Reset Content

206

Partial Content

The requested file was partially sent. Usually caused by stopping or refreshing a web page before it loads.

300

Multiple Choices

The request could fit multiple files.

301

Moved Permanently

Requested a directory instead of a file. The web server substituted the index.html file.

302

Moved Temporarily

303

See Other

304

Not Modified

The cached version of the requested file is the same as the file to be sent.

305

Use Proxy

400

Bad Request

The request had bad syntax or could not be interpreted.

401

Unauthorized

User failed to provide a valid user name / password required for access to file / directory.

402

Payment Required

403

Forbidden

Access to a protected or private password protected folder was attempted.

404

Not Found

The requested file was not found.

405

Method Not Allowed

406

Not Acceptable

407

Proxy Authentication Required

408

Request Time-Out

The server did not respond in the allocated time.

409

Conflict

410

Gone

411

Length Required

412

Precondition Failed

413

Request Entity Too Large

414

Request-URL Too Large

The submitted URL was too long to be interpreted by the server.

415

Unsupported Media Type

500

Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request

501

Not Implemented

The server does not support the service required.

502

Bad Gateway

503

Out of Resources

The server cannot process the request due to a system overload. This is usually a temporary condition.

504

Gateway Time-Out

The service did not respond within the time frame that the gateway was set to wait.

505

HTTP Version not supported

The Web Server does not understand the version of http used by the browser.

Friday, December 12, 2008

Teacher says that there is no free software

I have just known that (in portuguese), and it is astonishing. You can read more about this in Blog of Helios and The Contractor UK, both in English.

The summary
Karen (the teacher) saw students around a laptop, and went to understand it. She found one of them with the laptop showing what Linux could do in his machine (take a look at some of this videos). Not only this, but he was GIVING copies of it to his friends.

Karen kept them all and after talking to the students, she had a name: Ken Starks. She wrote the email with lots of wrong ideas. Both emails, from Karen and Starks' answer are in Blog of Helios.

The worst
Even in US, a great country, even in Texas, a great state, developed, with lots of technologies, lots of people just don't know that there are others possibilities besides MS Windows. A teacher, whose responsability is to prepare youngs , should know this. At least, not to be saying so many wrong things.

I have no doubt: she did what she understood as correct. Where she saw a threat to the kids, she reacted in defense of them. But she is indeed not prepared. Not in technology matters.

She needs to stay in touch with technoloy, as to other subjects. Or else, she may be teaching that the Earth is flat ...

Monday, December 8, 2008

Linux for simple users - Ubuntu and OpenOffice

Since the beginning in my Linux story, Linux installations has been easier and easier. Up to now, what we see is Linux growing more and more in companies. Not on the desks, but working where the common user does not see.

There, there are no need to use graphic interface, or mouses. It is a completely different world, where all the commands are issued at a black screen with small white letters, completely senseless. At least, for common users.

Common users want to turn on the system, enter their login account and password, and use it by clicking the Internet browser. Oh, forgot the MSN also. We will try to discuss and show some details of Linux security and Linux installation.

High Cost of Aquisition
The problem is the cost of proprietary software. Here in Brazil MS Windows and MS Office are very expensive, as can be seen in the picture. In this famous Brazilan store, I choose Windows Ultimate with SP1 in DVD, an MS Office 2007 Standard version, in CD. Both cost R$ 1,798.00 (US$ 715.90 and EUR$ 555.00), today. Almost the same buy in Amazon.com costs a a little less, but with the more complete MS Office Professional 2007 full version: US$ 649.98 (R$ 1,632.43). I am not considering the Anti Virus (there is no chance for making use of MS Windows if you do not install such software).

No Cost of Aquisition
Considering all the functions that MS Office offers to you (and I believe that today there are no better Office Suit) I'd say that it is reasonable to pay such value. But, I believe that the majority of end users doesn't even know lots of basic procedures of MS Word or MS Excel. Many just need Power Point installed to read those presentations that come attached in many emails. So, in second hand, this money stars to get really expensive. If I consider the Linux I am using nowadays (Ubuntu 8.10, download here) and the Office Suite (Open Office 2) that is always helping me in writing my texts an sheets, I will conclude that I just "spent" the time to download Ubuntu, since OpenOffice is already installed in it. Nothing to buy, nothing difficult to use, and much more interesting (in brightness and cute stuff on screen). If you wanna know how, take a look at this, this and this. Just to start.

Compatibility
Of course, there are problems. No software made to Windows will work in Linux. In fact, some of then can, but not usually. Depending on the format of files, they can all be read. Except the new format DOCX. Ok, lots of people that yet use Office 2003 will have some troubles reading documents saved with MS Office 2007 also. Games and some other software will not work. But the problem is not resting on Linux. The software developers just make a version for Windows. Until they make a version for Linux (as they sometimes make an Apple version), their software will never work.

Open Software people are always looking for soving such problems of us. For DOCX problems, there is this solution. It is worhty.

Today, I am extremely used to work with Ubuntu 3D Desktop, and I get some frustated when I havo to use Windows and I find no especial effects, not only because it is funny, but because it is practical.

Conclusion
So, if you read/send emails, write some texts and sheets, and access Internet, Ubuntu may be for you. You should really give a try.

Next time, let's try to understand a little more about Linux security procedures and Linux installation. Feel free to post any questions.

Thursday, December 4, 2008

Hello World

Me and Mabuya were talking about something of FTP, and so I searched for some additional informations in Google. I then found a very interesting, funny and inteligent text, here about the famous first piece of most programmers. Have fun.

Who are you ? from Luiz Kobayashi.

Scholar:
10 PRINT "HELLO WORLD"
20 END

Script Kiddie:
program Hello(input, output)
begin
writeln('Hello World')
end.
Computers lover:
(defun hello
(print
(cons 'Hello (list 'World))))
Post-graduated Professional:
#include
void main(void)
{
char *message[] = {"Hello ", "World"}; int i;
for (i = 0; i < ptr =" new" operator ="(const" operator ="(const" size =" strlen(chrs);" ptr =" new" str = "Hello World">


Master
Programmer :
[
uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)
]
library LHello
{
// bring in the master library
importlib("actimp.tlb");
importlib("actexp.tlb");
// bring in my interfaces
#include "pshlo.idl"
[
uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
]
cotype THello
{
interface IHello;
interface IPersistFile;
};
};
[
exe,
uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
]
module CHelloLib
{
// some code related header files
importheader();
importheader();
importheader();
importheader("pshlo.h");
importheader("shlo.hxx");
importheader("mycls.hxx");
// needed typelibs
importlib("actimp.tlb");
importlib("actexp.tlb");
importlib("thlo.tlb");
[
uuid(2573F891-CFEE-101A-9A9F-00AA00342820),
aggregatetable
]
coclass CHello
{
cotype THello;
};
};
#include "ipfix.hxx"
extern HANDLE hEvent;
class CHello:public CHelloBase
{
public:
IPFIX(CLSID_CHello);
CHello(IUnknown *pUnk);
~CHello();
HRESULT __stdcall PrintSz(LPWSTR pwszString);
private:
static int cObjRef;
};
#include
#include
#include
#include
#include "thlo.h"
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"
int CHello::cObjRef = 0;
CHello::CHello(IUnknown *pUnk):CHelloBase(pUnk) {
cObjRef++;
return;
}
HRESULT __stdcall CHello::PrintSz(LPWSTR pwszString) {
printf("%ws\n", pwszString);
return (ResultFromScode(S_OK));
}
CHello::~CHello(void)
{
// when the object count goes to zero, stop the server
cObjRef--;
if (cObjRef == 0) PulseEvent(hEvent);
return;
}
#include
#include
#include "pshlo.h"
#include "shlo.hxx"
#include "mycls.hxx"
HANDLE hEvent;
int _cdecl main(int argc, char *argv[]) {
ULONG ulRef;
DWORD dwRegistration;
CHelloCF *pCF = new CHelloCF();
hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
// Initialize the OLE libraries
CoInitializeEx(NULL, COINIT_MULTITHREADED);
CoRegisterClassObject(CLSID_CHello, pCF,
CLSCTX_LOCAL_SERVER,
REGCLS_MULTIPLEUSE, &dwRegistration);
// wait on an event to stop
WaitForSingleObject(hEvent, INFINITE);
// revoque and release the class object
CoRevokeClassObject(dwRegistration);
ulRef = pCF->Release();
// Tell OLE we are going away
CoUninitialize();
return(0);
}
extern CLSID CLSID_CHello;
extern UUID LIBID_CHelloLib;
CLSID CLSID_CHello = {/*
2573F891-CFEE-101A-9A9F-00AA00342820*/
0x2573F891,
0xCFEE,
0x101A,
{0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20}
};
UUID LIBID_CHelloLib = {/*
2573F890-CFEE-101A-9A9F-00AA00342820 */
0x2573F890,
0xCFEE,
0x101A,
{0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20}
};
#include
#include
#include
#include
#include
#include "pshlo.h"
#include "shlo.hxx"
#include "clsid.h"
int _cdecl main(int argc, char *argv[]) {
HRESULT hRslt;
IHello *pHello;
ULONG ulCnt;
IMoniker *pmk;
WCHAR wcsT[_MAX_PATH];
WCHAR wcsPath[2 *_MAX_PATH];
// get object path
wcsPath[0] = '\0';
wcsT[0] = '\0';
if (argc > 1)
{
mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
wcsupr(wcsPath);
}
else
{
fprintf(stderr, "Object path must be specified\n");
return(1);
}
// get print string
if (argc > 2)
mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
else
wcscpy(wcsT, L"Hello World");
printf("Linking to object %ws\n", wcsPath);
printf("TextString %ws\n", wcsT);
// Initialize the OLE libraries
hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED); if
(SUCCEEDED(hRslt))
{
hRslt = CreateFileMoniker(wcsPath, &pmk); if
(SUCCEEDED(hRslt))
hRslt = BindMoniker(pmk, 0, IID_Hello, (void
**)&pHello);
if (SUCCEEDED(hRslt))
{
// print a string out
pHello->PrintSz(wcsT);
Sleep(2000);
ulCnt = pHello->Release();
}
else
printf("Failure to connect, status: %lx", hRslt);
// Tell OLE we are going away
CoUninitialize();
}
return(0);
}

Novice Hacker:
#!/usr/local/bin/perl
$msg="Hello, world.\n";
if ($#ARGV >= 0)
{
while(defined($arg=shift(@ARGV)))
{
$outfilename=$arg;
open(FILE, ">".$outfilename) || die"Can't write
$arg:$!\n"; print(FILE $msg);
close(FILE) || die "Can't close $arg:$!\n";
}
}
else
{
print($msg);
}
1;


Experimented Hacker:
#include
#define S "Hello, World\n"
main(){exit(printf(S) == strlen(S)?0:1);}


Super Hacker:
%cc -o a.out ~/src/misc/hw/hw.c
%a.out


Mega Enhanced Hacker:
%cat
Hello, world.
^D


Junior Manager:
10 PRINT "HELLO WORLD"
20 END


Senior Manager:
mail -s "Hello, world". ze@b12
Hey, can you write me a program that writes "Hello, world"? I need this for tomorrow.
^D


Master Manager:
%zmail jim
I need a "Hello, world" program to this afternoon.


CEO:
%letter
letter: Command not found.
%mail
To ^X^F^C
%help mail
help: Command not found.
%damn!
!: Event unrecognized
%logout