Re: Web development preferences



On Monday 04 Jan 2010 23:08, while playing with a tin of spray paint,
houghi painted this mural:

David Bolt wrote:
Using your own public_html directory does mean not having to mess with
the main server directory, and introduces some small amount of
protection. Even if your firewall is opened for port 80, unless those
on the outside know the user-name, they can't access the test pages.

Yeah. I keep forgetting that. I am too lazy to type houghi.eu/~houghi
(How does this delete button work anyway?)

What delete button?

Unless it's purely web-related PHP, it could be on topic. After all,
this would be the php equivalent to the bash script written for Vahis
in the "batch renaming in a subfolder tree" thread:

LOL.

I was actually fairly serious there. I've written a few shell scripts
to use PHP instead of bash because what I've wanted to achieve was
easier in a PHP script rather than bash script.

For instance, one script is one I use for package building. It checks
the checksum of each spec file and then queries a MySQL database to
find out if the package is known or not, whether the checksum matches
the one stored and so if it needs to be rebuilt or not. If it hasn't
changed since the last build attempt, successful or not, it won't
bother to build the package again, unless I pass an option to force it
to do so. If there's been a change of checksum, it marks the package
for rebuilding in all the releases for which I do test builds and then
tries to build it. If the package isn't known, it adds the package to
my database and then tries to build it. After the build script has
finished, it stores the results, successful or not, ready for the next
time it's run.

It also accepts arguments on the command line so, as well as building
against the various released versions of openSUSE, it can also build
against my mirrors of the Packman packages, VideoLan, and/or the
updates. On top of that, I can build against packages I'm building so
I can satisfy dependencies that none of the main repos provide.

It's also capable of building for different architectures, e.g. when
running on a 64bit system, it can build 32 or 64bit packages. The only
"issue" I have is that it has to be run as root because the build
script, which builds packages in a chroot environment, won't run as a
normal user.

Then there's the one I use for batch trimming image files, while
optionally maintaining aspect ratios. That comes in very useful for
cropping images for my last script.

The last major script I wrote was one I use for batch converting images
ready for use as desktop wallpapers. That one uses much the same
technique as the script in my last reply to recursively re-size an
image to fit my desktop (1920x1080) while adding a background when the
image dimensions won't quite fit[0]. It goes through the directory
structure, using identity to get the file size and image type, it
creates a new name from the path the image was stored in, and then
creates the correct command line for convert, which it uses to do the
actual conversion.

The only ones scripts I won't try writing in PHP are those that are
interactive, and that's purely because I've not yet learnt how to have
a script read from a console while it's running. Once I've learnt that,
I'll have fun implementing them in both bash script and PHP, just to
see which is easier and/or shorter. My guess is that the bash scripts
will be a little shorter, but the PHP scripts won't have to call as
many external programs to do the same job.


[0] For portrait images, the image is flush to the right with the
background filling the area to the left. If the image is square or
landscape, it's centred and the outside edges are filled with the
background colour.

Regards,
David Bolt

--
Team Acorn: www.distributed.net OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s
openSUSE 11.0 32b | | openSUSE 11.2 32b |
openSUSE 11.0 64b | openSUSE 11.1 64b | openSUSE 11.2 64b |
TOS 4.02 | openSUSE 11.1 PPC | RISC OS 4.02 | RISC OS 3.11
.



Relevant Pages

  • [FLSA-2005:166943] Updated php packages fix security issues
    ... PHP is an HTML-embedded scripting language commonly used with the Apache ... A bug was discovered in the PEAR XML-RPC Server package included in PHP. ... If a PHP script is used which implements an XML-RPC Server using the ... where is a list of the RPMs you wish to upgrade. ...
    (Bugtraq)
  • [Full-disclosure] [FLSA-2005:166943] Updated php packages fix security issues
    ... PHP is an HTML-embedded scripting language commonly used with the Apache ... A bug was discovered in the PEAR XML-RPC Server package included in PHP. ... If a PHP script is used which implements an XML-RPC Server using the ... where is a list of the RPMs you wish to upgrade. ...
    (Full-Disclosure)
  • Installation of software, and security. . .
    ... installation in Windows and various package managers. ... A setup.exe program coded by some third party such as Real Networks ... A .msi Microsoft Installer package is unpacked, and a script coded by ...
    (Bugtraq)
  • Re: goto &Package::func destroying @_?!
    ... >>script, but maybe the description will trigger something from someone.... ... code the 'Core' package uses another package as a base that has a custom ... package Foo; ... if it really is a problem with goto&. ...
    (comp.lang.perl.misc)
  • Re: Please help: Mail-Transfer encoding problem
    ... > My script sends multipart emails using the MAIL_MIME package from ... You may want to try this other package as it works perfectly for me: ... PHP Classes - Free ready to use OOP components written in PHP ...
    (alt.php)