How to issue commands in Luasocket FTP - lua

Good afternoon,
i'm currently writing on a Lua-script to upload a JCL to an IBM Mainframe (z/OS) via FTP.
Before uploading my JCL, i first have to issue the command site filetype=jes to connect to JESPLEX.
I'd greatly appreciate it if anyone could tell me how to execute commands via Luasocket FTP.
Thank you for your help!
Steffen

There is command command that I don't see documented, but it takes the same parameters as get and put commands. Given the examples in the package, something like this should work:
ftp.command({
url = "ftp://luasocket:wrong#".. host,
command = "site",
argument = "filetype=jes",
})

Related

Github-Linguist, Ruby version run over multiple repositories?

I am trying to run the github linguist ruby verision, It runs on my computer, I am using visual studio. If i run the github-linguist it does give me the stats of percentage and type of language my repository have that is on local system. ( using terminal commands )
OutPut running Linguist using terminal visual code
Goal: To write a scripts in ruby that takes provided repository and provide me with the stats (similar to above screenshot) as described by github-linguist functionality.
Based on some research so far, all i have is following code.
require 'rugged'
require 'linguist'
target=""
repo = Rugged::Repository.new('https://github.com/NameOfRepo')
project=Linguist::Repository.new(repo,repo.head.target)
project.language
project.languages
But having error, and I need a guidance related to the error and a better way to reach my goal.
Error: Error from script, Visual Code
I am new to ruby and I would like for some help ?
I am aware of how to change my path to local clone repository path in above code. I am looking for help with writing scripts that traverse through online github repository and provide me the stats.
You need to pass the path to a directory to Rugged::Repository.new(), not a URL:
repo = Rugged::Repository.new('/home/ShaishavMaisuria/NameOfRepo')
FYI, the source code for the github-linguist executable is at https://github.com/github/linguist/blob/master/bin/github-linguist.

Can we call roslaunch or rosrun through a web page?

I have a question that can we call or run files of our package inside ros through a webpage. In other word, can we perform rosrun or roslaunch from an html page?
One way to do what you want is to integrate a shell to a website. There are some projects dealing with such use cases. A greate solution is shellinabox. It is open source, easy to use and install. With the shell integrated to a website you are able to perform all shell commands you need to control ROS.
You can find a nice tutorial how to install and use shellinabox at Tecmint.

Connecting to an Oracle database with ROracle on shiny-server

We recently were able to get a small redhat server to experiment with shiny-server. Our IT department got shiny-server running and installed the Oracle client but I can't get ROracle to work in shiny-server. They (IT) have decided that it is an application issue and are starting to give up...
Initially ROracle didn't work on the server at all but we got it working from my user account by setting the LD_LIBRARY_PATH in my .bashrc file. With that done I can log into the server, and query the database from R. I can even use runApp() to run my shiny app from R.
When I try to access that same app through shiny-server I get the following error:
Listening on port 40679
Loading required package: DBI
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/usr/lib64/R/library/ROracle/libs/ROracle.so':
libclntsh.so.11.1: cannot open shared object file: No such file or directory
Error : package or namespace load failed for 'ROracle'
Error : package or namespace load failed for 'ROracle'
which is the same error I was getting on my account before I set the LD_LIBRARY_PATH variable. The server is running as user shiny but apparently won't run any startup scripts so what fixed it for my user won't fix it for the shiny user. This is all very far outside my area of knowledge and as I said, our IT department says they are out of ideas.
I don't have sudo access to the server so the things I can try are limited. I tried setting the LD_LIBRARY_PATH from my server.R script before loading ROracle with Sys.setenv() and by using system() but those didn't work. Our DBA that has been trying to help me tried setting the LD_LIBRARY_PATH in /etc/init/shiny-server.conf but that doesn't seem to work either.
I am really hoping that someone here has some ideas.
Thanks
After a couple of frustrating days I found the solution. You need to set the LD_LIBRARY_PATH variable in the upstart script located at /etc/init/shiny-server.conf, but per the upstart documentation, you need to define it with the env keyword. So adding:
env LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH
to beginning of the shiny-server.conf script seems to have fixed the problem.
Here's my blog post (about a year old) with a detailed description on how to get R Studio Server going with Oracle. LD_LIBRARY_PATH, OCI Lib and all the stuff is provided. Maybe this helps someone else: http://learnfrominfo.tumblr.com/post/38382388429/connect-r-studio-server-to-an-oracle-database-with
I had the same problem with PHP and Apache.
Please refer to the Setting the Oracle Environment in the PHP documentation.
Also, see comment - which syntax did you use in /etc/init/shiny-server.conf?
SERVER.R
library
library(RMySQL)
library(caTools)
library(rpart)
library(RJDBC)
shinyServer(
function(input ,output)
{
dvr =JDBC("oracle.jdbc.OracleDriver",classPath="D:/ojdbc6.jar")
url = ""
user = ""
password = ""
jd =dbConnect(dvr,url, user, password)
a1 <- eventReactive(input$predict,
{
a<-input$ref
table2<-data.frame(dbGetQuery(jd,paste0("
select colnames from Tablename where REFNO=",a," and ROWNUM<15
")))
print(table2)
print(bs<-table2)
}
)
output$dis<-renderTable({
a1()
})
}
)

How to install/implement Hudson on rails 3 application

I have a ROR 3 application.i need to install and run hudson for continiuos integration testing.i am a bit confused with available resources from Internet...I need Help
first ..
Download hudson from [war file for hudson][1]
Mount war file in VMware(if you are using LInux on windows) OR From
the terminal hit this command java -jar hudson-2.2.1.war
third and last step .. Connect to localhost by
http://localhost:8080...and see Hudson running . Moreover you can
change the configuration setting .This link will help you http://injecting.by2.be/blog/2010/11/hudson_for_a_rails3_project.html by Ivo Dancet
...hope it helps.
I do CI with Jenkins, which is a fork of Hudson. You might try something like this guide - it covers the process from top to bottom.
There are also gems like lobot which can automate much of the process for you, if you're going to use AWS.

Ruby - ExecJS not loading (I have the proper materials and PATH location.) [Windows]

I am having a problem with the ExecJS in that it is unable to locate a required Runtime. I am using Windows, and I have both Windows CScript and Node.js installed on my computer, but neither of these guys are being invoked.
As a result, I am unable to run any rails task that involves this (I cannot even load my rake list in RubyMine to call actions such as db:create to create my databases from a fresh project.)
I am capable of accessing both csript and node from the command line, and I have checked my environment variables and their proper file locations are in the PATH. There's something else ruining my ability to use ExecJS. Has anyone else had a similar experience where you have had all of the right stuff, but something is still going wrong?
When Ruby spawns child process to invoke CScript or Node, it will use the same rules that allow cmd.exe execute them from the command line.
But, sometimes, stuff in your registry or your environment variables can affect this process.
At RubyInstaller project we collected a series of troubleshooting items that could possible be the culprit.
Please check that COMSPEC environment variable is set to use cmd.exe and nothing like TCC/LE or other stuff.
C:\>SET COMSPEC
Also, check that your registry do not contain an AutoRun key, which will also affect Ruby.
C:\>REG QUERY "HKCU\Software\Microsoft\Command Processor"
C:\>REG QUERY "HKLM\Software\Microsoft\Command Processor"
If you see a key AutoRun in one of the above commands, that means something is setup to automatically execute everytime a new cmd.exe is started, which is bad for some cases.
Please follow the instructions in the Troubleshooting page on how to remove it.
This also affects gem installation that requires compilation, but if is not failing for you then the problem might be something else.
Hope that helps.
I was having similar problems, my basic skeleton app wouldn't run despite having Node.js installed, and then trying therubyracer gem. Finally I decided to use my troubleshooting mantra with windows, "When in doubt, run as admin". So I ran my rails cmd as an admin and it worked fine after that.

Resources