Has anyone tried automating build and deployment pocess through SOMA scripts? - deployment

I have tried automating this process through SOMA: copying the file from one location to another location using dp:get-file in our local directory and their I've to change the file permissions and then unzip the file and save the folder in another location but didn't achieve.
If anyone tried please help on this scenario.
Thanks in advance !

I don't exactly follow all your steps, can you detail them a bit more indicating what you do on DP and what on remote system?
The key to know is that SOMA dp:get-file returns your file as a base64 encoded XML element value and you have to base64 decode that to have your actual file and then work with it on your remote system.
The other way round to put the file back using SOMA you have to base64 encode it and then sent as SOMA XML element value to DP.
I don't think DP cares of any file permission attributes? Or do you have something specific in mind?
You indicate you unzip your file. Are you playing around with ZIP-format DP config export? That would not be ideal approach. Or what is your usecase?

Related

Prof configuration (INCA tools)

I use the INCA tools for the first time. I would like to cset a prof config to flash binary file to my ECU. I tried to create the needed files. I have some question please.
1/ to convert the hex file into binary file i copied this from tuto
procedure convert
{
[convert_bin]
RUN_DLL ("CONVERT.DLL",convert,-h,-i,-q,-b,%1)
case TRUE : $return TRUE
default : $return FALSE
[convert_bin_END]
}
I would like to know what is the CONVERT.dll file, will it get generated automatically or should I create this file ?
2/ Can I flash directly a binary file to my ECU ?
3/ who can correct my script I have several problems on ?
thanks a lot :)
1/ to convert the hex file into binary file i copied this from tuto
I would like to know what is the CONVERT.dll file, will it get generated >automatically or should I create this file ?
CONVERT.dll is preset dll from INCA, no need to create this file, it's already available
2/ Can I flash directly a binary file to my ECU ?
yes, you can flash directly a binary file to your ECU
3/ who can correct my script I have several problems on ? thanks a lot :)
it need a lot of input and information from your hex file also

Photorec custom signature

Recently I have lost my database files after server (Qnap) reboot.
I need to recover the MYD files.
I'm using the Photorec to recover my files which uses file signatures.
I know that MYD files doesn't have common file signature.
I've recreated the database from the earlier backup (on local machine) just to check if the signature changes when new data inserted and it seams like the signature bit is not changing.
I'm not sure if that means I have the signature of the file that I'm looking for.
I've tried to create a photorec.sig file and entered MYD 0 0x00010065fe00000100003101aa70010f00 which are the first 34 chars of the hexdump result.
I've saved this file into the current working directory and ~/.photorec.sig and tried to recognize the MYD file with fidentify_static which always returns unknown.
I think there is something wrong with the signature file that I've created. Can anyone tell me how to make sure that the signature file is created correctly and placed to the right place on qnap?
Run fidentify with the file/directory as the parameter:
[kmaster#adsl ~]$ fidentify /home/kmaster/src/testfiles/sample.pfi
See http://www.cgsecurity.org/wiki/Add_your_own_extension_to_PhotoRec

Extracting file names from an online data server in Matlab

I am trying to write a script that will allow me to download numerous (1000s) of data files from a data server (e.g, http://hydro1.sci.gsfc.nasa.gov/thredds/catalog/GLDAS_NOAH10SUBP_3H/2011/345/). Unfortunately, the names of the files in each directory are not formatted in a similar way (the time that they were created were appended to the end of the file name). I need to be able to specify the file name to subset the data (I have a special tool for these data types) and download it. I cannot find a function in matlab that will extract the file names.
I have looked at URLREAD, but it downloads everything including html code.
Thanks for your help!
You can easily parse the link.
x=urlread(url)
links=regexp(x,'<a href=''([^>]+)''>','tokens')
Reads every link, you have to filter all unwanted links.
For example this gets all grb files:
a=regexp(x,'<a href=''([^>]+.grb)''>','tokens')

Pipe multiple files into a zip file

I have several files in a GridFS Document Store and what I'd like to do is to pipe this data into a zip file via stdin in NodeJS. So that I will end up with a zip file containing all these files.
Now my question is how can I give the files a valid filename inside of the zip file. I think I need to emulate/fake a file header containing the filename?
Any help is appreciated!
Thanks
I had problems when writing zip files with Node.js not long ago. I ended up doing something similar to what is described in Zip archives in node.js
I can't help you directly with your problem, but at least I hope I can point out some things:
Don't try to use node-archive. Even if the description says it allows to create zip files, the moment I read the source code (since documentation is unexistant) I realized that's just a lie. It only exposes methods for reading.
Using zip by spawning a process, like recommended on the provided link, seems to be the best way. Something that would work is copying the files to a local folder with whatever name you desire and then calling the zip command, just to delete the files afterwards.
The other option, which seems ok, is to use zipper (https://github.com/rubenv/zipper, although better just use npm). The reason I'm not really wishing to use it is because there's not that much flexibility, it seems to have been done in a day and it hasn't been modified since the first commit, so I'm not sure it will receive maintenance (sure, you could just fork it...).
I swear the day I have an entire free weekend with no work I will write a freaking module that does this as complete as possible. It's silly that there isn't and it shouldn't be that much struggle. blablablarant.
Edit:
Not sure if it was there before, but now I've been using the node-compress module (also using gzippo). It works fine.

Check if downloaded file is corrupted and delete if corrupted from iPhone

Problem:
I have to download some files from the server. In between the connection with the server is lost. And when the file is opened it opened without any problem, except that it was blank.
Question
How to check if the downloaded file from the server is corrupted or not? Is there any way to do that?
If the file is corrupted it must be deleted from the documents folder.
Thank you!
You can create a hash of the file and then use that hash to compare the current hash to the new hash.
Here's an example on creating a hash for iOS:
http://iosdevelopertips.com/core-services/create-md5-hash-from-nsstring-nsdata-or-file.html
It should work pretty well because the hash only changes if the file contents change and is unaffected by creation times, modification times, and the file name.
Edit
You can also sign your files with PGP or GPG and use your public key to verify its contents.
Hope this helps :)
Send a hash of the file with the file, and then compare the hashes.