Merging Scripts in Linux - scripting

I'm new to Linux so let me ask you this dumb question. I just download this NLP (Natural Language Processing) script (from Standford). I also have this script that can stream tweets from tweeter in real time. Now both scripts are running, I'm running it from shell. Those NLP script is in Java and the Twitter one is in Python. I would like to have the my tweets (the ones i'm streaming live) running into my NLP in real time. How do I do this?

Related

Is it possible to write a Telegram bot using pure Javascript?

I would like to create a simple Telegram bot using JavaScript. But when I am trying to google it (since I'm not very good at working with APIs) I can find only solutions which are using Node.js.
So, that is the question. Is there any reasons why I can't use pure js for this purpose? If there aren't, are there any articles to read?
Thanks in advance
"Pure JS" has no mechanisms for input or output, so it can't make network requests. It depends on the host environment to provide such things.
Example host environments include webpages (running in web browsers), Node.js, and Adobe Photoshop.
Node.js is a common solution because it is designed to allow a wide range of software development to be done in JavaScript. This is why you see plenty of solutions using it.
(Web browsers, by contrast, are designed to let authors of webpages run programs on visitors' computers just because the visitor clicked a link to the webpage — as such there are major restrictions on what JavaScript programs in webpages are allowed to do. Likewise, Photoshop is designed to let people use JS to automate graphics manipulation, not perform general programming work.)

IBM Watson Text To Speech Bower_Components

I'm pulling my hair out and would welcome some input/advice. I can't get any of the code examples for Watson's Text to Speech service to work. Or example codes for Amazon Polly or Read Speaker for that matter...
Every time I try to track down the problem it seems to boil down to something along the lines of "you need to install such and such (Composer, curl, Bowser, Drush, etc.) via the command line". That's all well and good, except for the fact that I'm new to web development and my company is currently using a shared hosting platform for which I do not have command line access.
Is there any way to get a decent text to speech engine installed on a shared hosting platform, or do I just need to bite the bullet and make the switch to a VPS?
Depending on what your actually trying to do with any text to speech solution, you should at least be able to test from a command line locally and then deploy the solution in code to a shared environment.
Regarding IBM Watson's Text to Speech, there are no dependencies in and of itself. In the most basic form, you're just making a call to a REST API: https://www.ibm.com/watson/developercloud/text-to-speech/api/v1/#synthesize_audio
As an example, using curl from any command line, the following will return a wav file:
curl -X GET -u "{username}":"{password}"
--output hello_world.wav
"https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?
accept=audio/wav&text=Hello%20world&voice=en-US_AllisonVoice"
How you handle that file will depend on the programming language you use, but it still doesn't have any dependencies to get started with the examples.

For quick testing, portable Linux or portable programming language?

My current role requires me to setup environment which mimics the customer's and perform various checks to replicate and then analyze the problem.
Chances are, I often find working with Windows environments such like XP, Server 2003, Server 2008 is a bit painful without having the handly linux-based shell and some command-line progamming languages such as Perl.
Of course I can just install everything onto the new system and then start working, but it is a bit time-consuming and boring.
So I am wondering which is a better way of working around this?
I can for sure use Qemu to create a portable linux image which doesn't require any host system interference, even without the need of rebooting so to use it. The weakness of this is I have to figure out a way to transfer the files between hosting Windows and embedded Linux. The good part is that I can use all the weapons in Linux's arsenal.
Or I can start looking for a proper portable progamming language such like Movable Python, some variant of Perl or even Lua as a embedded language. Pros: familiar with the language; Cons: have to use scripts to do everything.
My day-to-day activities envolves but not limit to :
Checking the text logs and/or xml.
Grepping important sections from logs for further analysis.
some automate process like application server configuration etc...
automated functional testing - and result comparison
some system admin's job, networking diagnostics, checking process and services, etc...
Any good ideas? Thanks a lot in advance!
While I am a die-hard Linux fan I would recommend in your case to look at Cygwin, preferably on a USB drive or similar. It can live in a single directory, be started with a simple script and end up with (almost) all the Unix goodness, but still being able to access all of the host platform resources.
There are the usual warts related to / vs \ and even worse the case insensitive but case preserving filenames with lot's of spaces in them, but that's equally obnoxious on any other command line.
There is also Mingw but it's scope is more limited I found. It works exceedingly well in a couple of selected target areas, but less so for a GP wide unix-like environment.
I have had a cygwin folder on all my windows machines (and the ones I had to use/repair/maintain) for a very long time now.

CGI automation question

I am a career .NET developer, but have recently been delving into the LAMP universe.
I have an Joomla/VirtueMart ecommerce site near ready to launch. The vendor's xml datafeed must undergo transformation before it can be imported into the products database.
I wrote a .NET console app that can easily perform the transform and upload to the site. I am convinced there is a better way.
So I have been looking at cgi scripts. Just from what I have read it seems the only way to execute a cgi script is through an http request. Is there a way to schedule a cgi-script to run at a specific time?
Also, which language works best for transforming xml? C, Perl, or Python?
CGI is basically just an interface defined to execute arbitrary programs on a server by way of a HTTP request, nothing more and nothing less.
How you can execute a program on a server at a specific time depends on the server; both Windows and Linux-based systems usually have a scheduler service. In Linux land it's called cron, and a scheduled job is called a cronjob. If there is no other mechanism provided by whoever hosts your application, you can define jobs using the crontab utility on the server (you'll need shell access for that); its documentation includes (somewhat inaccessible, but there you go) information about what a crontab should look like. There are tons of tutorials on the web, too.
an XSLT transformation is probably your best bet for turning XML files into things you can easily import. An XSLT transform can be processed in any language of your choice.

Most effective and realistic free web-app load tester?

I'm in the middle of picking tools to load test my Ruby on Rails app. So far I'm trying out -
apachebench
autobench
httperf
selenium
trample
Is there anything else worth looking at? I don't have a ton of hardware, so efficiency is a concern.
The famous one (at least for me):
JMeter
The Grinder
OpenSTA
All support simulating concurrent users, can generate decent load, support distributed testing if required (with distributed agent). JMeter and OpenSTA have a recorder and recorded scripts are relatively easy to variablelize. For The Grinder, I'm not sure.
OpenSTA is the most polished one and with the most features (but is not portable).
JMeter is my preferred one mostly because I know it well and because testing can be easily automated (e.g. to be included in a build). Have a look at the user manual to get started. If you need to record over SSL, check BadBoy.
More interesting reading at Shootout: Load Runner vs The Grinder vs Apache JMeter.
Check out JMeter.