Commands tagged serial (6)

  • Use GNU/screen as a terminal emulator for anything serial console related. screen /dev/tty eg. screen /dev/ttyS0 9600 MacOSX: http://www.macosxhints.com/article.php?story=20061109133825654 Cheat Sheet: http://www.catonmat.net/blog/screen-terminal-emulator-cheat-sheet/ Show Sample Output


    11
    screen /dev/tty<device> 9600
    px · 2010-07-20 09:12:13 35
  • Will edit *.db files in the same directory with todays date. Useful for doing a mass update to domains on a nameserver, adding spf records, etc. Looks for a string starting with 200 or 201 followed by 7 numbers, and replaces with todays date. This won't overwrite Ip's but i would still do some double checking after running this. Make sure your server's date is correct, otherwise insert your own serial number. rndc reload should usually follow this command.


    7
    sed -i 's/20[0-1][0-9]\{7\}/'`date +%Y%m%d%I`'/g' *.db
    alf · 2010-03-24 07:28:58 10
  • I had a hard time in finding the correct settings to get reasonable output from a coin selector which sends its data over a serial line. In the end, minicom came to the rescue and pointed me on the right track. So, if you need to do something similar, these settings may help you. Replace ttyUSB0 with your device file, 9600 with your baud rate, 5 with your read timeout (10ths of a second), and 1 with the minimum numbers of characters you want to read. You can then open the device file like you are used to do, example: DATA="`xxd -ps -l 5 \"$DEV\"`"


    1
    stty -F "/dev/ttyUSB0" 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke time 5 min 1 line 0
    Alanceil · 2009-03-20 14:48:32 8
  • Requires software found at: http://lpccomp.bc.ca/remserial/ Remote [A] (with physical serial port connected to device) ./remserial -d -p 23000 -s "115200 raw" /dev/ttyS0 & Local [B] (running the program that needs to connect to serial device) Create a SSH tunnel to the remote server: ssh -N -L 23000:localhost:23000 user@hostwithphysicalserialport Use the locally tunnelled port to connect the local virtual serial port to the remote real physical port: ./remserial -d -r localhost -p 23000 -l /dev/remser1 /dev/ptmx & Example: Running minicom on machine B using serial /dev/remser1 will actually connect you to whatever device is plugged into machine A's serial port /dev/ttyS0.


    1
    remserial -d -p 23000 -s "115200 raw" /dev/ttyS0 &
    phattmatt · 2012-11-19 17:56:02 5
  • Create a serial console with "socket (named pipe)" of "/tmp/socket", "from:server, to:virtual machine" in vmware player, etc.. gui. Run the above command after you have booted the guest OS (which should also be configured for serial console).


    1
    socat unix-connect:/tmp/socket stdio,echo=0,raw
    mhs · 2012-12-19 07:58:09 8
  • When you need to add another tty device that can automatically start at boot time


    0
    sudo mknod /dev/ttyS4 c 4 68
    0disse0 · 2009-09-05 09:12:44 4

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

force unsupported i386 commands to work on amd64
The above was done using the i386 flashplayer plugin, and was installed on a AMD64 machine running an AMD64 kernel and AMD64 programs. the resulting plugin install ultimately didn't work for swiftfox (but worked for iceweasel) without also covering it with a nspluginwrapper which took a bit of fenangaling to get to work (lots of apt-getting) but it is a nice feature to be able to trick installers that think you need i386 into running on a amd64, or at least attempting to run on amd64. Enjoy

Gets the english pronunciation of a phrase
Usage examples: say hello say "hello world" say hello+world

Generat a Random MAC address
Generate a random MAC address with capital letters

Extract tarball from internet without local saving

Check whether laptop is running on battery or cable
The original proc file doesn't exist on my system.

Install pip with Proxy
Installs pip packages defining a proxy

Track X Window events in chosen window
After executing this, click on a window you want to track X Window events in. Explaination: "xev will track events in the window with the following -id, which we get by greping window information obtained by xwininfo"

dont execute command just add it to history as a comment, handy if your command is not "complete" yet

list files recursively by size

Get the IP address
gives u each configured IP in a seperate line.


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: