cli

Capturing stdout in real time in rails

I'm firing off cap tasks and other command line scripts from a function but I'm wondering what the best way for me to display real time logs for it. ...

PHP - Blocking File Read

I have a file that is getting added to remotely (file.txt). From SSH, I can call tail -f file.txt which will display the updated contents of the file. I'd like to be able to do a blocking call to this file that will return the last appended line. A pooling loop simply isn't an option. Here's what I'd like: $cmd = "tail -f file.txt"; $st...

How to do a multi-level CLI in Python?

Hi I'm trying to do a CLI, preferrably written in Python. I need a multi-level CLI, and I want tab completion. I looked at the cmd module (from the Python standard library) and readline with the "complete" function (for tab completion). They both lacked at something, i.e. I haven't figured out how to handle multiple levels such as: l...

How to implement a built in compiler in Java/Swing?

I'm writing a text/code editing program for my own use in Java/Swing, and was wondering how I would go about setting up a built-in C compiler inside it. I would likely use GCC or TCC as the compiler. Anyway, my question is- how would I actually implement the compiler? Would I use a library that gives Java access to command line commands?...

How to compile Box2D for C# with SWIG?

I'm trying to compile Box2D for use in C# with SWIG. I've created this Box2D.i file, %module Box2D %{ #include "Box2D/Box2D.h" %} %include "Box2D/Box2D.h" Which I placed one level up from the Box2D.h file file, and "compiled" it with, swig.exe -csharp -c++ -includeall -ignoremissing -outdir SWIG Box2d.i This gives me all the .cs ...

Does McAfee Total Protection Service have a CLI?

Hello all, I have searched everywhere on the web and didn't find an answer. Anybody knows if McAfee Total Protection Service AV has a command line interface, for running the AV from the command line? I've looked here: http://www.mcafee.com/us/enterprise/products/hosted_security/total_protection_service.html and in additional McAfee do...

"unable to load dynamic library" Errors when running PHP from command line

When I try to run my script I at first I put the shebang in the script at the top and then tried this: php -f /home/phil/www/disable_script.php But I'm immediately greeted by this: PHP Warning: Unknown(): Unable to load dynamic library '/usr/lib/php4/zlib.so' - /usr/lib/php4/zlib.so: cannot open shared object file: No such file or d...

mysql connection from daemon written in php

i have written a daemon to fetch some stuff from mysql and make some curl requests based on the info from mysql. since i'm fluent in php i've written this daemon in php using System_Daemon from pear. this works fine but i'm curious about the best approach for connecting to mysql. feels weird to create a new mysql connection every coupl...