Sponsored Content
Top Forums Shell Programming and Scripting Convert binary file to csv and then back to the binary format Post 302747459 by digidax on Friday 21st of December 2012 10:54:27 AM
Old 12-21-2012
Convert binary file to csv and then back to the binary format

Hello *nix specialists,

Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my idea is, to use the firmware modification kit. After decompressing the original firmware, I get a file calling defaults.bin (inside the attaced file) in which are stored all variables with the correspondending values. I have no informations about the binary format but maybe it would help to take a look in to the C-source: (inside the attaced file)
I think at the end of the code is a function to read the parameters.

Okay back tot the topic.

I want to convert the defaults.bin into a csv text file. Then a script reads from a database the required parameters like IP address, username, password ... and change so the csv file. Then a script should make from the csv file a new (specially for one router) defaults.bin file. At the end, the firmaware modification kit compress all to the firmware file what we can send to each router.

Is this workaround to crazy?

best regards and merry X-mas,
Frank
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to convert binary Unix file to text

Hi all, I have a print control file (dflt) for Oracle which is in binary. As I am going to develope an application in Window environment, I would like to reference the dflt file. But it is in binary format and I cannot access it. Anyone can suggest me how to convert the file into text or... (5 Replies)
Discussion started by: user12345
5 Replies

2. Programming

Reading a binary file in text or ASCII format

Hi All, Please suggest me how to read a binary file in text or ASCII format. thanks Nagendra (3 Replies)
Discussion started by: Nagendra
3 Replies

3. Programming

how to write a file to binary format in C ?

I'm in the Solaris environment. I want to write data to a file, but I don't want it to be easily read from the C shell. For example, here's my code: main () { FILE *fo; fo = fopen ("filename", "w"); fprintf (fo, "This is a test.\n"); fclose (fo); } Anyone can open up... (3 Replies)
Discussion started by: serendipity1276
3 Replies

4. Shell Programming and Scripting

Is there any script which convert binary file to CSV format

Dear guys; I have a binary file and I need to convert its data to csv format ...appreciating your help. Best Regards (14 Replies)
Discussion started by: ahmad.diab
14 Replies

5. UNIX for Dummies Questions & Answers

Converting binary file to readable format in Ksh

In Unix/Ksh, when I try to look inside a file it says that the file may be a binary file and if I want to see it anyway. When i say 'yes', it shows me the content filled with unreadable symbols (looks like binary). Is there a command that I can run from the Unix prompt to convert/translate that... (3 Replies)
Discussion started by: arthurs
3 Replies

6. UNIX for Dummies Questions & Answers

convert a .tr file to binary in cygwin

I would like to convert a .tr file to a binary file to use for trace purposes. Can anyone provide any insight? (0 Replies)
Discussion started by: sparklezilla3
0 Replies

7. Shell Programming and Scripting

Convert jpg file to binary format

Hi Team, Here's the requirement. I have a image file in jpg format in unix. Now I need to i. convert the jpg format to binary format ii. followed by loading the binary file to Oracle db. Can anyone help me out? Thanks Krishnakanth Manivannan (4 Replies)
Discussion started by: kmanivan82
4 Replies

8. Shell Programming and Scripting

Convert Binary File To Hex In Linux

dHi, I have the attached file(actual file can be extracted post unzipping it) & i am trying to use the following code for coversion to hex format. Starting hex value is 84 which is start of the record & termination is done using 00 00 followed by 84(hex) which i can see in the dump clearly using... (14 Replies)
Discussion started by: siramitsharma
14 Replies

9. UNIX for Beginners Questions & Answers

Conversion of Binary csv file

Hello, I have a binary csv file that was created on 'Red Hat Enterprise Linux Server release 6.6'. Now we have transferred all files on Ubuntu 16.04.2 LTS/xenial On opening the file in Ubuntu, there are special characters ... (8 Replies)
Discussion started by: nans
8 Replies

10. Programming

DB2 convert digits to binary format

Dear Team We use DB2 v10.5 and using DBArtisan tool Can someone please guide how to convert digits to binary numbers using db2 feature. Ex> for number 9 , binary should be 1001 ( 8+1) Any help appreciated. Thanks (2 Replies)
Discussion started by: Perlbaby
2 Replies
Smokeping_probes_IOSPing(3)					     SmokePing					       Smokeping_probes_IOSPing(3)

NAME
Smokeping::probes::IOSPing - Cisco IOS Probe for SmokePing SYNOPSIS
*** Probes *** +IOSPing binary = /usr/bin/rsh # mandatory forks = 5 offset = 50% packetsize = 56 step = 300 timeout = 15 # The following variables can be overridden in each target section ioshost = my.cisco.router # mandatory iosint = Ethernet 1/0 iosuser = admin pings = 5 # [...] *** Targets *** probe = IOSPing # if this should be the default probe # [...] + mytarget # probe = IOSPing # if the default probe is something else host = my.host ioshost = my.cisco.router # mandatory iosint = Ethernet 1/0 iosuser = admin pings = 5 DESCRIPTION
Integrates Cisco IOS as a probe into smokeping. Uses the rsh / remsh protocol to run a ping from an IOS device. VARIABLES
Supported probe-specific variables: binary The binary option specifies the path of the binary to be used to connect to the IOS device. Commonly used binaries are /usr/bin/rsh and /usr/bin/remsh, although any script or binary should work if can be called as /path/to/binary [ -l user ] router ping to produce the IOS ping dialog on stdin & stdout. Example value: /usr/bin/rsh This setting is mandatory. forks Run this many concurrent processes at maximum Example value: 5 Default value: 5 offset If you run many probes concurrently you may want to prevent them from hitting your network all at the same time. Using the probe- specific offset parameter you can change the point in time when each probe will be run. Offset is specified in % of total interval, or alternatively as 'random', and the offset from the 'General' section is used if nothing is specified here. Note that this does NOT influence the rrds itself, it is just a matter of when data acqusition is initiated. (This variable is only applicable if the variable 'concurrentprobes' is set in the 'General' section.) Example value: 50% packetsize The (optional) packetsize option lets you configure the packetsize for the pings sent. Default value: 56 step Duration of the base interval that this probe should use, if different from the one specified in the 'Database' section. Note that the step in the RRD files is fixed when they are originally generated, and if you change the step parameter afterwards, you'll have to delete the old RRD files or somehow convert them. (This variable is only applicable if the variable 'concurrentprobes' is set in the 'General' section.) Example value: 300 timeout How long a single 'ping' takes at maximum Example value: 15 Default value: 5 Supported target-specific variables: ioshost The ioshost option specifies the IOS device which should be used for the ping. Example value: my.cisco.router This setting is mandatory. iosint The (optional) iosint option allows you to specify the source address or interface in the IOS device. The value should be an IP address or an interface name such as "Ethernet 1/0". If this option is omitted, the IOS device will pick the IP address of the outbound interface to use. Example value: Ethernet 1/0 iosuser The (optional) iosuser option allows you to specify the remote username the IOS device. If this option is omitted, the username defaults to the default user used by the remsh command (usually the user running the remsh command, ie the user running SmokePing). Example value: admin pings How many pings should be sent to each target, if different from the global value specified in the Database section. Note that the number of pings in the RRD files is fixed when they are originally generated, and if you change this parameter afterwards, you'll have to delete the old RRD files or somehow convert them. Example value: 5 AUTHORS
Paul J Murphy <paul@murph.org> based on Smokeping::probes::FPing by Tobias Oetiker <tobi@oetiker.ch> NOTES
IOS Configuration The IOS device must have rsh enabled and an appropriate trust defined, eg: ! ip rcmd rsh-enable ip rcmd remote-host smoke 192.168.1.2 smoke enable ! Some IOS devices have a maximum of 5 VTYs available, so be careful not to hit a limit with the 'forks' variable. Password authentication It is not possible to use password authentication with rsh or remsh due to fundamental limitations of the protocol. Ping packet size The FPing manpage has the following to say on the topic of ping packet size: Number of bytes of ping data to send. The minimum size (normally 12) allows room for the data that fping needs to do its work (sequence number, timestamp). The reported received data size includes the IP header (normally 20 bytes) and ICMP header (8 bytes), so the minimum total size is 40 bytes. Default is 56, as in ping. Maximum is the theoretical maximum IP datagram size (64K), though most systems limit this to a smaller, system-dependent number. 2.6.8 2013-03-17 Smokeping_probes_IOSPing(3)
All times are GMT -4. The time now is 06:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy