Posts Tagged ‘status’

Fix to “413 Request Entity Too Large” error in Nginx webserver and what causes it

Friday, November 14th, 2014

nginx_413_request_entity_too_large-fix

If you administer NGINX caching server serving static files content and redirecting some requests to Apache and you end up with errors when uploading big files (using HTTP PUT method), even though in Apache's PHP  upload_max_filesize is set to relatively high number upload_max_filesize = 60M.

Here is what happens during hand shake of web-browser -> server interaction 'till status is returned:
 

Web browser or Webcrawler robot goes through the following phases while talking to Web server:

 

1. Obtain an IP address from the IP name of the site (base on site URL without the leading 'http://'). 
This is provided by domain name servers (DNSs) configured for PC.
2. Open an IP socket connection to that IP address.
3. Write an HTTP data stream through that socket
(4) Receive an HTTP data stream back from the Web server in response. 
This data stream contains status codes whose values are determined by the HTTP protocol
whether successful. 

 

In the case the is recognized and reported to client 'web browser', causing the error.

The fix is to also increase max file upload limit in NGINX this is done via:
 
client_max_body_size variable in /usr/local/nginx/nginx.conf (or /etc/nginx/nginx.conf whether Nginx is installed from package).
Here is extract from nginx.conf

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

 

    server {
        client_max_body_size 60M;
        listen       80;
        server_name  localhost;

        # Main location
        location / {
            proxy_pass         http://127.0.0.1:8000/;
        }
    }
}


To make new configuration active Restart Nginx:

/etc/init.d/nginx restart

Flood Apache Benchmarking tutorial – How to do website performance analysis and tuning with flood and Apache 2

Tuesday, January 15th, 2008

a Good small pdf describing Apache Flood can be seen from Here Also in the Document are mentioned some interestent system status utilities :)END—–

Is Free software communistic in essence. My 5 cents rant on Free Software’s ideology

Wednesday, October 9th, 2013

linux-because-microsoft-is-for-capitalists-running-dos

I've seen people online blaming Stallman and Free Software Movement for being communistic. I've thought over it for a while so decided to give my 5 cents rant on that. Obviously there is still people in America who doesn't make difference between capitalism, communism and socialism. Yes it is true, GNU / Linux and Free Software are socialistic in essence and obviously Stallman's ideas are close to Socialists ideas, but for sure in his essence its not against capitalism and even less against democracy. So why there are still people recognizing free software as communistic? I think it is due to their mis-understanding that Free Software doesn't stand for making people equal but it is for giving chance to everyone who has interest to learn and doesn't have the financial possibility to do it. By its existince free software gives the poor Afrika's population legal way to install and use software free of charge. The idea of free software is purely scientific, there are plenty of researchers who denied patenting their invention because they wanted to share their findings with the world like Willhelm Roentgen's finding of X-rays. FS is for giving to society it is for software for people who should not be necessary divided by social status or bank account. Free Software puts out bariers since its fosters a spirit of community so much lost in our very divided century, it makes people involved in FS opened to itself and being friends no matter of social status. It is to make people free to choose and do whatever they like with each software it is about transperancy and equal start to programmers and computer enthusiasts. I'll be curious to hear people's opinion?

Negative impact of Cell Phones (GSM) use on individual and society

Monday, June 25th, 2012

Negative impact of Cell Phones GSM on individual and society

We all live in an age, where cell-phone communication has become a standard part of our daily lives. As with everything new adopted in basic human life. GSM tool inclusion in our life had a severe impact on both individuals and in summary to whole society groups and nations.

The benefits out of having an instant “channel” for communication to anyone else in the world are indoubtfully numerous. However as present tosicety is learned to mostly thing in one direction, most people didn’t have a clear understanding on the negative impact of this little communicators on our mind body and soul.

1.; Negative impact of mobile phones on body level

Whenever we talk over the phone especially when picking up incoming calls or initiating out-going ones, the GSM device has to connect to the closest network cell “dial up” and wait for initialization of remote or local connection. The levels of radiation waves during the two mobiles connects up is higher. Therefore if one moves the phone near his ear listening for the status of call the amount of radiation that enters our brains is slightly higher. The extra-radiation whether mobiles are connecting is also few times more whether our phone is ringning, hence it is unhealthy to put the phone near our ear before we press the Answer Call button.

2.;; Negative effect of continuous mobile phones use on human brain

Knowing about the increased radiation on connection initialization thanksfully one can protect himself by simply not putting the mobile headset near ear on call initialization. Though this “problem” can be partially solved, next comes the health brain damage (tumours) which according to some researches are higher among people who do frequentlong phone call conversations. In long phone calls the brain is exposed for a longer time to the flowing waves making the peer to peer call possible. According to some medical researches, a long and frequent phone calls could be a reason not only for brain cancers but also other misfunctions or damages in normal brain cells functioning.

3.;;; The bad impact of Cell Phones on nervous system

Another health issue which the daily phone use and the constant exposure to mobile network cells radio frequency radiation affects generally our nervous system.

Unexpected phone calls early in morning or late at night are a cause for increased bodily stress and even the fear sometimes for an incoming phone call are a cause for many types of neurological disorders diagnosed by psychiatrists.
Even when we sleep at night the mobile phone periodically connects to the nearest mobile cell generating some almost undetectable “waves contamination”. This constant waves air flow caused by the mobile network cells positioned all around cities is not usual thing for our bodies. This also has some influence on our nervous system as the nervous sysm tends to be a bit more alert because of the waves constantly passing the body. The natural reaction of our bodies nerves is to try to balance itself. As nervous system of different people is not equal some people’s nervous system is more prone to having difficulties to balance the disbalance created by the increased number of mobile air waves.
The result of this to many people is in increased sleeplessnes and hardships to get asleep (according to research taken place in American Academy of Sleep Medicine.).

4.;;;; Lost of social and ethical behaviour in people

There is lately observed a huge shift from a face to face communication to peer to peer (p2p) on the phone. The cellphones breeds a culture of socially group detached people (the communication over phone is rarely a conference) but rather consists of communication between two persons (peer to peer). The p2p communication is not only a primary mean of communication of people exposed to heavy phone use. p2p Communication is a primary communication in Skype, Google Talk and mostly all modern available communication medias and softwares.

As more and more people spend nowdays more time on the mobile than in real communication, this makes them introverted and isolated and increases the inability to deal with real human f2f interaction. In other words continuous phone use re-trains us to communicate with others via the mobile. Besides that according to numerous researches about 40 to 50% of visual communication whether a phone call is used is lost (this also makes negotiation or expressing over phone harder and at least twice longer than in real communication).

The influence of the decreased social abilities cause of the phone use has also an impact on ethical behaviour of people too. The increased lost of communication abilities makes even daily real communication vague and lacking accepted social norms and ethical values. Next to that comes the huge problem of over-simplification of communication. As the line communication over the phone loose half of the communication as well as sometimes there are quality of voice over the network interferences. People are doing their best to simplify the communication adopting short command like like phrases and talking in a slang.

5.;;;;; Addiction to mobile phone use

The use of mobile phone often has a short beep sounds, whether you work on the keyboard receive a phone call or look for some mobile functionality staring at the screen. We’re wearing the mobile everywhere with us so often we do check the mobile screen quite un-consciously (by addiction). Checking the mobile screen to see what time is it has become almost an instinct and an automated learned behaviour.

The continous use of mobile phones makes many people mobile addicts. There are huge amount of people I’ve observed who speaks everyday for few hours (whether everytime they feel lonely they call someone in order not to feel lonely). The mobile phone addiction in youngsters is slighly higher than in adults. Probably the most mobile dependent addicts are kids who were given a mobile to use since there very early years.
Anyways there are tons of adults nowdays who cannot even think to be able to live without mobile and even cannot understand: how can anyone think that life could be possible without a cell phone. This kind of thinking is a direct trait showing an addiction and dependency on the phone such people have.

How to copy CD or DVD on GNU/Linux and FreeBSD using console or terminal

Monday, November 14th, 2011

CD Burning Console Terminal Linux / FreeBSD picture

These days more and more people start to forget the g* / Linux old times when we used to copy CDs from console using dd in conjunction with mkisofs .

Therefore to bring some good memories back of the glorious console times I decided to come up with this little post.

To copy a CD or DVD the first thing one should do is to make an image copy of the present inserted CD into the CD-drive with dd :

1. Make copy of the CD/DVD image using dd

# dd if=/dev/cdrom of=/tmp/mycd.iso bs=2048 conv=notrunc

/dev/cdrom is the location of the cdrom device, on many Linuces including (Debian) /dev/cdrom is just a link to the /dev/ which corresponds to the CD drive. Note on FreeBSD the location for the CD Drive is /dev/acd0
/tmp/mycd.iso instructs dd CD image creation to be placed in /tmp/ directory.
bs argument instructs it about the byte size portions by which the content of the CD-Drive inserted CD will be read. bs value of 2048 is actually only 2KB per dd read, increasing this value will decrease the time required for the CD image to be extracted.

2. Prepare CD image file to be ready for burning

After dd completes the image copy operation, next to prepare the extracted image / ISO to be ready for burning mkisofs is used:

# mkisofs -J -L -r -V TITLE -o /tmp/imagefile.iso /tmp/mycd.iso

The -J option makes the CD compatible for Pcs running Microsoft Windows. The -V TITLE option should be changed to whatever title the new CD should have, -r will add up status bar for the mkisofs operation.
-r is passed to create specific file permissions on the newly created CD, -o specifies the location where mkisofs will produce its file based on the CD image /tmp/mycd.iso .

3. Burning the mkisofs image file to a CD/DVD on GNU / Linux

linux:~# cdrecord -scanbus
linux:~# cdrecord dev=1,0,0 /tmp/imagefile.iso

If all wents okay with cdrecord operation, after a while the CD should be ready.

4. Burning the mkisofs image file to CD on FreeBSD

freebsd# burncd -f /dev/acd0 data /tmp/imagefile.iso fixate

How to crack password protected rar and 7z files on GNU / Linux

Friday, October 7th, 2011

break / crack password protected rar, zip archives on Linux and FreeBSD rarcrcack

RarCrack is able to crack rar and 7z archive files protected by password on Linux.
The program is currently at release version 0.2, so its far from perfection, but at least it can break rars.

RarCrack is currently installable on most Linux distributions only from source, to install on a random Linux distro, download and make && make install . RarCrack’s official site is here, I’ve mirrored the current version of RarCrack for download here . To install rarcrack from source using the mirrored version:

linux:~# wget https://www.pc-freak.net/files/rarcrack-0.2.tar.bz2
...
linux:~# tar -jxvvf rarcrack-0.2.tar.bz2
linux:~# cd rarcrack-0.2
linux:~/rarcrack-0.2# make
...
linux:~/rarcrack-0.2# make install
...

On FreeBSD, rarcrack is available and installable via the ports tree, to install on FreeBSD:

freebsd# cd /usr/ports/security/rarcrack
freebsd# make && make install
...

To use RarCrack to crack rar, zip or 7z archive file:

freebsd% rarcrack rar_file_protected_with_password.rar --type rar

The argument –type rar is optional, in most archives RarCrack should detect the archive automatically. The –type option could also take the arguments of rar and 7z .

I’ve created a sample rar file protected with password linux_then_and_now.png.rar . The archive linux_then_and_now.png contains a graphic file illustrating the linux growth in use in computers, mobiles and servers. linux_then_and_now.png.rar is protected with the sample password parola

RarCrack also supports threads (a simultaneous instance spawned copies of the program). Using threads speeds up the process of cracking and thus using the –threads is generally a good idea. Hence a good way to use rarcrack with the –threads option is:

freebsd% rarcrack linux_then_and_now.png.rar --threads 8 --type rar
RarCrack! 0.2 by David Zoltan Kedves (kedazo@gmail.com)
INFO: the specified archive type: rar
INFO: cracking linux_then_and_now.png.rar, status file: linux_then_and_now.png.rar.xml
Probing: '0i' [24 pwds/sec]
Probing: '1v' [25 pwds/sec]

RarCrack‘s source archive also comes with three sample archive files (rar, 7z and zip) protected with passwords for the sake of testing the tool.
One downside of RarCrack is its extremely slow in breaking the passwords on my Lenovo notebook – dual core 1.8ghz with 2g ram it was able to brute force only 20-25 passwords per second.
This means cracking a normal password of 6 symbols will take at least 5 hours.
RarCrack is also said to support cracking zip passwords, but my tests to crack password protected zip file did not bring good results and even one of the tests ended with a segmentation fault.

To test how rarcrack performs with password protected zip files and hence compare if it is superior or inferior to fcrackzip, I used the fcrackzip’s sample pass protected zip noradi.zip

hipo@noah:~$ rarcrack --threads 8 noradi.zip --type zip
2 by David Zoltan Kedves (kedazo@gmail.com)
INFO: the specified archive type: zip
INFO: cracking noradi.zip, status file: noradi.zip.xml
Probing: 'hP' [386 pwds/sec]
Probing: 'At' [385 pwds/sec]
Probing: 'ST' [380 pwds/sec]

As you can see in above’s command output, the zip password cracking rate of approximately 380 passwords per second is a bit quicker, but still slower than fcrackzip.

RarCrack seg faults if cracking a pass protected zip is passed on without specifying the –type zip command arguments:

linux:~$ rarcrack --threads 8 noradi.zip
RarCrack! 0.2 by David Zoltan Kedves (kedazo@gmail.com)
Segmentation fault

While talking about cracking protected rar and zip archives with password, its worthy to mention creating a password protected archive with Gnome Desktop on Linux and FreeBSD is very easy.

To create the password protected archive in Gnome graphic environment:

a. Point the cursor to the file you want to archive with password

Gnome pointing file properties drop down menu

b. Press on Other Options and fill in the password in the pwd dialog

Linux protect rar with password on Gnome Desktop

I think as of time of writting, no GUI frontend interface for neither RarCrack or FcrackZip is available. Lets hope some good guy from the community will take the time to write extension for Gnome to allow us to crack rar and zip from a nice GUI interface.

How to check Host is up with Nagios for servers with disabled ICMP (ping) protocol

Friday, July 15th, 2011

At the company where I administrate some servers, they’re running Nagios to keep track of the servers status and instantly report if problems with connectivity to certain servers occurs.

Now one of the servers which had configured UP host checks is up, but because of heavy ICMP denial of service attacks to the servers the ICMP protocol ping is completely disabled.

In Nagios this host was constantly showing as DOWN in the usual red color, so nagios reported issue even though all services on the client are running fine.

As this is quite annoying, I checked if Nagios supports host checking without doing the ICMP ping test. It appeared it does through something called in nagios Submit passive check result for host

Enabling the “Submit passive check result for this host” could be done straight from Nagios’s web interface (so I don’t even have to edit configurations! ;).
Here is how I did it. In Nagios I had to navigate to:

Hosts -> Click over my host (hosting1) which showed in red as down

Nagios disable ICMP ping report for hosts

You see my down host which I clicked over showing in red in above pic.

On next Nagios screen I had to select, Disable active checks of this host

Nagios Disable active ICMP checks of this host
and press on the Commit button.

Next following text appears on browser:

Your command request was successfully submitted to Nagios for processing.

Note: It may take a while before the command is actually processed.

Afterwards I had to click on Submit passive check result for this host and in:
Check Output to type in:

check_tcp -p 80

Here is the Screenshot of the Command Options dialog:

Nagios submit passive check with check TCP -p 80

That’s all now Nagious should start checking the down host by doing a query if the webserver on port 80 is up and running instead of pinging it.
As well as the server is no longer shown in the Nagio’s Down host list.

How to fix “delivery 1: deferral: Sorry,_message_has_wrong_owner._(#4.3.5)/” qmail mail delivery failure message

Friday, May 20th, 2011

After a failed attempt to enable some wrapper scripts to enable domain keys support in a qmail powered mail server my qmail server suddenly stopped being able to normally send mail.

The exact error message which was logged in /var/log/qmail/current was:

@400000004dd66fcc16a088ac delivery 1: deferral: Sorry,_message_has_wrong_owner._(#4.3.5)/

This qmail messed happened after I substituted /var/qmail/bin/qmail-queue and /var/qmail/bin/qmail-remote with two respective wrapper shell scripts which were calling for the original qmail-queue and qmail-remote binaries under the names qmail-queue.orig and qmail-queue.orig

Restoring back qmail-queue.orig to /var/qmail/bin/qmail-queue and qmail-remote.orig to /var/qmain/bin/qmail-remote and restarting the mail server broke my qmail install.

After a bunch of nerves trying to isolate what is causing the error I found out that by mistake I forgot to copy the qmail-queue and qmail-remote permissions and ownership.

Thus I had to check another qmail working installation’s permissions for both binaries and fix the permissions to be equivalent to the permissions:

debian:~# ls -al /var/qmail/bin/qmail-remote
-rwx–x–x 1 root qmail 50464 2011-05-20 12:56 /var/qmail/bin/qmail-remote*
debian:~# ls -al /var/qmail/bin/qmail-queue
-rws–x–x 1 qmailq qmail 20392 2011-05-20 12:56 /var/qmail/bin/qmail-queue*

The exact chmod and chmod commands I issued to solve the shitty issues were as follows:

First I fixed the qmail-queue and qmail-remote ownership:

debian:~# chown qmailq:qmail /var/qmail/bin/qmail-queue
debian:~# chown root:qmail /var/qmail/bin/qmail-remote

Second I set the proper file permissions:

# make the qmail-queue binary suid
debian:~# chmod u+s /var/qmail/bin/qmail-queue
debian:~# chmod 611 /var/qmail/bin/qmail-queue
debian:~# chmod 611 /var/qmail/bin/qmail-remote

Third and last I did a restart of the qmail server and tested it sends properly

debian:~# /usr/bin/qmailctl stop
Stopping qmail...
qmail-send
qmail-smtpd
debian:~# /usr/bin/qmailctl start
Starting qmail

Finally to test that the qmail server qmail-queue was queing and sending with qmail-remote I used the system mail command like so:

debian:~# mail -s "test email" testuser@www.pc-freak.net
asdfafdsdf
.
Cc:

Afterwards the mail was properly received on my mail account testuser@www.pc-freak.net immediately.

In my /var/log/qmail/current log file all seemed fine:

@400000004dd6702a2eb2b064 starting delivery 1: msg 85281596 to remote testuser@www.pc-freak.net
@400000004dd6702a2eb2b834 status: local 0/20 remote 1/20
@400000004dd6702b34cc809c delivery 1: success: 83.228.93.76_accepted_message./Remote_host_said:_250_ok_
1305899099_qp_65293/
@400000004dd6702b34cc886c status: local 0/20 remote 0/20
@400000004dd6702b34cc8c54 end msg 85281596

The test mail was properly received on my mail account testuser@www.pc-freak.net immediately.

It took me like half an hour to figure out what exactly is wrong with the permissions in situations like this I really wanted to change all my qmail installs with postfix and forget forever I ever used qmail …

Linux Check Laptop battery status from Console / Terminal

Tuesday, September 15th, 2009

I needed to have a quick way to check my battery status via terminal and I googled around looking
for a solution. I found the following website explaining in a pretty good way “How to check your battery status in Console”.
.Just like the blog explains the proper way to do that in Linux is via the acpi command. In case if you don’t have, yet the commandplease install it.
1. The fastest way to check the laptop battery status is via: $ acpiThe output would be something like this:Battery 1: discharging, 91%, 02:00:09 remaining2. Check laptop battery temperature:$ acpi -t3. Check laptop battery AC Power Status$ acpi -a4. Check everything related to acpi$ acpi -V
Another possible way to check for your notebook battery status from console in Linux is via:
acpitool
1. Command to show general information for battery status:$ acpitool2. For detailed battery information use:$ acpitool -B add “-v” for verbose output3. Show information about AC power.$ acpitool -a
Some of the other possible ways to check your battery charge status via console are either via: yabs ( Yet Another Battery Status ) script or via:
cat /proc/acpi/battery/BAT0/state orcat /proc/acpi/battery/BAT0/info
END—–