UNIX crypt command via SM69

Hello,
I'm trying to execute the CRYPT command from SM69.
From cmd line the following works
crypt TEST <FILE1.txt >FILE2.txt
Anyone get this to work?

@tschodt
Well, you failed to mention that...I spend at least 5hours about writing an efficient Java code for big text file.
Within this time I read 50 to 100 forum threads from other people who had the same problem.
All these pages I had found via google. Do you want me to write everything, all actions I did? :-) I don't think so.
Is everyone else happy to use Runtime.exec() to invoke "sed"? How should I know that? :-) I am not a java expert.
The idea of forums generally is, to share knowledge with other people.
Well, after you said that, I will use Runtime.exec() and invoke sed and read the results.
If you think you really need a full Java implementation of sed and
you have not been able to locate one, you could always write one yourself...I don't need a full Java implementation of sed, not really.
But just because I didn't find it, does not mean for me, that this code is no where exists.
First I try to write the code by myself, second, I try to find it on internet by searching in google.
If I still have no solution, I write my problem here at sun-java-forum (sometimes also somewhere else :-) )
It seems to me you are angry, no need to be ...

Similar Messages

  • Is SHA-1 example shown on this web site better than UNIX crypt()

    Hi,
    For a project I am working on I have to store passwords in a database. I want to store this passwords encrypted and my first thought was to write/use an emulation of the UNIX() crypt function e.g. UnixCrypt. However I am concerned that UNIX passwords are easy to brute force unless you have a very strict password policy....
    However I saw an example on this website in response to a similar question and it was suggested they use SHA-1 to generate a one-way hash and Base64 to encode the result before storing in the database. If I force people to choose passwords longer than the traditional 8 chars allowed by UNIX and use SHA-1 to generate the hash will it be harder to discover the passwords using brute force that it is for the standard UNIX passwords ?
    regards,
    Jeff.

    Only if the passwords chosen are secure. If someone chooses the word 'password', it won't matter which hashing algorithm is used (and Base64 is an encoding scheme, which doesn't add any security). Regardless of how passwords are encrypted, they should always be protected as if they are plaintext. A very strict password policy, along with regular attempts to crack your own password databases would also be wise.
    More simply, SHA-1 is considered to be a far more secure hashing algorithm than crypt(), and because Java has built in support for SHA-1 via the java.security.MessageDigest class you'll also save yourself some work.
    Good luck,
    -Derek

  • UNIX sed commands to clean up data before loading into BI

    Hi all,
    we are trying to load the data into BI from text files.. This data needs to be cleaned before it can be loaded into BI and this has to be done using UNIX sed commands!!
    We basically need to do a data cleansing act, like removing unwanted characters (tab values and newline values as part of the characteristic values). How can it be done using unix sed commands??
    your help is very much appreciated.
    Regards

    Hi all,
    we are trying to load the data into BI from text files.. This data needs to be cleaned before it can be loaded into BI and this has to be done using UNIX sed commands!!
    We basically need to do a data cleansing act, like removing unwanted characters (tab values and newline values as part of the characteristic values). How can it be done using unix sed commands??
    your help is very much appreciated.
    Regards

  • Problem with issuing command via CustomScriptExtension

    I am trying to issue a CustomScriptExtension command to an Azure virtual machine from within my C# application. The CustomScriptExtension is installed in the VM and working. I verified this by issuing a test command via PowerShell. Essentially I am trying
    to execute what would be the equivalent to the PowerShell command Set-AzureVMCustomScriptExtension, but in code.
    Below is the code segment that I am having problems with:
    ComputeManagementClient client = new ComputeManagementClient(AzureSessionInfo.CloudCredentials);
    IList<ResourceExtensionReference> extReferences = new List<ResourceExtensionReference>();
    IList<ResourceExtensionParameterValue> extParamValues = new List<ResourceExtensionParameterValue>();
    string account = "{\"storageAccountName\":\"" + AzureSessionInfo.StorageAccount + "\",\"storageAccountKey\": \"" + AzureSessionInfo.StorageAccountKey + "\"}";
    string scriptfile = "{\"fileUris\": [\"" + "https://teststorageaccount.blob.core.windows.net/testcontainer" + "\"], \"commandToExecute\":\"powershell -ExecutionPolicy Unrestricted -file " + "ScriptName.ps1" + "\"}";
    byte[] bytes1 = System.Text.Encoding.UTF8.GetBytes(account);
    bytes1 = System.Text.Encoding.UTF8.GetBytes(account);
    string ScriptPrivateConfig = Convert.ToBase64String(bytes1);
    byte[] bytes2 = System.Text.Encoding.UTF8.GetBytes(scriptfile);
    bytes2 = System.Text.Encoding.UTF8.GetBytes(scriptfile);
    string ScriptPublicConfig = Convert.ToBase64String(bytes2);
    ResourceExtensionParameterValue extRef_Parameter1 = new ResourceExtensionParameterValue()
    Key = "CustomScriptExtensionPrivateConfigParameter",
    Value = ScriptPrivateConfig,
    Type = "Private"
    ResourceExtensionParameterValue extRef_Parameter2 = new ResourceExtensionParameterValue()
    Key = "CustomScriptExtensionPublicConfigParameter",
    Value = ScriptPublicConfig,
    Type = "Public"
    extParamValues.Add(extRef_Parameter1);
    extParamValues.Add(extRef_Parameter2);
    ResourceExtensionReference extRef_CustomScript = new ResourceExtensionReference
    Name = "CustomScriptExtension",
    Publisher = "Microsoft.Compute",
    Version = "*",
    ReferenceName = "CustomScriptExtension",
    ResourceExtensionParameterValues = extParamValues
    extReferences.Add(extRef_CustomScript);
    AzureSessionInfo.CloudServiceName = "CS1000001";
    AzureSessionInfo.VMName = "CS1000001";
    AzureSessionInfo.ImageFamilyName = "Windows Server 2012 R2 Datacenter";
    client.VirtualMachines.Update(AzureSessionInfo.CloudServiceName,
    AzureSessionInfo.VMName,
    AzureSessionInfo.VMName,
    new VirtualMachineUpdateParameters
    RoleName = AzureSessionInfo.VMName,
    ResourceExtensionReferences = extReferences
    I receive the following error message back from the call:
    BadRequest: Invalid extension reference parameter value in JSON configuration data for the Role: CS1000001, Reference name: CustomScriptExtension.
    I could only find very little documentation on this. Any help would be appreciated.

    Thanks Mekh... after many hours of researching and trial/error, I figured it out.
    The MSDN article I used previously led me down the wrong path. (see article here: http://msdn.microsoft.com/en-us/library/azure/dn781373.aspx). This may work for RESTful calls but not for .NET API calls.
    The part of the code that was hurting me was where the command strings (account and
    scriptfile) were being converted to Base64 encoding. This is NOT correct for .NET calls. Once I removed that, everything worked fine.
    I came across this after researching the same commands used by Linux scripts. They don't convert to Base64 either so I wonder why this is included in the documentation at all.
    In either case, I figured it out, but the documentation is very poor in this area (or all together non-existent). I don't even see where it is documented as to which JSON parameters names are supposed to be used, or even that JSON is required.
    Also, related to the Update command, if you are truly "updating" the config, you must include everything about the original config (whether it changed or not) along with the changes you want to make. If not then you will undo ALL but the changes
    you issued via the command.

  • How to call unix script/command in ODI

    Hello Gurus,
    Please let me know how to call unix script/command in ODI?
    Thanks
    Shridhar

    you can call shell script using the OS command found in Package.
    Step 1. Drag the OS Command in the Packgae
    Step 2. In the Text mentiond call the script say for ex sh /opt/path/script.sh
    Step 3. Execute.
    Note : Make sure the User through which ODI is triggering does have the required permission to execute shellscript , also always provide the full path , since scripts are execute from the oracldi/bin folder so its necessary to provide the complete path of the script location.
    Hope this helps.

  • Problem with unix "foreach" command

    Hi,
    I am facing a problem with unix command "foreach". I trying to process files using unix foreach command. When running the script with 500 or 1000 files. It is running fine. But when I am trying to the script with 2000+ files. Its throwing an error "Arguments too long".
    below is the syntax I am using in the script:
    foreach name (*)
    end
    Could anybody help me on this issue.
    Thanks in Advance.
    Manasa.

    UNIX/Linux systems expand wildcards onto the command line before invoking the
    individual commands. In effect, the shell rewrites the command line you give
    substituting the wildcard expansion. There is a limit to how long this command
    line can get.
    For example, suppose you have two files ("foo" and "bar") in your directory.
    The line:
    foreach name (*)
      echo $name
    endgets rewritten to:
    foreach name (foo bar)
      echo $name
    endand then the shell starts interpreting your script. So if you have many, many
    files, the rewritten line becomes:
    foreach name (f1 f2 f3 ... f10927)
      echo $name
    endso chances are the "foreach" line simply gets too long. To avoid problems do
    it this way; it avoids any problems based on how many files you have:
    ls | while read name
    do
      echo $name
    doneThis way the shell never exceeds its line length limitations because the
    wildcard is never expanded.
    Cheers

  • Invoking a UNIX shell command from Java stored procedure

    The program below is suppose do send an email using UNIX mailx program. It works correctly when I compile it in UNIX and invoke it from the command line by sending an email to the given address.
    I need this program to run as a stored procedure, however. I deploy it as such and try to invoke it. It prints the results correctly to the standard output. It does not send any emails, however. One other difference in execution is that when invoked from the command line, the program takes about a minute to return. When invoked as a stored procedure in PL/SQL program or SQL*Plus anonymous block, it returns immediately.
    Why would mailx invocation not work from a stored procedure? Are there other ways to invoke mailx from PL/SQL?
    Thank you.
    Michael
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    public class MailUtility
    public static void main(String[] args)
    System.out.println(mailx("Hey, there", "Hello", "oracle@solaris10ora", 1));
    * Sends a message using UNIX mailx command.
    * @param message message contents
    * @param subject message subject
    * @param addressee message addressee
    * @param display if greater than 0, display the command
    * @return OS process return code
    public static int mailx(String message, String subject,
    String addressee, int display)
    System.out.println("In mailx()");
    try
    String command =
    "echo \"" + message + "\" | mailx -r [email protected]" + " -s \"" + subject + "\" " + addressee;
    if (display > 0)
    System.out.println(command);
    try
    Process process = Runtime.getRuntime().exec("/bin/bash");
    BufferedWriter outCommand =
    new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
    outCommand.write(command, 0, command.length());
    outCommand.newLine();
    outCommand.write("exit", 0, 4);
    outCommand.newLine();
    outCommand.flush();
    process.waitFor();
    outCommand.close();
    return process.exitValue();
    catch (IOException e)
    e.printStackTrace();
    return -1;
    catch (Exception e)
    e.printStackTrace();
    return -1;

    try adding the full explicit path to "mailx" in the command string that gets sent to Runtime. i would guess that the shell that gets spawned might not have a proper environment and thus mailx might not be found.
    == sfisque

  • Starting Unix shell command with 7.3.4

    Hallo,
    does anybody have a easy to use solution to start an
    Unix shell command with Oracle 7.3.4 ????
    Thanx

    found on metalink :
    Certify - Certification Matrix: Oracle Server - Enterprise Edition on HP Tru64 UNIX
    Server Certifications
    OS        Product Certified With Version Status Addtl. Info. Components Other
    5.1b 8.1.7   (8i) 64-bit N/A N/A Certified Yes None None
    5.1a 8.1.7   (8i) 64-bit N/A N/A Certified Yes None None
    5.1 8.1.7    (8i) 64-bit N/A N/A Certified Yes None None
    5.0a 8.1.7   (8i) 64-bit N/A N/A Certified Yes None None
    5.0 8.1.7    (8i) 64-bit N/A N/A Desup:OS Yes None N/A
    4.0f-g 8.1.7 (8i) 64-bit N/A N/A Certified Yes None None
    4.0d-e 8.1.7 (8i) 64-bit N/A N/A Desup:OS Yes None N/A --------------------------------------------------------------------------------
    Copyright (c) 1995,2000 Oracle Corporation. All Rights Reserved. Legal Notices and Terms of Use.

  • Total nube to jws, need to run ssh command via web or jws?

    Ok So we had a developer that created this application that can basically run ssh commands via jws I believe. Unfortunately he is no longer here. I am wondering how you do this? I know tha commands that are already set up, but I have no idea how to implement it into my project.
    I am using Struts 2, Java 5, Weblogic 9.2, Spring
    Thanks
    orozcom

    Have a look at:
    http://www.jcraft.com/jsch/
    basically you'd need a small webstart client to wrap something like the above library. Best thing is to try with a standalone java client first. Once that is working have a look at turning it into a webstart app.

  • Can not send command via VISA test panel in MAX

    Hello all,
    I am having a small issue using the VISA test panel in MAX.  I am trying to send a simple command to a device and then retrieve the response data.  I am able to do this successfully via Labview, but for whatever reason I can not get a good response in MAX.  The command that I am sending is simply a letter (address of the device) followed by an end of line character (\r\n in ascii).  In MAX, I simply append the \r\n onto the string sent in the buffer (Send End on Writes == FALSE).  All serial settings are the same as what I have in LV (19.2, 8-n-1).  Does anyone have any thoughts?  This is kind of frustrating as I just want to do something simple and don't want to have to build a whole routine in LV to do this.
    Cheers, Matt
    Matt Richardson
    Certified LabVIEW Developer
    MSR Consulting, LLC
    Solved!
    Go to Solution.

    Thanks, Broken.  I am getting a time out error.  Clearing the buffers doesn't seem to be making a difference. This is baffling to me.  I must be missing something fundamental.
    Something that I didn't add before is that I seem to be able to send the command via labview without a read, and then read it via MAX.  This must have something to do with way it is sending the command.  Arrrrgh!
    Matt
    Matt Richardson
    Certified LabVIEW Developer
    MSR Consulting, LLC

  • Sending commands via usb port?

    i'm looking to send commands over a usb cable to a device via xcode or cocoa. i know leopard did away with rs232 commands, so i'm looking for some sample code that sends a command via objective-c over a usb cable.

    From Cameron Forbes of US FTDI tech support:
    Ed:
    After you install the FTDI D2XX drivers for Mac OS X (Intel Macs):
    http://www.ftdichip.com/Drivers/D2XX/MacOSX/UniBin/Universal%20D2XX0.1.4.dmg
    Add the following links (from Mac OS X Installation Guide):
    · Start a Terminal session (Go > Applications > Utilities > Terminal)
    · Copy libftd2xx.0.1.0.dylib to the /usr/local/lib directory (cp Desktop/D2XX/bin/libftd2xx.0.1.0
    /usr/local/lib)
    · Change directory to the /usr/local/lib (cd /usr/local/lib)
    · Create a symbolic link to the library (ln -sf libftd2xx.0.1.0.dylib libftd2xx.dylib)
    The example code is located at:
    /desktop/d2xx/Samples
    Best Regards,
    Cameron Forbes
    Field Applications Engineer - Americas
    [email protected]
    Future Technology Devices International Ltd.
    7235 NW Evergreen Parkway
    Suite 600
    Hillsboro, OR 97124-5803
    Tel: 503.547.0988 xt 315
    Fax: 503.547.0987
    Practical USB Interface Solutions

  • Using parallel to invoke commands via schroot

    Expanding on the discussion here, why does starting commands via parallel into an schroot cause all the problems described?
    I can for example, stagger start a number of commands through schroot as long as they don't start at the same time with no problem.
    Example (each has been started one-at-a-time:
    % schroot -p -- nice -19 makepkg -s
    % schroot -p -- htop
    schroot -p -- mprime

    The solution is not to use schroot at all but to simply call chroot directly via parallel which works fine.
    Example worker code for parallel.  See the complete build script for more.
    % sudo linux32 chroot --userspec=1000:100 /opt/arch32 /bin/bash -c 'cd $here ; nice -19 makepkg -scd --skipinteg --config $HOME/bin/repo/makepkg.i686'

  • Transmitting a byte command via UDP

    I hope you'll forgive the newbie question, but my education is in aerospace engineering and not computer science...
    I have a verified specification document which tells me that in order to command a data source to begin transmitting data, I need to send it the following command via UDP:
    1 byte        1 byte               2 bytes                              n bytes
    COMMAND
    01
    00
    Command Code =
    8016
    Data  
    Where the data field is ignored for this command.
    My best understanding of this situation would be to use the Byte Array to String function on an array of U8s which looks like this:
    where the network order is big endian.  However, I have some functioning, inherited code which interfaces with the same data source and issues a start data command using an array which looks like this:
    In classic style, the author of this code has retired and I'm the only other LabVIEW programmer.  I'm not savvy enough to tell whether this array accomplishes the same task and it's my limited understanding of bytes which is causing the confustion or if this command is combined with another command or what.
    Any insight, leading questions, or valuable commentary is appreciated.
    Solved!
    Go to Solution.

    I think I'm starting to understand how bits, bytes, and such behave with LabVIEW.  Kind of confusing without a solid background in computing...
    According to the documentation-when using the startup command--there is no data payload required; it is ignored by the data source.  My only guess for those elements remaining after the 4th element are that they are simply placeholders so that the data source know this is a completed command or that the original programmer copied the array from one of the other commands (which required the data payload) and those are just residual values he knew were ignored and never bothered to delete.  It would be in keeping with the just-get-it-done approach this programmer favored.
    Thanks for the assistance.  I think I can interpret the other commands for this data source now.
    Cheers.

  • Hi..everyone..plz share realtime unix shellscript commands

    hi..everyone..plz share realtime unix shellscript commands that are used in oracle pl/sql development my mailid: [email protected]

    rajsekharb wrote:
    hi..everyone..plz share realtime unix shellscript commands that are used in oracle pl/sql development my mailid: ????????????
    You are unwise to publish your email address on public forums, as spambots will pick it up and you will be inundated with spam.
    Also, consider that the Oracle forums are a community where people support each other on the forums, they are NOT a personal support desk for you, so it is considered quite rude to ask people to email you answers to your question as if you are not wanting to spend your time on the forums discussing your requirements.
    As Billy says, your question doesn't make much sense.  You've used the word "realtime" completely out of context.  Perhaps you were referring to scripts that people use for real in their businesses to help support pl/sql development?  but still it's not clear what sort of scripts you are looking for, and considering this forum is for SQL and PL/SQL programming assistance, your requesting Unix scripts is not really appropriate unless you explain yourself and how your requirement relates to SQL and/or PL/SQL.

  • Unix find command...

    My problem exists with the behavior on the unix find command, or my lack of understanding of it.
    For example, I work for a graphics company and we have a constant folder structure like this:
    *12345 Apple - Poster*
    ~....~01_Layouts
    ~....~02_Images
    ~....~03_Fonts
    ~....~04ClientOriginals
    ~........~01.28.08_14:46
    ~........~03.07.08_15.03
    ~........~03.10.08_17.22
    When we receive files from a customer, the CSR creates a folder inside 04ClientOriginals following a format like 03.06.08_10.15, and copies the files/folders from customer supplied media into them.
    I have set up a launchd script that finds all of the date/time stamped folders inside of 04ClientOriginals that have not been modified within the past month and stuff them with the Stuffit command line utility. I do that with this command:
    find . -type d –mtime +30 -ipath #/04ClientOriginals/# -exec /usr/local/bin/stuff -f sit5 -m 2 -o -D {} \;
    This command works fine except in those cases where there are folders over 30 days old inside of a parent directory that is not 30 days old yet. I only want the find to descend to one level below 04ClientOriginals, and no further.
    I thought by adding an extra "/" at the end of the path #/04ClientOriginals/#/ instead of #/04ClientOriginals/# would keep it from descending further down, but when I try this the search returns no results. Also, I can’t use -maxdepth in my find arguments because the depth of 04ClientOriginals is not always constant.
    Any help would be greatly appreciated.
    Thanks.
    Edit: Due to the lack of decent markup tools for formatting code on the Apple Discussion Board, the wildcards in my file paths have been substituted with a "#". Kind of ridiculous for a unix discussion board to not have code highlighting capability.
    Message was edited by: Guriboy

    etresoft wrote:
    I don't know if these will work or not. Regular expressions are powerful, but tricky. Plus, there are a few different, but similar, varieties. Also, I don't know if the find within a find syntax will work. This might be something that is better suited to Perl. You would then have much more control over what you are doing.
    Running this find command finds exactly what I'm looking for:
    find . -type d -name "04ClientOriginals" -exec find {} -mtime +30 -type d -maxdepth 1 ;
    I hope I'm wrong, but can't you call -exec only once? As a test I ran this:
    find . -type d -name "04ClientOriginals" -exec find {} -mtime +30 -type d -maxdepth 1 -exec ls -l {} ;
    If I invoke -exec a second time, I get this error:
    find: -exec: no terminating ";" or "+"
    find: -exec: no terminating ";" or "+"
    find: -exec: no terminating ";" or "+"
    I've searched high and low and I cannot find an example of the find command calling -exec more than once.
    My regex skills are pretty weak, so I'll only tread those waters if I have to.

Maybe you are looking for