Skip to content

Linux tools and links

sipke edited this page Feb 20, 2020 · 4 revisions

Socat

https://windelbouwman.wordpress.com/2014/06/12/linking-two-serial-ports-with-socat/

socat -d -d /dev/ttyUSB0,raw,echo=0,crnl,b115200 /dev/ttyUSB1,raw,echo=0,crnl,b115200

dd

To create an image from a drive sudo dd if=/dev/sdx of=/path/to/new.iso Alternatively, to create a USB drive from an image sudo dd if=/path/to/iso of=/dev/sdx

adduser

useradd -m -d /PATH/TO/FOLDER USERNAME if you forget home dir

sudo mkdir USERNAME

sudo chown USERNAME:USERNAME /home/USERNAME/

ssh

ssh -X to forward x11

mount

listing mounted drives

cat /proc/mounts

cat /etc/mtab

binary and hex file tools

xxd <file>

vbindiff

extracting parts of binary file

dd [skip=<tostart>] [count=<bytes>] if=input.bin of=output.bin bs=1

Create bootable image

[syslinux](http://www.syslinux.org/wiki/index.php?title=Install)

Connect to stfp server on target device (assumes openssh-sftp-server is installed on target)

sshfs root@<target-hostname-or-ip>:/home/root /home/user/mnt/ -o nonempty

Serial

Set board rate: stty -F /dev/ttyX0 567890

Tee and logging stdout and stderr to dated file

yourcommand and arguments |& tee $(date +%F-%H%M%S-)YourName.log the ampersand after pipe (|&) ensures stderr also goes to tee.

Links

Permissions: http://linuxcommand.org/lc3_lts0090.php

Clone this wiki locally