The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
2answers
43 views

What can cause my shell to look like this? [duplicate]

I'm currently developing a home automation framework for my apartment. This involves getting JSON over Serial from an Arduino. When the JSON can't be parsed (usually only on startup) I log it as an ...
0
votes
0answers
27 views

Directory became UNIX binary (OS X)

I recently fixed the file permissions of my home directory using System Recovery mode. But after rebooting I found that one directory had become a single unix binary. I have tried everything from ...
11
votes
3answers
551 views

How can I work with binary in bash, to copy bytes verbatim without any conversion?

I am ambitiously trying to translate a c++ code into bash for a myriad of reasons. This code reads and manipulates a file type specific to my sub-field that is written and structured completely in ...
1
vote
2answers
46 views

What's the POSIX way to read an exact number of bytes from a file?

Just hit this problem, and learned a lot from the chosen answer: Create random data with dd and get "partial read warning". Is the data after the warning now really random? Unfortunately ...
2
votes
2answers
73 views

Why does “head /bin/ls” reset the terminal

If you do something silly like cat /var/log/wtmp your terminal can get messed up as shown in the screenshot. I know there are a number of ways of fixing this. One of the ways not mentioned on that ...
0
votes
1answer
16 views

Possible problems deleting /tools in LFS

I recently made a Linux From Scratch and now I want to delete the /tools directory. But before rushing through it, I ran ldd /bin/* | grep '/tools' Which gave me this liblzma.so.5 => ...
0
votes
1answer
24 views

Install Java 1.4.2 on recent Amazon Linux [duplicate]

I need Java 1.4.2 on a up-to-date Amazon Linux 2015.09 server. I've tried to install j2sdk-1_4_2_19-linux-ia64-rpm.bin. When I execute this file, I get an error message: line 442: ...
3
votes
2answers
256 views

Alter certain bytes in many files

I need a large number of damaged .png files in order to test my project. To that end, I need to set all bytes from the 0x054-th to the 0xa00-th to 0. .png files contain chunks with checksums, I want ...
1
vote
1answer
18 views

Find all files (including libraries) a binary depends on

I'd like to find all files a binary depends on (including libraries, configuration files, basically all files referenced in the binary). I know, that you can find shared libraries with objdump, ldd, ...
-2
votes
1answer
55 views

how to fix potentially infected binary files? [closed]

when I installed the updates on my computer (Ubuntu 14.04), I typed the password, thinking that it was asked for regular updating , but when I noticed some strange behavior and crash at this moment, I ...
0
votes
1answer
31 views

Convert line of ASCII file to binary packet for NetCat

I have an ASCII file, which looks like this: 36,36,0,1 36,36,0,2 ... What I want to do is to send every row of it as one binary TCP segment's payload with NetCat. To convert the number from file ...
3
votes
2answers
107 views

Trace a binary stream from a device file

I'm debugging a binary stream that is coming from a device file. I would like to have the output printed out in real time as hex values. So far I've used tail -f /dev/ttyAPP2 | hexdump -C but after ...
5
votes
2answers
258 views

Create the same PNG with ImageMagick 2 times: Binaries differ

I create two images that should be identical, but their binaries are different: $ convert -size 1x1 xc:white out1/w.png $ sleep 1 $ convert -size 1x1 xc:white out2/w.png $ diff out1/w.png out2/w.png ...
4
votes
1answer
52 views

Finding out binary's compiling computer name

We have recently in our workplace stumbled upon a really old binary file that originates from unknown old computer. However in order to run this binary we need to get some local resources and ...
2
votes
1answer
37 views

Is there a way to create endless stream with custom character?

I need to create an endless stream of characters like /dev/zero but I need it to spam custom character (like 'a') instead of 0x00. Is there a way to do it?
1
vote
1answer
125 views

Apply SHA256 and Base64 to string in script

I'm trying to apply SHA256 and then Base64 encode a string inside a shell script. Got it working with PHP: php -r 'echo base64_encode(hash("sha256", "asdasd", false));'. But I'm trying to get rid of ...
0
votes
1answer
52 views

How to recognize binaries installed in `~/bin`? [duplicate]

I am trying to execute some binaries manually installed in a bin directory in my $HOME (normal user). Files are present in /home/user/bin and have exec permission: $ ls -la ~/bin/ total 120 ...
2
votes
1answer
223 views

How do I repair binaries?

So, basically I was messing up with minix and qemu and I messed up too much. me@meplepl ~ $ which bash: /usr/bin/which: cannot execute binary file: Exec format error me@meplepl ~ $ file ...
3
votes
2answers
30 views

How to set binary installed by package manager as default?

I installed a newer version of tcpdump via MacPorts and would like to make it the default binary. $ which -a tcpdump /usr/sbin/tcpdump /opt/local/sbin/tcpdump For now I set an alias, but that of ...
0
votes
0answers
16 views

Where exactly is page permissions set in fs/binfmt_elf.c?

As I understand that in linux, the ELF loader (binfmt_elf.c) is the one that loads a particular binary into memory. Usually data will be RW and code segment will be RE. But where exactly in the source ...
1
vote
1answer
58 views

Find longest matching portion with in two binary files

Say I've got two binary files, each roughly 50MB, that may contain a digitally-identical portion. Is there an easy way to compare these two files, find the longest identical portion, and save that to ...
1
vote
2answers
378 views

Extract data between two matched patterns in a binary file

I am trying to extract a jpeg image from a binary text file. I want to extract all data between 0xFF 0xD8 (start of image) and 0xFF 0xD9 (end of image) inclusive. Earlier, I have successfully run the ...
5
votes
3answers
100 views

How does grep decide that a file is binary?

I have a large utf-8 text file which I frequently search with grep. Recently grep began reporting that it was a binary file. I can continue to search it with grep -a, but I was wondering what change ...
0
votes
1answer
102 views

What's the fastest way of writing 1s to a hard disk? [duplicate]

I'm currently writing 1s to a file using the following: tr '\0' '\377' < /dev/zero > /dev/sdb But this is a really slow method when I want to fill a 500GB disk. Is there a quicker way?
4
votes
3answers
153 views

Handling NULL characters in shell

Is there a portable way of handling NULL characters in shell? A typical example would be splitting the output of find ... -print0 with shell (and shell only) either in a pipe or in a command ...
1
vote
2answers
52 views

Viewing Binary not Hex

Debian jess 64 Alright let me start out by saying this maybe a very stupid,uninformed question due to my lack of understanding of binary, but I guess that's what this site is for, questions. That ...
1
vote
0answers
1k views

How do I create generalized binary tarballs for SageMath?

I would like to create a generalized binary tarball (i.e., a tar-compressed archive that contains an executable shell script for a wide range of different Linux distributions. It must be first ...
0
votes
1answer
85 views

Grep all strings from several binary files into one txt file

I've decided to play around dumping all process memory of couple utilities in order to find out, how much trace of sensitive info an attacker could theoretically obtain from app's memory. I've found ...
0
votes
3answers
653 views

is there a way to run a linux binary on OS X

Is there a way to run a linux binary in OS X? I tried to run a binary but it said it isn't executable.
2
votes
3answers
324 views

Split binary data of fixed byte offset by byte position?

I have binary data which I review by xxd -ps in hex format. I notice that the byte distance is 48300 (=805*60) bytes between two headers where the separator is fafafafa. There is the beginning of ...
4
votes
4answers
312 views

How can I convert two-valued text data to binary (bit-representation)

I have a text file with two (2) only possible characters (and maybe new lines \n). Example: ABBBAAAABBBBBABBABBBABBB (Size 24 bytes) How can I convert this to a binary file, meaning a bit ...
2
votes
2answers
54 views

Workaround for busybox head that drops NUL from data

TL;DR: Latest busybox (1.23.2) provided head is buggy and will happily drop NUL characters in the provided data. Replacing the binaries is not an option. I'm using head -[nc] -X in my scripts, is ...
2
votes
2answers
6k views

Convert binary mode to text mode and the reverse option

By the following way I convert a simple binary file into a text file od –t x1 Check.tar | cut –c8- > Check.txt What is the opposite way to convert the Check.txt to Check.tar as the original file ...
2
votes
2answers
538 views

How to obtain a plain (raw) binary dump of any file in Unix/Linux?

I have read many similar question on the Stack Exchange community but none of them address a 'clean' binary dump. I have used: xxd and sed combinations to try to obtain a clean binary dump from any ...
1
vote
2answers
223 views

ls or find option to exclude binary files

How can I list only files that aren't compiled code in the current directory? I'm reviewing the custom scripts and code on several HPUX and Linux servers before transferring them to a newer system. ...
-2
votes
2answers
86 views

How can I identify if a binary file is set-user-ID? [closed]

In Linux, how can I identify if a binary file is set-user-ID? Can I use ls -l?
0
votes
1answer
321 views

How do i write a shell script so that when i compile my c++ program it will put the binary into the Binary Directory

I have a directory called Binary and bunch of source files: ./ ├── Binary/ ├── lesson02.cpp ├── lesson04.cpp └── lesson06.cpp when I compile the source code g++ lesson01.cpp -o lesson01 I want ...
0
votes
2answers
60 views

What does mean by “Debian on track to prove binaries' origins”?

I found an article on The Register of the UK about the reproducible builds in Debian. I couldn't understand much from it. Could anyone simply this for me, please? Here's the link: Reproducible Builds
11
votes
1answer
1k views

When can I edit strings in an executable binary?

I have an executable binary; let's call it a.out. I can see the binary contains strings $ strings a.out ... /usr/share/foo .... I need to change the string /usr/share/foo to /usr/share/bar. Can I ...
1
vote
1answer
62 views

file (vdi) increase (at double) size after split and then cat operation

I'd splitted a vdi file with 7 gigabytes and then joined with cat command. The file works normally on VBox, but get 14 gigabytes after be re-joined. The exact operation was: $ split -- bytes=2000M ...
0
votes
1answer
636 views

Can't run binary executable on Ubuntu 12.04

I get the following error: ./cataclysm: command not found when trying to run this executable on a Linux server over SSH. When I run ldd cataclysm, I get: linux-gate.so.1 => (0xf7759000) ...
4
votes
3answers
765 views

Modifying binary during execution

I often come across the situation when developing, where I am running a binary file, say a.out in the background as it does some lengthy job. While it's doing that, I make changes to the C code which ...
21
votes
5answers
3k views

Generating a random password; why isn't this portable?

I want to generate a random password, and am doing it like so: </dev/urandom tr -dc [:print:] | head -c 64 On my laptop, which runs Ubuntu, this produces only printable characters, as intended. ...
2
votes
1answer
367 views

Equivalent of Java's String.getBytes() in Unix Shell (Cygwin)

Let's say I convert my string into byte array. byte[] byte sUserID.getBytes(“UTF-8”); //Convert User ID String to byte array Now I need to write a script on Shell that will have exactly the ...
0
votes
1answer
350 views

Convert serialized Java object to human readable

I have object of class class X { private DateTime dt; "constructor, set/get" } I have one instance of this object serialized in file.bin. I want to show content of `file.bin on the Linux ...
3
votes
1answer
110 views

Find/replace on block device?

Let's say I have an unmounted block device /dev/sda, and I want to replace all instances of MyPassWord with XXXXXXXXXX. (Hopefully my goal is obvious.) What's the easiest way to do this?
2
votes
1answer
491 views

How to get binary representations of strings in Shell?

I'm using openssl dgst -sha1 -binary to get hash values of my strings in binary format. (I'm using -binary flag because my version of openssl adds "stdout" before each hash value on default output, ...
4
votes
1answer
477 views

how to run a software in linux without installing it

I am trying to run Rstudio download page link. On my Windows machine, I just downloaded the zip file from zip/tarballs section and was able to run .exe without installing anything on my machine. I'd ...
1
vote
1answer
155 views

How can I teach grep to treat properties-files like text-files

Since I upgraded grep from 2.16 to 2.21 it treats .properties-files like binary files. This sucks because I like to use grep -I ... to exclude binary files from the search results and ...
0
votes
1answer
73 views

Combining parts of original Android with newer sources to create a new image [closed]

Hi I wanted to talk to the pros on the compiling and decompiling Android source and binaries respectively. Is it possible to decompile an Android OS running in a device and get its source, so that you ...