How to build a custom terminal in linux? - linux

I want to build a custom linux terminal that would deal with api's of certain websites directly from the terminal . Yes I know , Curl can do that too . But lets say the content of the website are now in your computer and the website is offline . Thus using this terminal I would like to access those contents and make changes to them .
Again this also can be done using the linux terminal , but I would like this terminal to be very specific and have its own syntax and semantics .
For example , the ruby terminal from which you can run various ruby code without actually compiling them .
Thus what books should I read and how should I go about it in building this ?

Making changes on a site (like this site) not only involves some HTML content, but also a lot of code that runs on web server side. This is what you can't replicate with curl and possibly with any reasonably small amount of work at all.
'Terminal' is probably a wrong word; it seems that you just want a command-line app, as opposed to a GUI or Web app.
Please try to describe a more specific scenario. Your question is currently too vague.

I liked "Kernel projects for Linux" by Gary Nutt. It will help you in learning the design of a shell, and how the shell interacts with the operating system.

Maybe to configure web server to respond to local HTTP queries and use console based web browser like elinks or lynx

Related

Connect to windows server from node js

I'm not very experienced in programming and have a problem that I'm finding hard do solve.
I have a web app that is on a ubuntu server, that is running on node js. That web app creates an excel file on the back-end that is to be read by another excel file and execute a vba that gives as results in a software that only runs on windows.
I tried the software on a windows server and it seems to run, so no problems there.
My question is: how do I make my web app excel file be stored in the windows server and how do I call the files on that server to run from node js?
Can anyone please share some resources on where I can explore this subject please?
Thanks in advance,
Ana
The following is what I advised the OP to do in the comments, only longer and with more explanation.
First, install NodeJS on your Windows server. You can do it by either installing it from the official Downloads page from NodeJS, or use a version manager such as nvm, with a Microsoft tutorial on how to do it that way. This step is up to you.
Host your back-end part (the one that creates the excel part) on the Windows server. That way, the file will be stored in the same filesystem the "software that runs only on Windows" is on.
The problem now is determining if there is any way to run the "software" via command line. Since I don't know the software name, I can't look that up but if it can, you'll have to check child processes via NodeJS.
Now, if this software has no way to be run via command line, and if they didn't publish any sort of programming interface (what is called API in the real definition of the term), chances are that you will not be able to achieve what you want to.
If you want me to clarify or explain more on some points, please let me know in the comments so I can edit my answer.

How do I use NodeJS on Asustor AS-302T NAS

I have recently bought a Asustor AS-302T NAS, which is an absolutely brilliant solution for the home. One of it's most impressive features is that you can install apps which extends the ordinary behavior of a NAS. And if you are a developer you can also create your own apps.
While apps are fun, I have more interest in using my NAS as a kitchen-sink for my personal nodejs projects. In short I want to run nodejs application that I can then call from various other machines around the house. My own mini-cloud for IOT experiments.
Installing, one click only
Having installed NodeJS through App-Central I am at a loss how exactly to start using NodeJS on my NAS. The whole installation is essentially an on/off switch with no options or visible settings at all. I can find no documentation on practical tasks like uploading a nodejs application, deal with access rights or even execute it.
Under Windows or OS-X I would use npm via the command-line or shell, but Asustor is a purely html based interface (with the exception of XBMC through HDMI).
Why offer to users the option of installing NodeJS -if it's impossible to actually use it?
So my question has three aspects to it:
How do i get access to npm on my Asustor NAS
How do i get my NodeJS application running
Is it possible to run my application as a service (executed when the NAS boots)?
From the ASUSTOR Developer's Guide: apps are installed into
/usr/local/AppCentral/$APP_NAME.
NodeJS executables will be at path /usr/local/AppCentral/nodejs/bin/node and /usr/local/AppCentral/nodejs/bin/npm.
You can login to NAS via SSH and add them to PATH variable, or create symlinks...
I'm also searching for solution how to run them as a service (daemon), maybe an /etc/init.d script might help.

linux or windows terminal over the web

I'm planing to make a web app which will allow you to have a Linux Terminal on a web page so that you can execute any command an get the response as if you were in front of your linux terminal.
I planed to use NodeJS as it is server side JavaScript, asynchronous and fast.
Also I saw this wich does exactly what i'm trying to do, I peeked in the source code, but didn't found something useful, I also analysed it with google chrome developer tools on the network tab, but there is absolutely nothing even while executing some commands and getting responses. How is this possible ? what technology do you think they used ?
So I wanted to get your advice, your experience in order to start it the right way.
I firstly decided to use NodeJS, but if there is another programming language or Framework more appropriate for this kind of application please let me know.
If you want a real terminal in the browser using node.js on the backend, you might give tty.js a try.
Alternatively you can use the pty.js module manually which is used by tty.js. Along with that, you could also use xterm for doing the browser-side terminal emulation.

Code development (specifically text editor) while using a netbook

I have been using a chrome book for a few months now. I also have been designing a web page. A lot of the work can be done via word press's lame gui, but like any coder, I want to use a real text editor, specifically vi/vim.
I have done some searching around. I found one java script implementation of vi, but it's not good enough IMO to use. Conversely, I'd like to ssh into one of my *nix boxes and use vi that way, although you cannot do that from web pages it seems. HTTP vs TCP issues. Not sure if WebSockets will be able to get around this.
Lastly, I've been looking at plugins. While some decent ones seem to be available for Firefox, the Chrome division is lacking severely.
One desparate try is vnc, but this chromebook has no javascrip support, not can I get the HTML5 vnc running quite right.
Does anyone have any suggestions?
Edit/Update:
Thanks for everyone's effort in answering. I quickly abandoned coding on the netbook, but it looks like some great answers were provided.
I am on a Samsung ARM Chromebook and I do a lot of development work in Vim. Here's how I prefer to do it:
Enable Developer Mode, then download crouton.
Open a shell:
<ctrl><alt>t
...and install Ubuntu command-line environment
sudo sh -e crouton -t cli-extra
Enter the chroot using
sudo enter-chroot
From inside the chroot install vim
sudo apt-get install vim
There are lots more instructions and examples on the crouton github page.
I prefer the command line only version because I can just have Ubuntu in another tab, and all the Chromebook keyboard shortcuts Just Work.
You have few options:
Cloud9, an IDE for JavaScript, Python, PHP, and Ruby. Cloud9 uses the HTML5 FileSystem capability and AppCache to sync files, so you can even code offline. It got some really nice features that I find myself using a lot: github integration, chat, the ability to work and do reviews on your code without any pain of ‘new/other’ tools.
Kodingen is an Online Development Environment including Code Editor, Cloud Hosting etc'. I haven’t play with it (yet) – but I’ve heard some friends that like it.
Codey - Easy to use code editor for HTML, PHP, CSS, JS. They are in Chrome web store.
Akshell - Server-side JavaScript development and hosting platform. They got some git integration built in their IDE.
I hope it helps.
For more, I've posted something about this Q few months ago: http://greenido.wordpress.com/2011/07/04/web-developers-and-the-new-chromebook/
There are web shells: this is the first one that came up with a search, but there are others. Be sure to use HTTPS and place it behind a authentication gateway. I can't vouch for how well they handle vim and it's interesting screen modes, but hopefully one of them might work.
How about SourceKit? Unforunately the bindings are closer to textmate, it has great highlighting and IMHO the text will be easier on the eyes than if you were looking at tiny shell font.

BlackBerry Code Signing on Linux without GUI

After a lot of searching I have yet to find a way to sign a BlackBerry application on a Linux distribution with no GUI.
As of right now I'm getting the error "Unable to request signatures until this application has completed the initial key generation.". The problem is I'm not able to register the CSI files it seems via CLI. Has anyone accomplished this without setting up X11?
Yes, its definitely possible to do this on a headless Linux box. Heck, I do it on a headless Solaris/UltraSPARC server :-)
For actually running the tool, I like http://bb-ant-tools.sf.net/ . If you are using an older version of the signature tool, you may need to make some modifications as described on http://slashdev.ca/ .
While the tool is fully controllable from command-line parameters, it does unfortunately still require access to a running X server to function. The workaround for this is to install "Xvfb" (a fake X server for purposes like this), launch it in the background on your system, then set the DISPLAY variable so the signature tool will use it for its non-interactive GUI.
Blackberry sigtool may not be supported in Linux and it may be only partially working. BB dev tools are still Windows-centric.

Resources