I am designing a python script which stores some configurations in a file when it is first run. I want to make it so that the procedure will almost be same on Ubuntu and windows alike. I noticed Ubuntu has something like ./config file where I can store configurations however I believe there is nothing like that on windows. Whats the best place to store such information such that the path will almost be the same in both os?
Thanks in advance.
Related
I'm hoping someone can give me some advise for taking models built in h2o flow on a windows machine and exporting/using them on an AIX server.
I've been able to use the flow graphical interface to build some models. I'm not a java coder / programmer so have some trouble understanding the instructions on the pojo/mojo files in the documentation and really looking for some step-by-step help on using them.
I have h2o running on a windows desktop machine. The place I want to use it is within SAS programs running on an AIX server. The AIX server has java.
I'm assuming I can do something like:
build model in h2o on my windows desktop
download the pojo or mojo files
do something????
put resulting file(s) from step 3 on the AIX server
use SAS to write out a CSV file in the same format I used to build the model in h2o
use SAS to issue unix command line statements that feed the .csv file into the exported files from step 3 using java and generate a new output .csv file with scored records
read the scores back into my SAS program and continue on my way
Is this do-able?
If not, can someone give me a "for dummies" explanation of how I might do something similar? I don't have admin rights on the AIX server so can't install software.
Thanks for your help.
AIX is big endian and windows (intel) is little endian. So as far as I know the H2O model generated on windows will not directly work on AIX, I think there is some work needed in H2O to make that work. But you can host that model on a PowerVM linux box next to AIX on same power system if that helps. Because you can have a little endian Linux.
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Power%20Systems/page/H2O%20Driverless%20AI%20for%20Data%20on%20IBM%20AIX
I'm trying to create a file on shared location and write the string which is being passed to it. All this I'm doing as shown below,
String user = "abcd:XXXXX";
NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(user);
String path = "smb://smb/ds/TESTING_GOING_ON/test.txt";
SmbFile sFile = new SmbFile(path,auth);
try (SmbFileOutputStream sfos = new SmbFileOutputStream(sFile)) {
sfos.write(str.getBytes());
sfos.close();
}
Its working fine, this I'm trying to do from Windows to shared drive(which os I dont know.)
I'm trying to understand how does smb works, that's why I read the document what is SMB.
But I'm not able to map here if above code is running fine then,
which is SMBclient(Is this my windows machine as stated in the document "Microsoft Windows for Workgroups 3.x")
What is acting as SMB server?
Not able to get clear idea about it.
Any help would be really appreciated. Thank you.
I'm trying to get deep into this because, the above code works fine for local windows 7 machine but not working on cloud environment which is linux.
Also, If there is network access that needs to be provided from cloud environment then, what all information do I need to have before going to network department for access. for eg. which port the connection open etc. and I don't know what other information I will need to make it happen
Could you give some more information please?
Assuming your program is written Java, how do you execute it on Windows and how is it ran in Linux?
Which Linux distribution is running on your linux box?
What happens on your linux box when the program is not working as expected?
As Java code should be cross platform, it might be usefull to check if you have the right java runtime installed on your linux box.
Which java related packages are installed?
The document you are using to read up on Samba was last updated in 2002, it might be usefull to check for some more recent documentation, eg. samba wiki
I am needed to move entire directories from one computer in the network to the other (In a platform independent way). Basically I am working on some automation tool to help the developers do Build Verification Tests, for this; I am directed to automate the installation and un-installation of the product on multiple platforms. So, I will need to first copy the files!
And this is where I needed some help in both conceptual and practical knowledge.
Firstly, let me mention that using something like FileZilla or WinSCP is out of the question since I need things to happen automatically and not through button clicks. But please let me know if these tools have any command line utilities!
I tried Perl's NET::FTP, and while it looked promising, I was wondering whether it was the best way to go. Also, I want to know what are the pre-requisites before I can run FTP, I mean would I need perl installed on the other end as well ? I constantly read that the commands from perl's FTP actually try to connect to a FTP host, does this mean its not going to work if I haven't configured the remote host in some way? And if I am right, then what is this extra piece of configuration to be done?
Apart from this, is there any other way I could solve my problem ? I mean I am looking for API's here that would help me do platform independent file transfers. But once again, I cannot use tools that would need button clicks and stuff, because I am doing automation and everything needs be dome programmatic-ally and automatically.
Also, I think this is a very generic problem-statement: "Moving files across a computers connected by LAN"; So, it would be wonderful if we can have a list of (possibly) many options (ways to solve the problem) in the form of answers to this post.
Thanks in advance for any help that you wish to provide.
If nearly all of the files in your directory have changed, creating an archive, sending it over the network, and unarchiving makes sense. Actually, if your LAN is fast enough, though, it may be faster not to compress the archive--just use tar.
If only some of the files have changed, rsync, a command line tool, will only download the changes. It can be used with ssh like this:
rsync -ae ssh username#hostname:/path/to/files /store/here/locally
http://www.thegeekstuff.com/2010/09/rsync-command-examples/
On Linux and OS X, cron and crontab allow you to schedule scripts to run periodically. Windows provides the Windows Task Scheduler.
FTP is fine if you don't care about encryption over your LAN. Otherwise, SSH would be preferable.
rsync is available on OS X and Linux, but I think you can use it on Windows through Cygwin.
I suggest making an archive (e.g. a .tar.gz file) on the source host, transferring it with scp, and unarchive it on the target host.
You could also use unison or rsync
I would suggest you to develop your own FTP client in .NET. This way you will have complete control over the application, and instead of button-clicks you can schedule it using windows-scheduler. Here is an article about how to create your own FTP client in VB.NET:
http://dot-net-talk.blogspot.com/2008/12/how-to-create-ftp-client-in-vbnet.html
If I want to create a *nix symlink, I'll call symlink();, if i'm running a script on windows and I want to create a shortcut, I'd use Win32::Shortcut.
But what if I want to create a Windows shortcut if running a script from a *nix machine?
I'm accessing a SMB share on a Windows Server 2003 machine from my *nix machine.
Well, I don't know if Samba provides an API for that. On the other hand, Windows shortcuts are just .lnk files in a specific format.
It's been a long time since the initial question, but I've had the same issue and found a solution.
I wrote an application whose goal is to allow anyone to create lnk files from any OS.
I started writting it in bash and then I converted it in C (the sources are available).
It's still fresh, so except me nobody tested yet, but you can have a look here :
http://www.mamachine.org/mslink/index.en.html
I got a question of using Eclipse to develop for embedded Linux on a Windows host
Here are now I have and where I am.
1. a Windows host that have the latest Eclipse + CDT (c/c++ development tools) installed
2. a Ubuntu host (ssh + samba installed) that contains sources and toolschain to build the project. (the windows and ubuntu hosts are sitting within one network segment (In LAN).)
3. I can use the following commands to build this project under Ubuntu.
# chroot dummyroot
# cd /home/project/Build
# sh Build date +%Y%m%d%H%M%S
4. I am now trying to create an eclipse C++ project to achieve the goad of the step 3, but I have been stuck here for a while. any ideas of how it can be done?
Speaking from experience, attempting to develop embedded Linux on a Windows host is a world of pain and frustration. Emphasis on attempting -- I'd like to meet someone who completed a serious project in this way, or who can explain how working in Windows made job easier.
Windows can be a great development environment for many tasks, but it's a lousy, lousy environment for embedded Linux. There are tools out there to help you do this, but everything is much harder compared to working on a Linux host. The toolchains are older and buggier. You will constantly fight with your crosscompilers and GNU autotools trying to get packages to compile. (Wait till you try to compile one of the many packages that needs to build an intermediate binary and then executes that as part of its build process.)
You probably have reasons for keeping your desktop in Windows -- just run a Linux virtual machine.
Eclipse CDT can execute arbitrary commands, such as
ssh username#target build_script
using the external builder. If you are using gcc on the target eclipse cdt can parse the output of the gcc and make from the ssh session and send you to the correct source path (if that path matches the path generated by gcc). Although this might not work windows->linux
With Embedded Linux, I've attempted to run Virtual Machines using Ubunutu, Xubutunu, Debian. I have been developing for a long time. I design hardware and develop low level firmware, to test said hardware. I cannot get anything to work on instructions given, as in an unified IDE and development system such as I am used to (i.e. Codewarrior, MPLAB, Code Composer) If Embedded Linux is so useful and easy how is it I cannot get a single one of instructions from Yocto, Freescale, Timesys, anywhere to work? Every-time there is a directory change, or a directory that no longer exists, or even a file that is not there. Surely there something that I can use..