User Profile

Collapse

Profile Sidebar

Collapse
ashitpro
ashitpro
Last Activity: Nov 19 '13, 03:26 PM
Joined: Aug 6 '07
Location: Maidenhead, UK
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • I could see few options

    1: You might want to re-consider setting up ftp or ssh server on windows machine. then you could use sftp or scp to transfer your files.

    2: setup NFS server on windows, mount the shared folder on linux, then using simple "cp" command you should be able to transfer the files.

    3: Last option would be to mount native windows share using cifs please see http://www.cyberci...
    See more | Go to post

    Leave a comment:


  • ashitpro
    started a topic using Astyle to format the C code
    in C

    using Astyle to format the C code

    I am trying to use Astyle to format my C code.
    C code is generated by python script.

    I have return statements like this:

    Code:
    func()
    {
    return cond1 && cond2 && cond3 && cond4;
    }
    I would like Astyle to format this as:

    Code:
    func()
    {
    return 
           cond1 && 
           cond2 && 
           cond3 && 
           cond4;
    ...
    See more | Go to post
    Last edited by Rabbit; Nov 30 '12, 04:33 PM. Reason: Please use code tags when posting code.

  • ashitpro
    replied to redefining stdout/stderr
    in C
    I think I solved my problem by re-arranging the headers. By the way, my code can not be dependent on c-runtime. someone else will plugin their platform specific code. The reason, I was suppressing those "#defines" is that particular code is auto-generated by lex.
    See more | Go to post

    Leave a comment:


  • ashitpro
    started a topic redefining stdout/stderr
    in C

    redefining stdout/stderr

    when I declare

    #ifndef stdout
    #define stdout 0
    #endif

    #ifndef FILE
    #define FILE void
    #endif

    it gives me warning as "redefined in stdlib.h".
    How can I prevent #include<stdio. h> or #include<stdlib .h>
    for particular translation unit?
    See more | Go to post

  • ashitpro
    replied to c++
    in C
    Its a header file for iostream library, which provides input and output functionality using streams. It enables you the functionality to read/write from/to files, strings and standard input output devices using streams.

    e.g. if you are using cin or cout to work with stdin and stdout respectively, you will need iostream
    See more | Go to post

    Leave a comment:


  • ashitpro
    started a topic About Base 34 or Base 36 string encoding
    in C

    About Base 34 or Base 36 string encoding

    I have got a RSA signature which is 512 bytes long.
    I was looking for a way to convert this string into base34 or base36 format.

    I searched a lot, but everywhere I saw converting number to given base. Here, I am looking for a big string to encode.

    So far, I tried following code:

    Code:
    char const c_base_encoding[] = "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ";
    size_t const c_base_encoding_size
    ...
    See more | Go to post

  • you can use,

    grep -rin "sed" *

    This will do a recursive search for pattern "sed" in each file.
    See more | Go to post

    Leave a comment:


  • ashitpro
    replied to "last" command returning duplicates
    Instead of 'last' try 'lastlog'.

    It should display the username and last login time.
    Something like this:

    Code:
    Username         Port     From             Latest
    root             pts/5    172.18.28.86     Fri Dec 17 14:53:18 +0530 2010
    bin                                        **Never logged in**
    daemon                                     **Never logged in**
    adm
    ...
    See more | Go to post

    Leave a comment:


  • ashitpro
    replied to gdb 7.2 installation error
    See the line:
    "This GDB was configured as "x86_64-unknown-linux-gnu"."
    GDB is not able to figure out your platform.

    Either, you have downloaded it from non-native repository or while building gdb you have specified wrong platform.

    I would rather suggest to use "yum install gdb" command to install the gdb.
    See more | Go to post

    Leave a comment:


  • How to replace an attribute with empty string using regex?

    I am parsing one xml, I want to replace an attribute with empty string.

    every node has an attribute, something like this:

    id="1hyx36uhpi7 80iq8oiu355"

    I am using following regex pattern, but its not working

    d = re.search('(id= "([a-z0-9A-Z]+)")*',text)
    See more | Go to post

  • I'll prefer UNIX.
    You'll get better results, if you are writing you application in multi-threaded way.

    This is very general question to be specific with an answer. I'll suggest writing an application and try it on both OS for say 100 files first. Put some time measure to get the execution time.

    I usually work with cross platforms, I build/run few frameworks on windows as well as linux. These are basically test case...
    See more | Go to post

    Leave a comment:


  • try,
    lsof | grep lib
    See more | Go to post

    Leave a comment:


  • ashitpro
    replied to Creating sockets in c++
    in C
    I don't think that this error is related to socket.
    Could you please post the code here?
    See more | Go to post

    Leave a comment:


  • ashitpro
    replied to BSD Sockets - Selecting Source Address
    in C
    As a first step, lets forget about 10.0.0.x nic/network.
    Say,your machine has ip 10.13.0.5 assigned to other nic.
    Your target machine,to which you are sending the UDP packets,has ip 10.13.0.6. Now, if my assumptions are right then check if both these machines are able to ping each other or not? If that works well then, I don't think any good reason about why it's not receiving ack packet unless firewall is ok with udp packets.
    See more | Go to post

    Leave a comment:


  • In case of gcc, compile program with -g option.
    Then invoke the gdb.
    e.g.
    gdb a.out
    This will drop you to gdp command prompt.
    after that just hit 'disas loop' command at gdb prompt
    This will show you the assembly representation for method 'loop'

    I don't know if this is what you are looking for.
    Good luck !!!
    See more | Go to post

    Leave a comment:


  • ashitpro
    replied to Need help for route command
    If you have multiple interfaces for same network.
    Say, eth0 172.18.28.90 and eth1 172.18.28.91. In this case, solaris will choose first working device as a output interface. If you have to change the interface for all output traffic then you basically specifies with -setsrc switch.

    In case of linux, just specify eth0 or eth1 whichever you may need. If you have only single interface don't bother about those options.

    ...
    See more | Go to post

    Leave a comment:


  • ashitpro
    replied to Enabling $Admin share on windows 7
    Actually, I was not able to run psexec and start my batch script remotely. I read somewhere that you have to enable the Admin share. So I was stuck enabling that share.

    But like I said, when I disabled the UAC in windows 7. everything started working fine. Admin share as well as PsExec.
    See more | Go to post

    Leave a comment:


  • ashitpro
    replied to about history control
    There are three supported values.

    ignorespace: Doesn't write lines started with spaces

    ignoredups: Doesn't write duplicate commands.

    ignoreboth: Combined above two options.
    See more | Go to post

    Leave a comment:


  • ashitpro
    replied to How to compare strings using awk?
    in C
    Code:
    awk -F',' '$3 ~ /Yes/ {print $3}' a.txt
    I haven't check your script; but I thing 'YES' should be 'Yes'. Check if that work otherwise see if mine works for you.
    See more | Go to post

    Leave a comment:


  • ashitpro
    replied to Using !$ command
    it executes the last command you executed on the shell.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...