CIFS mount SAMBA mount
∖∖192.168.xx.x∖mnt /mnt/avm cifs rw,username=xxx,password=xxx,uid=1000,gid=1000,iocharset=utf8,noauto,user,dir_mode=0755,file_mode=06
44,_netdev 0 0
SIOCOUTQ SIOCINQ
SIOCINQ
Returns the amount of queued unread data in the receive
buffer. Argument is a pointer to an integer. The socket
must not be in LISTEN state, otherwise an error (EINVAL)
is returned.
SIOCATMARK
Returns true when the all urgent data has been already
received by the user program. This is used together with
SO_OOBINLINE .
Argument is an pointer to an integer for the test result.
SIOCOUTQ
Returns the amount of unsent data in the socket send queue
in the passed integer value pointer. The socket must not
be in LISTEN state, otherwise an error (EINVAL)
is returned.
Linux provides a SIOCOUTQ ioctl() to query how much data is in the TCP output buffer:
http://www.kernel.org/doc/man-pages/online/pages/man7/tcp.7.html
You can use that, plus the value of SO_SNDBUF, to determine whether the outgoing buffer has enough space for any particular message. So strictly speaking, the answer to your question is "yes".
But there are two problems with this approach. First, it is Linux-specific. Second, what are you planning to do when there is not enough space to send your whole message? Loop and call select again? But that will just tell you the socket is ready for writing again, causing you to busy-loop.
For efficiency's sake, you should probably bite the bullet and just deal with partial writes; let the network stack worry about breaking your stream up into packets for optimal throughput.
linux serial communications
picocom -f n -p n -b 115200 -i -r -l /dev/ttyUSB0
picocom -b 115200 -l -r /dev/ttyUSB0 #OpenWrt
Exit: C-a C-x // Ctrl-C Ctrl-A Ctrl-X
screen /dev/ttyUSB0 115200
cu -l /dev/ttyUSB0 -s 115200
~. Drop the connection and exit.
ser2net
Sniffer:
jpnevulator --ascii --timing-print --tty /dev/ttyS0:SB9600d --tty "/dev/ttyUSB0:Motorola MTM800" --read
3G Modem
comgt {info,sig,reg} -d /dev/ttyUSB0
stty -F /dev/ttyUSB0
speed 115200 baud; line = 0;
-brkint -imaxbel
$ stty -F /dev/ttyUSB0 -a
speed 115200 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^∖; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
$ stty -F /dev/ttyUSB0 -g
500:5:1cb2:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
Ubuntu fix:
dialout:x:20:alex,rttymgr
id -Gn |grep dialout
sudo adduser $USER dialout
installed apps
To get a list of packages installed locally and save as a text file called packages on your desktop do this in your terminal:
dpkg --get-selections
sudo apt-get -y update
sudo apt-get dselect-upgrade
cat installed-applications.txt | cut -f 1 | tr "∖n" " "
dpkg --get-selections | grep -v deinstall > ~/Desktop/packages
cat ~/Desktop/packages > sudo dpkg --set-selections && sudo apt-get dselect upgrade
rcconf позволяет отключать при загрузке ненужные сервисы.
sysv-rc-conf позволяет делать то же самое, только на разных уровнях запуска.
dpkg --get-selections | grep -v "deinstall" вывести полный список установленных пакетов.
dpkg --get-selections > installed_programs.txt - сохранить список всех установленных в системе пакетов.
sudo dpkg --set-selections < installed_programs.txt
sudo apt-get -y update
sudo apt-get dselect-upgrade - установить все пакеты из списка.
COLUMNS=150 dpkg -l > packages.txt - краткая информация об установленных пакетах (версия пакета и краткое описание).