brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ ls -l total 120 -rwxr-xr-x 1 brock users 1782 Mar 29 22:31 jsonserA.py -rwxr-xr-x 1 brock users 1810 Mar 29 22:32 jsonserB.py -rw-r--r-- 1 brock users 2144 Mar 29 22:50 jsonserC.py -rw-r--r-- 1 brock users 2208 Mar 29 22:53 jsonserD.py -rw-r--r-- 1 brock users 1303 Mar 29 23:23 jsonserE.py -rw-r--r-- 1 brock users 2214 Mar 29 23:08 jsonserE.py~ -rw-r--r-- 1 brock users 1593 Mar 29 23:56 jsonserF.py -rw-r--r-- 1 brock users 1304 Mar 29 23:25 jsonserF.py~ -rw-r--r-- 1 brock users 78 Mar 29 17:25 notes -rw-r--r-- 1 brock users 36432 Mar 29 23:56 #runningA.txt# -rw-r--r-- 1 brock users 35131 Mar 29 23:53 runningA.txt -rwxr-xr-x 2 brock users 952 Mar 29 12:54 squares -rwxr-xr-x 2 brock users 952 Mar 29 12:54 squares3.py -rwxr-xr-x 1 brock users 943 Mar 29 12:49 squares.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ diff squares.py squares3.py 1c1 < #! /usr/bin/python --- > #! /usr/bin/python3 13,15c13,15 < except socket.error, message: < print "Unable to connnect to echo server at {}:\n {}".format( < remote_host, str(message)) --- > except socket.error as message: > print("Unable to connnect to echo server at {}:\n {}".format( > remote_host, str(message))) 22c22 < print in_stream.readline().rstrip() --- > print(in_stream.readline().rstrip()) 30c30 < print "Connecting to {}".format(remote_host) --- > print("Connecting to {}".format(remote_host)) brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ ls jsonserA.py jsonserD.py jsonserF.py #runningA.txt# squares3.py jsonserB.py jsonserE.py jsonserF.py~ runningA.txt squares.py jsonserC.py jsonserE.py~ notes squares brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserA.py File "jsonserA.py", line 36 except socket.error, message: ^ SyntaxError: invalid syntax brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ !! python3 jsonserA.py opening 3210  [1]+ Stopped python3 jsonserA.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ bg [1]+ python3 jsonserA.py & brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ netcat localhost 3210 Connected to ('127.0.0.1', 46709) "4" Input line --> "4" Object --> 4 "4" Input line --> brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ jobs [1]+ Done python3 jsonserA.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserB.py opening 3210  [1]+ Stopped python3 jsonserB.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ bg [1]+ python3 jsonserB.py & brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ echo "<\"Spring\", 2018>" | netcat localhost 3210 Connected to ('127.0.0.1', 46720) Input line --> <"Spring", 2018> brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ netcat localhost 3210 Connected to ('127.0.0.1', 46737) "hello" Input line --> "hello" Object --> hello "hello" 5 Input line --> 5 Object --> 5 5 Input line --> brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ kpbs No command 'kpbs' found, did you mean: Command 'gpbs' from package 'gnustep-gpbs' (universe) Command 'xpbs' from package 'torque-client-x11' (universe) Command 'apbs' from package 'apbs' (universe) kpbs: command not found brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ ps PID TTY TIME CMD 3886 pts/16 00:00:00 bash 5057 pts/16 00:00:00 python3 5087 pts/16 00:00:00 ps brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ w 09:02:11 up 78 days, 19:17, 2 users, load average: 0.00, 0.01, 0.05 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT brock pts/12 uncacsci-pi3-v.c Wed10 44:38m 15.56s 15.51s emacs brock pts/15 68-189-173-76.dh 07:41 1:06m 16.48s 16.41s emacs brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ fg python3 jsonserB.py   Traceback (most recent call last): File "jsonserB.py", line 58, in server_rc = echo_json_server(remote_port) File "jsonserB.py", line 41, in echo_json_server connected_socket, address_socket = echo_socket.accept() File "/usr/lib/python3.4/socket.py", line 187, in accept fd, addr = self._accept() KeyboardInterrupt brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ ls jsonserA.py jsonserC.py jsonserE.py~ notes squares jsonserB.py jsonserD.py jsonserF.py #runningA.txt# squares3.py jsonserB.py~ jsonserE.py jsonserF.py~ runningA.txt squares.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserA.py opening 3210 Connected to ('127.0.0.1', 46744) Input line --> "hello" Object --> hello Input line --> brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserB.py opening 3210 Connected to ('127.0.0.1', 46746) Input line --> 13 Object --> 13 Input line -->  Traceback (most recent call last): File "jsonserB.py", line 58, in server_rc = echo_json_server(remote_port) File "jsonserB.py", line 41, in echo_json_server connected_socket, address_socket = echo_socket.accept() File "/usr/lib/python3.4/socket.py", line 187, in accept fd, addr = self._accept() KeyboardInterrupt brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ diff jsonserA.py jsonserB.py 2c2 < """ One connection JSON echo --- > """ One at-a-time JSON echo 39,42c39,43 < echo_socket.listen(1) < connected_socket, address_socket = echo_socket.accept() < print("Connected to {}\n".format(address_socket)) < echo_json(connected_socket) --- > echo_socket.listen(5) > while True: > connected_socket, address_socket = echo_socket.accept() > print("Connected to {0}\n".format(address_socket)) > echo_json(connected_socket) brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ diff jsonserB.py jsonserC.py 2c2 < """ One at-a-time JSON echo --- > """ Concurrent connections JSON echo 6a7 > import os 36c37 < except socket.error as message: --- > except socket.error, message: 43c44,54 < echo_json(connected_socket) --- > process_id = os.fork() > if process_id == 0: > # child process > echo_socket.close() > echo_json(connected_socket) > # ZZZZZZZZZZ > sys.exit(0) > else: > # parent process > print("Started child process {0}".format(process_id)) > connected_socket.close() brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserC.py File "jsonserC.py", line 37 except socket.error, message: ^ SyntaxError: invalid syntax brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ diff jsonserB.py jsonserC.py 2c2 < """ One at-a-time JSON echo --- > """ Concurrent connections JSON echo 6a7 > import os 43c44,54 < echo_json(connected_socket) --- > process_id = os.fork() > if process_id == 0: > # child process > echo_socket.close() > echo_json(connected_socket) > # ZZZZZZZZZZ > sys.exit(0) > else: > # parent process > print("Started child process {0}".format(process_id)) > connected_socket.close() brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserC.py opening 3210 Connected to ('68.189.173.76', 54053) Started child process 5157 Input line --> "hello" Object --> hello Connected to ('68.189.173.76', 54055) Started child process 5263 Input line --> 2 Object --> 2 Input line --> Input line --> "V" Object --> V Input line -->  Traceback (most recent call last): File "jsonserC.py", line 69, in server_rc = echo_json_server(remote_port) File "jsonserC.py", line 42, in echo_json_server connected_socket, address_socket = echo_socket.accept() File "/usr/lib/python3.4/socket.py", line 187, in accept fd, addr = self._accept() KeyboardInterrupt brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserD.py opening 3210 Connected to ('68.189.173.76', 54069) Started child process 5267 Input line --> "hello" Object --> hello Connected to ('68.189.173.76', 54070) Started child process 5268 Input line --> 1 Object --> 1 Input line --> 2 Object --> 2 Input line --> 4 Object --> 4 Input line --> Input line --> 5 Object --> 5  Traceback (most recent call last): Traceback (most recent call last): File "jsonserD.py", line 71, in File "jsonserD.py", line 71, in server_rc = echo_json_server(remote_port) File "jsonserD.py", line 50, in echo_json_server server_rc = echo_json_server(remote_port) File "jsonserD.py", line 44, in echo_json_server echo_json(connected_socket) File "jsonserD.py", line 18, in echo_json connected_socket, address_socket = echo_socket.accept() File "/usr/lib/python3.4/socket.py", line 187, in accept fd, addr = self._accept() json_line = in_stream.readline().strip() File "/usr/lib/python3.4/socket.py", line 374, in readinto KeyboardInterrupt return self._sock.recv_into(b) KeyboardInterrupt brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ ls jsonserA.py jsonserC.py~ jsonserE.py~ #runningA.txt# runningB.txt~ jsonserB.py jsonserD.py jsonserF.py runningA.txt squares jsonserB.py~ jsonserD.py~ jsonserF.py~ #runningB.txt# squares3.py jsonserC.py jsonserE.py notes runningB.txt squares.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ history 43 ls -l 44 greo brock * 45 grep brock * 46 more virtual 47 ls -l 48 diff virtual* 49 diff virtual virtual~ 50 sudo emacs virtual 51 ls -l 52 sudo newaliases 53 ls -l 54 more virtual 55 sudo rm virtual~ 56 ls /etc/ali* 57 ls -l /etc/aliases* 58 date 59 cd /et 60 cd /etc/ 61 ls 62 grep brock aliases.db 63 grep bruce aliases.db 64 ls -l 65 fg 66 df 67 more /etc/fstab 68 exit 69 df 70 cd /mnt/embedded/ 71 ls 72 cd RaspberryPi/ 73 ls 74 cd distributions/ 75 df . 76 wget https://downloads.raspberrypi.org/raspbian_latest 77 w 78 df 79 ls 80 ssh burningtown 81 ssh uncacsci@burningtown 82 exit 83 ls -lt | more 84 ls ~/Desktop/ 85 pwd 86 find . -name "*.odt" -mtime -5 87 find . -name "*.ods" -mtime -5 88 cd .config 89 ls 90 cd libreoffice/ 91 ls 92 cd 4 93 ls -l 94 cd user 95 ls 96 ls -l 97 ls backup/ 98 ssh burningtown 99 cd 100 cd ~/Desktop/ 101 ls -lt | head -5 102 cd ~/Downloads/ 103 ls -lt | head -5 104 cd 105 ls -lt | head -5 106 ls -l 107 cd public_html 108 ls 109 cd scripts/ 110 ls 111 more underpants.cgi 112 ls 113 more underpants.html 114 cd public_html/scripts/ 115 ls 116 ls -l underpants.* 117 cd .. 118 find . -name "*.html" -exec grep underpants {} \; | more 119 find . -name "*.html" -exec grep underpants {} \; -print | more 120 cd ../ 121 cd scripts 122 ls 123 ls -l 124 more underpants.h 125 more underpants.html 126 ls 127 cd .. 128 cd comparch/ 129 ls 130 more min0defn.cgi 131 ls -l 132 more *.cgi 133 cd classes 134 ls 135 cd 235 136 ls 137 cd s18 138 ls 139 more e1ans.txt 140 ls -l 141 exit 142 pwd 143 cd classes 144 ls 145 cd 235 146 ls 147 cd s18 148 emacs 149 cd public_html/ 150 ls 151 cd cgiplay/ 152 ls 153 cd .. 154 cd scripts/ 155 ls 156 more underpants.cgi 157 exit 158 ls -l 159 rm XERCISES.PDF 160 chmod 755 MailClass 161 ./MailClass 162 emacs 163 exit 164 fg 165 exit 166 ls 167 emacs 168 cd classes 169 ls 170 cd ~/public_html/classes/ 171 ls 172 cd Fall2017/ 173 ls 174 cd csci235 175 ls 176 grep cmu * 177 ls 178 emacs lectures.shtml 179 find . -type f -mtime -2 180 cd 181 find . -type f -mtime -2 182 cd public_html/classes/Fall2017/ 183 ls -l 184 cd csci235 185 ls 186 ls -l misc* 187 date 188 mv misc1.html ../../Spring2018/csci235 189 emacs 190 ls 191 pwd 192 cd csci235 193 pwed 194 pwd 195 ls 196 cd notes 197 ls 198 ls -l 199 ls chap03.html 200 more chap03.html 201 more Chap03.html 202 rm chap03.html 203 ls -l 204 fg 205 cd classes 206 ls 207 cd 235 208 ls 209 cd s18 210 ls 211 cd Exam1/ 212 ls 213 cd .. 214 sftp brock@penrose 215 cd ~/classes/373 216 ls 217 cd s18 218 ls 219 emacs book.stuff 220 ping iotla 221 ssh iotla 222 ubuntulogin "ls -ld /home/brock" 223 6mmAirS0f$ 224 exit 225 jobs 226 fg 227 cd classes 228 ls 229 cd 235 230 ls 231 cd s18 232 ls 233 cd Exam1/ 234 ls 235 cd classes 236 ls 237 cd 235 238 ls 239 cd s18 240 ls 241 cd Exam1 242 ls 243 more MailSend 244 ls 245 sh MailSend 246 ls -l Fr* 247 emacs 248 date 249 fg 250 cd ~/public_html/ 251 find . -name "othello*" 252 cd scripts 253 ls 254 more othello.html 255 ls 256 more checker.html 257 fg 258 exit 259 /usr/bin/mutt -s "Exam 1" -a "Friedman.PDF" -- cfriedma@unca.edu@unca.edu < /dev/null 260 /usr/bin/mutt -s "Exam 1" -a "Friedman.PDF" -- cfriedma@unca.edu < /dev/null 261 cd /home/brock/public_html/ 262 ls 263 ls -l scripts/ 264 ubuntulogin "ls -ld /home/brock" 265 ls ~/bin/*login* 266 brocklogin "ls -ld /home/brock" 267 exit 268 ssh uncacsci-pi-j 269 exit 270 ssh uncacsci@cowee 271 cheese & 272 cd ~brock/public_html/scripts/ 273 emacs -nw 274 ls 275 more underpants.html 276 more underpants.cgi 277 more checker.html 278 more checker.cgi 279 ls -l 280 wc *.cgi 281 nano 282 ssh uncacsci-pi-j 283 ntpdc 284 date 285 brocklogin "ls -ld /home/brock" 286 exit 287 emacs 288 cheese 289 exit 290 id 291 lsusb 292 emacs 293 ls -lt 294 make 295 ./deass 296 make 297 ./deass 298 gcc -Og -S testit.c 299 gcc -Og -S -std=c99 testit.c 300 make 301 ls 302 make 303 ls -l 304 make deassm 305 ls -l 306 make 307 ./deassm 308 ls 309 mv testit.c testit-orig.c 310 mv testita.s testit.s 311 la 312 rm deass 313 rm deassm 314 ls -l 315 rm *.o 316 rm otestita.s 317 make 318 make clean 319 ls 320 make 321 ./deass 322 w 323 jobs 324 netstat -nlp 325 netstat -nlp | more 326 netstat -nlp | more 327 emacs 328 man getline 329 fg 330 cat > /dev/null 331 fg 332 cal 4 2018 333 fg 334 cd ~/classes 335 ls 336 fg 337 ls -l 338 fg 339 ~ 340 exit 341 fg 342 exit 343 cd classes 344 ls 345 cd 235 346 ls 347 cd s17 348 cd ../373 349 ls 350 cd s18 351 ls 352 cd ~/csci373 353 ls 354 cd notes/ 355 ls 356 emacs Class22.html 357 cd 358 git clone https://github.com/adafruit/Adafruit_Python_PCA9685 359 ssh uncacsci-pi-j 360 cheese & 361 emacs 362 ssh uncacsci-pi-j 363 exit 364 ping uncacsci-pi-h 365 ssh uncacsci@uncacsci-pi-h 366 exit 367 emacs 368 man perror 369 man 3 perror 370 fg 371 exit 372 chromium-browser & 373 cheese & 374 id 375 lsusb 376 /usr/local/bin/arduino & 377 emacs 378 exit 379 emacs 380 nc -l 3730 381 bg 382 nc 3730 383 jobs 384 man nc 385 nc 127.0.0.1 3730 386 jobs 387 bg %2 388 jobs 389 ssh brock@uncacsci-pi-j 390 ssh-copy-id brock@uncacsci-pi-j 391 nc uncacsci-pi-j 4444 392 w 393 ping www.ucla.edu 394 traceroute www.ucla.edu 395 emacs 396 bg 397 ifconfig 398 more /etc/ntp.conf 399 netcat uncacsci-pi-j 5555 400 ping 10.123.20.44 401 traceroute 10.123.20.44 402 sudo apt-get install inetutils-traceroute 403 cheese 404 emacs 405 nc -l 3739 406 emacs 407 date 408 fg 409 ntpdc 410 ssh uncacsci-pi3-v 411 sudo shutdown -r now 412 ssh uncacsci@burningtown 413 ping uncacsci-pi2-c 414 ssh uncacsci-pi2-c 415 ssh uncacsci@uncacsci-pi2-c 416 fg 417 mkinitramfs 418 which mkinitramfs 419 ls - /usr/sbin/mkinitramfs 420 ls -l /usr/sbin/mkinitramfs 421 more /usr/sbin/mkinitramfs 422 jobs 423 fg 424 date 425 fg 426 netstat 427 w 428 fg 429 ping 68.189.175.76 430 nslookup 68.189.175.76 431 fg 432 ping 76.175.189.68 433 ssh 76.175.189.68 434 fg 435 nslookup 68.189.175.76 436 ssh brock@68.189.175.76 437 ping 68.189.175.76 438 fg 439 man netcat 440 fg 441 echo -e "GET http://www.unca.edu HTTP/1.0\n\n" | nc www.unca.edu 80 442 echo -e "GET https://www.unca.edu HTTP/1.0\n\n" | nc www.unca.edu 80 443 echo -e "GET http://www.cs.unca.edu HTTP/1.0\n\n" | nc www.cs.unca.edu 80 444 echo -e "GET index.html HTTP/1.0\n\n" | nc www.cs.unca.edu 80 445 echo -e "GET index.html HTTP/1.1\n\n" | nc www.cs.unca.edu 80 446 nc www.cs.unca.edu 447 nc www.cs.unca.edu 80 448 fg 449 ncat 450 fg 451 man ncat 452 ncat arden 22 453 fg 454 which nc 455 man nc 456 man netcat 457 fg 458 ncat 459 which ncat 460 which nc 461 which netcat 462 ls -l /bin/netcat /bin/nc 463 fg 464 ifconfig 465 netstat 466 ipconfig 467 ifconfig 468 man ifconfig 469 ifconfig eth0 470 netstat -r 471 netstat -rn 472 fg 473 printf "GET / HTTP/1.0\r\n\r\n" | nc host.example.com 80 474 printf "GET / HTTP/1.0\r\n\r\n" | nc www.cs.unca.edu 80 475 printf "GET /brock/classes/Spring2018/csci373/notes/Class25.html HTTP/1.0\r\n\r\n" | nc www.cs.unca.edu 80 476 printf "GET /brock/classes/Spring2018/csci373/notes/Class25.html HTTP/1.0\r\n\r\n" nc www.cs.unca.edu 80 477 printf "GET /brock/classes/Spring2018/csci373/notes/Class25.html HTTP/1.0\r\n\r\n" | nc www.cs.unca.edu 80 478 ssh arden 479 nc uncacsci-pi3-v 2000 480 nc uncacsci-pi3-v 2400 481 nc uncacsci-pi3-v 2000 482 dig 483 dig @unca.edu 484 dig unca.edu 485 dig arden.cs.unca.edu 486 dig www.unca.edu 487 ssh uncacsci-pi3-v 488 ssh uncacsci-pi3-v 489 ssh uncacsci-pi3-v 490 python 491 ifconfig 492 ipconfig 493 ls -l com* 494 pwd 495 ls ~/bin 496 df 497 ssh burningtown 498 chromium-browser 499 bg 500 cd classes/235 501 ls 502 cd s18 503 ls 504 emacs e1ans.txt 505 bg 506 ls -lt | head -5 507 chromium-browser 508 ls -l 509 cheese 510 bg 511 lsusb 512 ls -lt /dev/ttyACM0 513 git clone https://gist.github.com/nicksort/4736535 514 cd 4736535/ 515 ls 516 ls -l 517 more Arduino\ Song 518 find . -name "*.sv" 519 cd ~/csci235 520 ls 521 cd notes 522 ln ~/classes/320/s14/home07/Brock.sv ancienttimes.sv 523 ln ~/classes/320/s14/home07/BrockTB.sv ancienttimesTB.sv 524 wget http://tug.org/cgi-bin/mactex-download/MacTeX.pkg 525 emacs 526 cd ~/Downloads/ 527 ls -lt | head -5 528 fg 529 cd ~/classes 530 find . -name "*.sv" -exec ls -l {} \; 531 emacs 532 jobs 533 fg 534 cd 535 ls -lt | head 05 536 ls -lt | head -5 537 date 538 w 539 ls -lt | head -7 540 last | more 541 fg 542 cd ~/public_html/ 543 find . -name "*.cgi" 544 emacs 545 cd ~/csci255 546 find . -type f -mtime -3 547 cd ~/csci235 548 ls 549 grep Data * 550 emacs lectures.shtml 551 date 552 fg 553 cd ~/csci235 554 cd labs 555 ls 556 sleep 10 ; xwd > densor.swd 557 ls -l 558 mv densor.swd densor.xwd 559 xwd2png densor.xwd 560 ls -l 561 rm densor.xwd 562 ls -l ~/Downloads/Po* 563 mv ~/Downloads/Powerful\ Densor\ \(1\).png Powerful\ Densor.png 564 mv ~/Downloads/Daughter\ of\ Powerful\ Densor.png . 565 gimp Powerful\ Densor.png 566 cat > Daughter\ of\ Powerful\ Densor.txt 567 ls -l 568 cat > Powerful\ Densor.txt 569 ls 570 mkdir analogLab1 571 cd analogLab1/ 572 mv ~/Downloads/Powerful\ Densor\ 2.png . 573 cat > Powerful\ Densor\ 2.txt 574 mv ~/Downloads/Powerful\ Densor\ 3.png . 575 ls -l 576 cat > Powerful\ Densor\ 3.txt 577 ls -l 578 emacs 579 bg 580 cp ~/public_html/classes/Spring2017/csci255/labs/bitsandstructures/index.html . 581 ls -l 582 emacs index.html 583 bg 584 latex 585 find . -name "*.sb" -print 586 cd public_html/ 587 find . -name "*.sb" -print 588 cd scratch 589 ls 590 grep deM * 591 scratch 592 chmod 755 servit.py 593 ./servit.py 594 python servit.py & 595 python servit2.py & 596 nc localhost 9999 597 python 598 python servit2.py 599 bg 600 nc localhost 3210 601 bg 602 jobs 603 kill %2 604 kill %1 605 kill %3 606 python servit2.py & 607 ps gaux | grep python 608 python servit2.py & 609 nc localhost 3210 610 fg 611 jobs 612 python 613 python servit2.py 614 n 615 nc localhost 3210 616 jobs 617 kill %1 618 python servit2.py & 619 nc localhost 3210 620 python servit2.py & 621 socket.error: [Errno 98] Address already in use 622 jobs 623 kill %1 624 python servit2.py 625 python servit2.py & 626 nc localhost 3210 627 jobs 628 kill %1 629 python servit2.py & 630 nc 3210 631 netcat localhost 3210 632 python2 servit2.py 633 jobs 634 kill %1 635 python2 servit2.py & 636 jobs 637 netcat localhost 3210 638 python servit2.py & 639 jobs 640 fg 641 python servit2.py & 642 netcat localhost 3210 643 python 644 python servit2.py 645 jobs 646 kill %1 647 python servit2.py 648 jobs 649 python servit2.py 650 python servit3.py 651 python servitS.py 652 cd csci373 653 ls 654 cd notes 655 ls 656 emacs 657 which python3 658 fg 659 python ./servit.py 660 python3 ./servit.py 661 fg 662 python servit2.py 663 fg 664 which python 665 fg 666 jobs 667 fg 668 jobs 669 netstat -nlpt | more 670 fg 671 netcat 3210 672 netcat localhost 3210 673 cd csci373 674 ls 675 cd notes 676 ls 677 emacs servitS.py 678 netcat localhost 7 679 netcat localhost 7000 680 netcat localhost 6000 681 netcat localhost 53 682 cd /etc/ 683 ls 684 more inetd.conf 685 exit 686 fg 687 exit 688 cd 689 cd public_html 690 emacs registration.html 691 date 692 fg 693 cd /etc 694 ls 695 ls in* 696 ls -ld in* 697 cd /boot 698 ls 699 file initrd.img-3.13.0-* 700 ls 701 ls- l 702 ls -l 703 cp initrd.img-3.13.0-141-generic /var/tmp 704 cd /var/tmp 705 file initrd* 706 ls -l 707 ls initrd 708 ls -ld initrd 709 gunzip < initrd.img-3.13.0-141-generic 710 gunzip < initrd.img-3.13.0-141-generic | cpio 711 man cpio --usage 712 gunzip < initrd.img-3.13.0-141-generic | cpio -i 713 ls -ld | more 714 ls -l | more 715 ls initrd 716 ls -lt | head -5 717 ls -lt | head -10 718 ls -lt | head -15 719 rm -rf etc sbin/ bin/ init conf/ lib lib64/ run/ var 720 ls -lt | head -15 721 rm -rf scripts & 722 mkdir init 723 cd init 724 ls 725 ls /boot 726 gunzip /boot/initrd.img-3.13.0-139-generic | cpio -i 727 gunzip < /boot/initrd.img-3.13.0-139-generic | cpio -i 728 ls -l 729 ls -lt | more 730 ls -lR | more 731 du -s . 732 ls -l 733 ls -l /boot/initrd.img-3.13.0-141-generic 734 dc 735 binwalk 736 sudo apt-get install binwalk 737 man binwalkk 738 man binwalk 739 dc 740 emacs 741 ping uncacsci-pi3-v 742 nc uncacsci-pi3-v 7 743 fg 744 telnet 745 man telnet 746 telnet uncacsci-pi3-v 7 747 fg 748 netcat 749 fg 750 python 751 jobs 752 kill %1 753 python 754 nslookup 152.18.69.144 755 netcat localhost 3210 756 exit 757 telnet uncacsci-pi3-v 7 758 python 759 emacs -nw 760 netstat -nlpt 761 fg 762 netstat -npt 763 netstat -npt | more 764 fg 765 netstat -npt | more 766 netstat -pt | more 767 nano 768 ls -l 769 ls -lt | more -5 770 fg 771 ls -l socketplay.py 772 chmod a+x {} 773 chmod a+x socketplay.py 774 ./socketplay.py 775 fg 776 jobs 777 nano socketplay.py 778 ./socketplay.py 779 nano socketplay.py 780 ./socketplay.py 781 nano socketplay.py 782 ./socketplay.py 783 nano socketplay.py 784 ./socketplay.py 785 nano socketplay.py 786 ./socketplay.py 787 fg 788 nano socketplay.py 789 cd /home/brock/public_html/ 790 cd classes/Spring2011/csci373/ 791 ls 792 cd lectures/ 793 ls 794 cd pylib 795 grep makefile * 796 popd 797 cd 798 ls -lt *.py 799 nano socketplay.py 800 python socketplay.py 801 nano socketplay.py 802 python socketplay.py 803 nano socketplay.py 804 python socketplay.py 805 nano socketplay.py 806 nano 807 python myserver.py 808 ssh uncacsci-pi3-v 809 netstat -nlpt 810 emacs public_html/registration.html 811 cal 4 2018 812 fg 813 date 814 fg 815 cheese & 816 cat > ~/public_html/program.ino 817 cd public_html/ 818 mv program.ino program.txt 819 dc 820 cd csci373 821 ls 822 cd notes 823 ls 824 ls -lt | head -5 825 cd 826 find . -name "*.py" -mtime -5 827 more socketplay.py 828 mkdir ~/classes/notes/sockets 829 mkdir ~/csci373/notes/sockets 830 ls *.py 831 ls -l *.py 832 rm myserver.py socketplay.py ~/csci373/notes/sockets 833 jobns 834 cd ~/csci373/notes/sockets 835 ls 836 ls -l 837 emacs 838 fg 839 chmod 755 squares.py 840 ./squares.py 841 fg 842 ./squares.py 843 fg 844 ./squares.py 845 fg 846 ./squares.py 847 ./squares.py arden 848 fg 849 pyline squares.py 850 pylint squares.py 851 fg 852 pylint squares.py 853 fg 854 pylint squares.py 855 pylint squares.py | more 856 fg 857 chmod 755 . 858 rm *.py~ 859 cd ~/csci373 860 ls 861 cd notes 862 ls 863 pwd 864 cd sockets 865 python squares.py 866 echo $$ 867 echo $? 868 python squares.py 869 pylint squares.py 870 pylint3 871 pylint squares.py 872 python squares.py 873 echo $? 874 python squares.py 875 pylint squares.py uncacsca-pi3-v 876 python squares.py uncacsca-pi3-v 877 python squares.py uncacsci-pi3-v 878 job 879 jobs 880 ls 881 python squares.py 882 python squares.py uncacsci-pi3-v 883 python squares.py 884 python squares.py ughsville 885 pyline squares.py 886 pylint squares.py 887 ./squares.py 888 ./squares.py uncacsci-pi3-v 889 python3 squares3.py 890 python3 squares3.py uncacsci-pi3-v 891 python squares3.py 892 python squares3.py uncacsci-pi3-v 893 ls -l 894 rm *~ 895 ls -l 896 more squares3.py 897 ls -l 898 chmod 755 squares3.py 899 ln squares3.py squares 900 ls -l 901 ./squares uncscsci-pi3-v 902 ./squares uncacsci-pi3-v 903 ls -l 904 cd csci373 905 ls 906 cd notes 907 ls 908 cd sockets 909 ls 910 pushd ~/public_html/classes/Spring2011/csci373/ 911 ls 912 cd lectures/ 913 ls 914 cd pylib/ 915 ls 916 emacs 917 netcat arden.cs.unca.edu 3210 918 fg 919 python 920 fg 921 ls 922 cd sockets/ 923 ls 924 python jsonserA.py 925 bg 926 netcat localhost "" 927 netcat localhost 3210 928 jobs 929 python jsonserA.py & 930 netcat localhost 3210 931 jobs 932 python jsonserA.py 933 bg 934 netcat localhost 3210 935 jobs 936 python jsonserA.py & 937 netcat localhost 3210 938 jobs 939 python jsonserA.py & 940 netcat localhost 3210 941 jobs 942 python jsonserA.py & 943 python jsonserA.py 944 bg 945 netcat localhost 3210 946 jobs 947 ls -l jsonser* 948 chmod 755 jsonserA.py 949 chmod 755 jsonserB.py 950 python jsonserB.py & 951 netcat localhost 3210 952 jobs 953 fg 954 bg 955 netcat localhost 3210 956 jobs 957 kill %1 958 echo "-- had to fix a problem" 959 python jsonserB.py & 960 netcat localhost 3210 961 jobs 962 diff jsonserA.py jsonserB.py 963 python jsonserA.py 964 jobs 965 kill %1 966 python jsonserA.py 967 python jsonserB.py 968 diff jsonserB.py jsonserC.py 969 diff jsonserA.py jsonserB.py 970 diff jsonserB.py jsonserC.py 971 python jsonserC.py 972 python jsonserC.py & 973 netcat localhost 3210 974 jobs 975 python jsonserC.py & 976 netcat localhost 3210 977 ps gaux | grep python 978 fg 979 jobs 980 fg 981 python jsonserC.py & 982 jobs 983 kill %1 984 python jsonserC.py & 985 jobs 986 python jsonserC.py & 987 ps gaux | grep python 988 jobs 989 kill %1 990 ps gaux | grep python 991 diff jsonserC.py jsonserD.py 992 python jsonserD.py 993 ps gaux | grep python 994 fg 995 ps gaux | grep python 996 python jsonserE.py 997 jobs 998 kill %1 999 diff jsonserD.py jsonserE.py 1000 python jsonserE.py & 1001 jobs 1002 kill %1 1003 python jsonserE.py 1004 python jsonserF.py 1005 jobs 1006 ps gaux | grep python 1007 python jsonserF.py 1008 w 1009 jobs 1010 kill -KILL %1 1011 jobs 1012 python jsonserF.py 1013 jobs 1014 kill -KILL %1 1015 jobs 1016 python jsonserF.py 1017 ls -l 1018 diff squares.py squares3.py 1019 ls 1020 python3 jsonserA.py 1021 bg 1022 netcat localhost 3210 1023 jobs 1024 python3 jsonserB.py 1025 bg 1026 echo "<\"Spring\", 2018>" | netcat localhost 3210 1027 netcat localhost 3210 1028 kpbs 1029 ps 1030 w 1031 fg 1032 ls 1033 python3 jsonserA.py 1034 python3 jsonserB.py 1035 diff jsonserA.py jsonserB.py 1036 diff jsonserB.py jsonserC.py 1037 python3 jsonserC.py 1038 diff jsonserB.py jsonserC.py 1039 python3 jsonserC.py 1040 python3 jsonserD.py 1041 ls 1042 history brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ chmod jsonserC.py 755 chmod: invalid mode: ‘jsonserC.py’ Try 'chmod --help' for more information. brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ chmod 755 jsonserC.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ chmod 755 jsonserD.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ diff jsonserC.py jsonserD.py 2c2 < """ Concurrent connections JSON echo --- > """ Concurrent connections without Zombies JSON echo 7a8 > import signal 40a42 > signal.signal(signal.SIGCHLD, signal.SIG_IGN) brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ chmod 755 jsonserE.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ diff jsonserD.py jsonserE.py 2c2 < """ Concurrent connections without Zombies JSON echo --- > """ With class but one-at-a-time using JSON echo 4c4 < import socket --- > import SocketServer 7,8d6 < import os < import signal 28,32d25 < in_stream.close() < out_stream.close() < # This will close the client socket < json_socket.close() < return 0 34,59c27,32 < def echo_json_server(json_port): < echo_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) < try: < echo_socket.bind(("", json_port)) < except socket.error as message: < print("Unable to open port {} : {}".format(json_port, message)) < return 1 < echo_socket.listen(5) < signal.signal(signal.SIGCHLD, signal.SIG_IGN) < while True: < connected_socket, address_socket = echo_socket.accept() < print("Connected to {0}\n".format(address_socket)) < process_id = os.fork() < if process_id == 0: < # child process < echo_socket.close() < echo_json(connected_socket) < # ZZZZZZZZZZ < sys.exit(0) < else: < # parent process < print("Started child process {0}".format(process_id)) < connected_socket.close() < # This will close the server socket < echo_socket.close() < return 0 --- > class JSONHandler(SocketServer.BaseRequestHandler): > """ > Instantiated for each connection > """ > def handle(self): > echo_json(self.request) 70,72c43,46 < print("opening {0}".format(remote_port)) < server_rc = echo_json_server(remote_port) < sys.exit(server_rc) --- > server = SocketServer.TCPServer(("", remote_port), JSONHandler) > server.serve_forever() > > brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ diff jsonserD.py jsonserE.py 2c2 < """ Concurrent connections without Zombies JSON echo --- > """ With class but one-at-a-time using JSON echo 4c4 < import socket --- > import socketserver 7,8d6 < import os < import signal 28,32d25 < in_stream.close() < out_stream.close() < # This will close the client socket < json_socket.close() < return 0 34,59c27,32 < def echo_json_server(json_port): < echo_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) < try: < echo_socket.bind(("", json_port)) < except socket.error as message: < print("Unable to open port {} : {}".format(json_port, message)) < return 1 < echo_socket.listen(5) < signal.signal(signal.SIGCHLD, signal.SIG_IGN) < while True: < connected_socket, address_socket = echo_socket.accept() < print("Connected to {0}\n".format(address_socket)) < process_id = os.fork() < if process_id == 0: < # child process < echo_socket.close() < echo_json(connected_socket) < # ZZZZZZZZZZ < sys.exit(0) < else: < # parent process < print("Started child process {0}".format(process_id)) < connected_socket.close() < # This will close the server socket < echo_socket.close() < return 0 --- > class JSONHandler(socketserver.BaseRequestHandler): > """ > Instantiated for each connection > """ > def handle(self): > echo_json(self.request) 70,72c43,46 < print("opening {0}".format(remote_port)) < server_rc = echo_json_server(remote_port) < sys.exit(server_rc) --- > server = socketserver.TCPServer(("", remote_port), JSONHandler) > server.serve_forever() > > brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserE.py Input line --> 5 Object --> 5 Input line --> 7 Object --> 7 Input line --> Input line --> 6 Object --> 6  ---------------------------------------- Exception happened during processing of request from ('68.189.173.76', 54156) Traceback (most recent call last): File "/usr/lib/python3.4/socketserver.py", line 305, in _handle_request_noblock self.process_request(request, client_address) File "/usr/lib/python3.4/socketserver.py", line 331, in process_request self.finish_request(request, client_address) File "/usr/lib/python3.4/socketserver.py", line 344, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python3.4/socketserver.py", line 673, in __init__ self.handle() File "jsonserE.py", line 32, in handle echo_json(self.request) File "jsonserE.py", line 16, in echo_json json_line = in_stream.readline().strip() File "/usr/lib/python3.4/socket.py", line 374, in readinto return self._sock.recv_into(b) KeyboardInterrupt ----------------------------------------  [1]+ Stopped python3 jsonserE.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ jobs [1]+ Stopped python3 jsonserE.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ kill %1 brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ [1]+ Terminated python3 jsonserE.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserE.py  Traceback (most recent call last): File "jsonserE.py", line 45, in server.serve_forever() File "/usr/lib/python3.4/socketserver.py", line 236, in serve_forever poll_interval) File "/usr/lib/python3.4/socketserver.py", line 154, in _eintr_retry return func(*args) KeyboardInterrupt brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ jobs brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ diff jsonserE.py jsonserF.py 2,3c2,3 < """ With class but one-at-a-time JSON echo < Doesn't want to go away --- > """ With class and concurrently using threads > Doesn't want to stop 4a5 > import threading 34a36,38 > class JSONTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): > pass > 44,45c48,55 < server = socketserver.TCPServer(("", remote_port), JSONHandler) < server.serve_forever() --- > server = JSONTCPServer(("", remote_port), JSONHandler) > server_thread = threading.Thread(target=server.serve_forever) > server_thread.daemon = False > server_thread.start() > print("Running in thread {0}".format(server_thread.name)) > i=0 > while True: > i=i+1 brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ ls -l total 216 -rwxr-xr-x 1 brock users 1785 Mar 30 08:56 jsonserA.py -rwxr-xr-x 1 brock users 1813 Mar 30 08:59 jsonserB.py -rwxr-xr-x 1 brock users 1810 Mar 29 22:32 jsonserB.py~ -rwxr-xr-x 1 brock users 2150 Mar 30 09:07 jsonserC.py -rw-r--r-- 1 brock users 2144 Mar 29 22:50 jsonserC.py~ -rwxr-xr-x 1 brock users 2230 Mar 30 09:14 jsonserD.py -rw-r--r-- 1 brock users 2208 Mar 29 22:53 jsonserD.py~ -rwxr-xr-x 1 brock users 1326 Mar 30 09:34 jsonserE.py -rw-r--r-- 1 brock users 1303 Mar 29 23:23 jsonserE.py~ -rw-r--r-- 1 brock users 1609 Mar 30 09:36 jsonserF.py -rw-r--r-- 1 brock users 1593 Mar 29 23:56 jsonserF.py~ -rw-r--r-- 1 brock users 78 Mar 29 17:25 notes -rw-r--r-- 1 brock users 36432 Mar 29 23:56 #runningA.txt# -rw-r--r-- 1 brock users 35131 Mar 29 23:53 runningA.txt -rw-r--r-- 1 brock users 38355 Mar 30 09:35 #runningB.txt# -rw-r--r-- 1 brock users 36051 Mar 30 09:24 runningB.txt -rw-r--r-- 1 brock users 5365 Mar 30 09:02 runningB.txt~ -rwxr-xr-x 2 brock users 952 Mar 29 12:54 squares -rwxr-xr-x 2 brock users 952 Mar 29 12:54 squares3.py -rwxr-xr-x 1 brock users 943 Mar 29 12:49 squares.py brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$ python3 jsonserF.py File "jsonserF.py", line 55 i=i+1 ^ TabError: inconsistent use of tabs and spaces in indentation brock@arden:~/public_html/classes/Spring2018/csci373/notes/sockets$