Tag Info

New answers tagged

1

When grepping a disk - unless you're actually looking for non-printable information - you might like to do: tr -c '[:print:]\n' '\n\n' </dev/disk | grep -b 'regex' All binary data is converted to newlines and grep can simply ignore it except to increment the offset it reports on by one.


-1

I noticed a few gotchas when grepping disk devices which I noted here with a helper script: http://www.pixelbeat.org/docs/disk_grep.html


5

If the filesystem takes over the whole disk, OS X currently uses a name like /dev/disk5. If the disk is partitioned, it adds an s# suffix, like /dev/disk5s2 for the second partition. (s is short for "slice," a BSDism functionally equivalent to a partition.) Disks are numbered sequentially in discovery order by the OS, on boot, so you may have to experiment ...


2

I'd install the buffer program (if it is not already there in your distribution) if you are trying to transfer via an ethernet link. It is like dd but FAR better and faster. Basically it is programmed to do concurrent reads and writes using a shared memory buffer. I used to use this for tape dumps and it saved about 10% transfer time. The command line ...


5

You could pipe through SSH. Example using dd: dd bs=1M if=/dev/disk | ssh -C target dd bs=1M of=disk.img If the network connection breaks during transfer, you can resume if you know how much was copied. For example if you're sure at least 1000MiB were transferred already (check the file size of disk.img): dd bs=1M skip=1000 if=/dev/disk | ssh -C target ...


3

What is a Terminal? A terminal consists of a screen and keyboard that one uses to communicate remotely with a computer (the host). One uses it almost like it was a personal computer but the terminal is remote from its host computer that it communicates with (on the other side of the room or even on the other side of the world). Question 1 /dev/tty ...


1

The free-electrons header is internal to the kernel source, and you will find it if you look in [src]/include/linux; if you are compiling kernel code, that should be in play. The header you've pasted is the system header, from /usr/include/linux. That's for user land code that needs access to the constants and macros defined therein. These don't ...


2

You can do this using udev. Create a file in /etc/udev/rules.d with the suffix .rules, e.g. local.rules, and add a line like this to it: ACTION=="add", KERNEL=="i2c-[0-1]*", MODE="0666" MODE=0666 is rw for owner, group, world. Something you can do instead of, or together with that, is to specify a GID for the node, e.g: GROUP="pi" If you use this ...


0

Some way to a workaround/solution for this problem is to use systemd-networkd. Set up a config file at /etc/systemd/network/net0dhcp.network (or similar) to: [Match] Name=net0 [Network] DHCP=true Rename net0 in the above to the appropriate network interface name. Now: systemctl disable dhcpcd systemctl enable systemd-networkd And reboot. (You can ...


0

Out of date book, as noted. So to make the examples work with more modern linux, where it says something like cat music.wav > /dev/dsp change it to: cat music.wav | aplay And you've just done your first porting of code! Win! Feel free to send the book author patches. :-)



Top 50 recent answers are included