Best modern method to run a script after receiving an ftp'd file - sh

I just starting writing a new interface where I need to process a file after it has been ftp'd into my server. Is incron better than inotify in the long run or should I choose something else? BTW, I am using vsftpd.
p.s. I have already looked at other articles at this site but most of them are over 5 years old. I'm looking for the best solution in 2022.

Related

Gaim - How to develop a plugin? (Pidgin)

I need some of your help.
I searched everywhere on the internet, but I could not find how to create a plugin for Gaim, the predecessor of Pidgin.
I do NOT want to create a Pidgin plugin. I want to create a Gaim plugin, but since Gaim is very old, well, it is hard to find documentation for it.
(PS : If you know how to write a plugin for Gaim, please note I want to make one for Windows - not Linux.)
(PPS : I'm french. Sorry for my bad English.)
You're going to run into a number of issues here...
First off, Gaim hasn't existed for 15 years, and of course we (the Pidgin core team many of who got involved during the Gaim days) aren't going to support it for that reason.
Secondly, building on windows has always been a pain for us as we had to carry all of the dependencies. I imagine most of the links that you might find are all long dead because of the 15 years that have passed since that. That said you might be able to get away with using our win32-dev directory from https://data.imfreedom.org/pidgin/win32-dev.7z but of course that's completely untested and that directory is used to build the Pidgin 2.x.y releases.
Finally, as you've found out, most of the documentation from Gaim has been gone for a very long time. We did set up https://gaim.pidgin.im as a joke which was the last copy of the site we had before the rename, but there's not much there when it comes to development documentation. So your best bet is to look at existing plugins. I still have the source code for guifications1 available at https://keep.imfreedom.org/grim/guifications1/file/default.

Create a docx (Word) document by using Perl (module)

I have been looking for some time now, and I decided to try some crowd sourcing.
I have searched (Googled) the answer and looked through Stack Overflow for some time now, and I cannot find a proper and relatively easy way of created DOCX documents via Perl.
I want to create a DOC file, and since DOCX is XML based, I was guessing that would be an easier way to achieve this.
I located a RTF::Writer module but its very limited in its capabilities.
There are more than one such library for PHP, and other languages, but I cannot use that, unfortunately.
I am not running on a Windows environment so I cannot use anything that would integrate with Office, in addition I don't want to start bundling Office with my product.
I am open to suggestions, but please provide sensible ones :) i.e. no, you are scr*wed DOCX is impossible.
Here is what I tried:
1) Take an existing DOCX, and modify the XML directly, all I achieved via this is caused Word to crash :) apparently Word is very sensitive on its attribute order
2) Googled for answers and I found some, like Win32::Word::Writer which only works on Windows and requires OLE and Office
3) Found a lot of posts from 2010, that say its impossible, well almost 4 years have passed, probably something is out there that can do it
4) Looked for commercial solutions, couldn't find one, I found FOP which is able to create RTF, which is pretty close, but it lacks a lot of the styling I would like to use
5) A lot of things (code and modules) that allow extracting data from DOCX, but nothing that can create one, weird
6) Found abandoned code like OpenOffice::OODoc which stopped being written in 2010, and of course requires OpenOffice to be installed, and potentially also requires a non-headless (i.e. requires a GUI system)
Thanks guys for any answers :}
One cheat that I've used in the past is to output HTML with a ".doc" file name.
This gives you less fine-grained control over the document formatting, but may be sufficient for your use case.
The closest I've ever managed is to generate an OpenOffice document and then use that to export as .docx (in headless mode).
You need some fonts installed, but no GUI for this. I use OpenOffice::OODoc, and it's enough to let me open up an existing document and add text/pictures.
The OpenOffice (LibreOffice) export process is not 100% reliable, but I've never been able to get a simple, repeatable test case to reproduce it - just hangs occasionally. I add a timer to kill the process and let it retry.
Not a perfect situation, I'm afraid and I hope someone has a better solution.

How do I use Mercurial?

I'm assuming Mercurial is for having an updated website and it archiving the old stuff? Easy to test things and such?
My question is, how exactly should I get started and can somebody give me a crash course in using Mercurial and using the following techs below:
Notepad++ for coding
FTP
PHP/MySQL
Jquery & other js libraries
I use windows and would like to keep things fairly simple. I'm developing 1 website currently and want some kind of CVS system in place. Or should I just stick to my current edit file in notepad++ and upload via ftp method and make a backup copy of everything every once and a while?
Any thoughts?
EDIT: I'm doing http://bugtracker.gttools.com/public/wiki/bluehost/Mercurial right now in order to try and 'install' it.
I'd definitely recommend taking a read through the excellent HGinit http://hginit.com/ site in addition to the official guide.
Definitely try and move across to using some form of version control (SVN, git or mercurial) as it'll save you down the line.
Mercurial is a distributed version control system, much like Git but allegedly slightly simpler.
A good tutorial by Joel Spolsky can be found here.
If you read up on https://www.mercurial-scm.org/guide under Basic Workflow you should be able to figure out how to work with it while editing files using Notepad++ etc.
From your question it sounds like you don't know much about version control (like you have a very basic grasp of what it is and why it is useful). So perhaps the first thing you should do is read up on that in general first of all.
But in terms of using Mercurial I don't think you will find a better insight into how to use it and why it is so good than Joel's tutorial, which you can find here hginit Tutorial
HGInit is a good tutorial for mercurial. Basically you have to hg init in the directory you want to be under version control. If you don't like the command line, you can also use gui tools, like tortoisehg.
If I'm not mistaken you also want to upload the latest version to the website. If I'm right ftp access won't be enough for this (unless you define a post-commit hook, that uploads the directory using ftp).
I'm assuming Mercurial is for having
an updated website and it archiving
the old stuff? Easy to test things and
such?
Not sure what you mean here. Mercurial (and all version control systems) lets you archive your changes as you make them, label and manage your releases so you can track code that goes together, and branch when you need to do parallel development.
You should be checking in your changes as you make them. If anything goes wrong during development, you can roll back to the last good version you had. It's a great way to make sure that you don't lose days and days of work because you forgot to check in.
Check in early, check in often.

Simple example of batch file and windows scheduler

I need to create a batch file which will copy web log files from a web server to a local desktop box on daily frequency.
I'm a web developer, but I'd like to take a stab at learning the process for creating a batch file and I think using the windows scheduler should get me where I need to go.
In any case, I'm just looking for a jumping off point.
I understand the premise behind a batch file (echo to print info, commands to cause actions such as mkdir or move, etc), but some straight forward tutorials would be great.
Or even a reference guide such as devguru.com or 4guysfromrolla.com would be helpful.
Thanks,
Creating a batch file is relatively straightforward.
Just type out the commands you want as you would in the command shell, and save the file with a .bat extension.
There's a simple example here that you may find useful. Note, you can use any editor to create your batch file, as long as it saves in a text format.
Depending on which version of Windows you're using, the process to create a scheduled task is slightly different:
Windows XP
Windows Vista
Edit: A little followup on misteraiden's answer.
Essentially, what you're looking for is scripting functionality. There are a variety of tools available. A batch file is the simplest form of scripting that Windows supports. You could, for example, write scripts in PowerShell or Python. Both are more powerful and flexible scripting languages. Depending on what the requirements are for your script, and what you feel like learning, they may be more appropriate.
However, If all you want to do is a copy, the simplest, easiest place to start is a batch file.
This is a little left-of-field, but using an XML build interpreter such as NAnt could come in handy here. Probably over-kill for what you are trying to do, but if you learn it now, you'll be able to apply it's uses in many different places.
You could use Windows Scheduler to trigger the build, which would then complete various operations such as deleting, copying, logging on to network shares.
However, perhaps to learn this you would probably need to learn more about the command line and command line programming.
Either way, I recommend you check out some of the NAnt examples that deal with copying and other basics etc..
I found one of the best references other than the Microsoft website that was mentioned in an earlier is: http://www.robvanderwoude.com/batchfiles.php I have been using this for many of the issues I have had and have been using it to learn more. I think since you have the premise of how batch files work, this will work out will for you.

Where can I find VBSQL.VBX?

I've been given the task of re-engineering a really old VB3 application. As part of this I have an XP virtual workstation upon which I've installed VB3 Pro, so I can create a running verison of it to help me emulate it, but the VB3 app uses a control called VBSQL.VBX, which didn't come with VB3 Pro, apparently. I've checked Microsoft's site, but there are only seven pages in the search result for VBSQL.VBX, and none of them offers an install.
Does anyone here have any idea where on earth I can obtain VBSQL.VBX?
Via http://support.microsoft.com/kb/111490, "Microsoft SQL Server Programmer's Toolkit for Visual Basic".
It looks like they offer the .ocx here: http://support.microsoft.com/kb/186893, possibly there is a VBX as well?
Whenever I run into an issue like this I usually end up creating a mock object with the same public members as the class in question. Sometimes it works out better as I can fake the data I want to pass around so I can run tests that would otherwise prove difficult.
If you can't find this file this is the approach I would recommend.