Computing Notes

Unix/Linux

Change a file in situ
find -name '*.html' | xargs grep -l 'Copyright 2021' | xargs sed -i '' -e 's/Copyright 2021/Copyright 2022/g'
Dealing with the amperstand
find -name "*.html" | xargs grep -l 'Copyright' | xargs sed -i '' -e 's/Copyright& 2019/Copyright\&/g'

Remove back up files
find -name '*~' | xargs rm

Remote Sync
rsync -avh --delete -e ssh ken@192.168.0.143:/home/ken/kas/new/ ./new

Change file and directory permissions
find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \;

Tape Archive excluding directories
tar --exclude="christmas*" -zcvf ../20220831_wp.tgz ./*

Endoscope

Original Information Website

1) Find USB devices
ken@swashplate:~$ usb-devices
...
T: Bus=02 Lev=02 Prnt=02 Port=03 Cnt=02 Dev#= 7 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=1e4e ProdID=0110 Rev=02.01
S: Manufacturer=Etron Technology, Inc.
S: Product=USB2.0 Camera
C: #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=100mA
I: If#=0x0 Alt= 0 #EPs= 1 Cls=0e(video) Sub=01 Prot=00 Driver=uvcvideo
I: If#=0x1 Alt= 0 #EPs= 0 Cls=0e(video) Sub=02 Prot=00 Driver=uvcvideo
...
2) List video devices
ken@swashplate:~$ ls -ltr /dev/video*
...
crw-rw----+ 1 root video 81, 3 Jun 26 15:58 /dev/video3
crw-rw----+ 1 root video 81, 2 Jun 26 15:58 /dev/video2

3) Use VLC to see images
Use VLC -> Media -> Open Capture Device -> "Video camera" & /dev/video2 -> Play
Note, /dev/video3 did not work


Back to WashintonPilot




Copyright© 2022 Ken P. (WashingtonPilot)