Difference between revisions of "Main Page/IT/Misc"

From Lewis Consultancy Wiki
< Main Page‎ | IT
Jump to navigationJump to search
 
Line 24: Line 24:
 
do IFS='|' read var1 var2 <<< `echo $names`; rsync -Pva "$var1" root@remote.machine.com:"/var/path/$var2"; done
 
do IFS='|' read var1 var2 <<< `echo $names`; rsync -Pva "$var1" root@remote.machine.com:"/var/path/$var2"; done
 
</pre>
 
</pre>
 +
 +
=Mount a Hauwei mobile phone=
 +
Huawei seem to have a usb mass storage device which appears to allow ease of installing windows drivers. This stops the underlying mtp device from working in nautilus. It is possible to mount the mtp resources using jmtpfs :
 +
 +
  sudo jmtpfs /mnt/phone -o allow_other

Latest revision as of 16:26, 7 December 2018

Save tracks on a USB stick so that they play in order on some inferior Pioneer Car Stereo equipment

First copy all contact to a temporary location ... let's say /var/tracks. Make sure all tracks are numbered in such a way that that they list in correct order numerically i.e. prefix with 01..02..//..10..11 etc

The destination location for this example is /media/stick/

find /var/tracks/  | sort -n  | while read fn; do cp --parents -f "$fn" /media/usb-stick/; sleep 1; done

Convert .mov file to h264 (mp4 container)

Useful for Canon EOS cameras to save space on storage.

avconv -nostdin -i inputfile.mov -c:v libx264 outputfile.mp4

Convert MTS to mkv and reduce scale

ffmpeg -nostdin -i  $fn -vf scale=1024:-1 ~/Videos/conv/$fn.mkv

or with deinterlacing

 ffmpeg -i 00168.MTS -s 1024x768 -vcodec libx264 -crf 20 -acodec ac3 -vf "yadif" /mnt/mp4vids/00168.mp4

Copy files found between two dates from a heirachical structure to a flat structure

find . -type f -newermt 2016-08-07 ! -newermt 2016-08-30 -printf %p\|%f\\n | while read names
do IFS='|' read var1 var2 <<< `echo $names`; rsync -Pva "$var1" root@remote.machine.com:"/var/path/$var2"; done

Mount a Hauwei mobile phone

Huawei seem to have a usb mass storage device which appears to allow ease of installing windows drivers. This stops the underlying mtp device from working in nautilus. It is possible to mount the mtp resources using jmtpfs :

 sudo jmtpfs /mnt/phone -o allow_other