Shell Script - Generator update packages


1 Estrelas2 Estrelas3 Estrelas4 Estrelas5 Estrelas (1 votes, average: 5.00 out of 5)
Loading ... Loading ...
Shell Script - Generator update packages

Hello everybody.

Today I will show how to script to read an update from SVN and generates a zipped package with only the files that have changed from one revision to another. For this we use Shell Script. Yes! if you run Windows will run out this mamata !!!!!

First I would like to say that I'm no expert in Shell Script and much less on Linux. I'm just a guy who loves and seeks to use them in day-to-day to make facilities, productivity and fun.

For the reason described in the preceding paragraph, this script could be improved greatly. But answer me perfectly and made me reduce the update time of my environment just 20 minutes to 3 :)

So come on!

It would be nice to know you a little of the topics below to be able to follow the reasoning:

  • Linux (why our scritp only runs on it);
  • Do some things on line comanto (because it is more elegant);
  • SVN in command line (in order to understand the script better);

Read the rest of this entry »

[Apache] mod_deflate: Reduce the load time of your pages


1 Estrelas2 Estrelas3 Estrelas4 Estrelas5 Estrelas (1 votes, average: 5.00 out of 5)
Loading ... Loading ...
[Apache] mod_deflate: Reduce the load time of your pages

This article is a hook pulled from the article " Performance - less requets and more cache "of Michael Mafort .

Hello everybody, today I'll talk about a nice Apache configuration. It's mod_deflate .

Well, using mod_deflate is a way to reduce the loading time of a page. But how does he do it?
When Apache receives a request to display a page to compact it before sending to the client and this makes the data traffic is much lower. This is very efficient in HTML pages (but also other types of compact files).
When I talk pages include HTML pages. Php to generate HTML in response ok?

Apache will surely be a little slower to return the HTML for the fact of having to compress the response, but even so the page will load faster.

For anyone who uses Linux is very easy to make this setting: Read the rest of this entry »

Compress files with PHP


1 Estrelas2 Estrelas3 Estrelas4 Estrelas5 Estrelas (3 votes, average: 3.67 out of 5)
Loading ... Loading ...

Hello folks, today I will show you how to compress file with PHP. The procedure is very simple, if your server is with zlib enabled just run a code like this:

  1. <?
  2. / **
  3. * Inserts a file within a zip.
  4. *
  5. * @ Param string $ name name_of_zip ZIP file that will be worked.
  6. * @ Param string $ path_file Path original file that goes to the ZIP
  7. * @ Param string $ file_name file name inside the ZIP
  8. * @ Return Mixed
  9. * /
  10. $name_of_zip = null , $path_file = null , $file_name = null ) { fileToZip function ($ name_of_zip = null, $ path_file = null, $ file_name = null) (
  11. empty ( $name_of_zip ) || empty ( $path_file ) || empty ( $file_name ) ) { if ( empty ($ name_of_zip) | | empty ($ path_file) | | empty ($ file_name)) (
  12. ; return 'All parameters are required';
  13. )
  14. / / Create an instance of the ZIP
  15. ZipArchive; $ Zip = new ZipArchive;
  16. / / If unable to create the ZIP file
  17. $zip -> open ( $name_of_zip , ZIPARCHIVE:: CREATE ) === true ) { if ($ zip -> open ($ name_of_zip, ZIPARCHIVE:: CREATE) === true) (
  18. / / Add the file in the zip
  19. ( $path_file , $file_name ) ; $ Zip -> AddFile ($ path_file, $ file_name);
  20. ( ) ; // fecha a conexão com o ZIP $ Zip -> close () / / close the connection to the ZIP
  21. / / Optionally you can delete the original file, just insert a variable in the parameters
  22. / / Unlink ("/ path / to / file / file.php ');
  23. ; return true;
  24. { Else ()
  25. ; return false;
  26. )
  27. )
  28. ?>

Read the rest of this entry »

[Quickie] PHP - Do not write files. "Inc '


1 Estrelas2 Estrelas3 Estrelas4 Estrelas5 Estrelas (2 votes, average: 5.00 out of 5)
Loading ... Loading ...
[Quickie] PHP - Do not write files. "Inc '

If your Apache server is not configured properly it causes files. Inc is displayed on the screen. Soon, the entire contents of the file is displayed in the browser.

Say you have a file in which the arrow of your system settings, such as: Host of the database, username and password.
Saved with the name config.inc.
By accessing this file directly by URL see what happens:

config.inc sendo exibido no Firefox Read the rest of this entry »

Playing with a bot for Gtalk


1 Estrelas2 Estrelas3 Estrelas4 Estrelas5 Estrelas (1 votes, average: 5.00 out of 5)
Loading ... Loading ...

Goodnight everyone!

Last night I played a bit by creating a bot to Gtalk . As was just a joke I tested from within the same gmail .. or a downloaded client.

The bot is called tempo@bot.im and when you send a message to him by the name of any Brazilian city he responds to the situation of the time. Ex:

tempo1 Brincando com um bot para Gtalk

Surely some bug. But thanks for testing. The bot is always online, so if you want to test is the will.

I'm taking a look at Jabber (Gtalk uses it) and I will create 'something' useful. I should post about it. Wait ...

A big hug!

Get Adobe Flash player Plugin by wpburn.com wordpress themes