avconv must be installed

Make sure you have a list of JPEG files in one directory and that they are named sequentially i.e.

DSC_5015.JPG
DSC_5016.JPG
DSC_5017.JPG
...
...

Some versions of avconv will insist on the files starting with ‘0000’ somewhere in the first file. To rename the files, use the following command:-

ls *.JPG| awk 'BEGIN{ a=0 }{ printf "mv %s myfile%04d.JPG\n", $0, a++ }' | bash

This will rename all your files to:-

myfile0000.JPG
myfile0001.JPG
myfile0002.JPG
...
...

If you wan to create a clip with the original resolution (4256 x 2832 in this case) with high quality, use the following command:-

avconv -y -r 10 -i myfile%4d.JPG -r 10 -vcodec libx264 -q:v 3  -vf crop=4256:2832,scale=iw:ih tlfullhiqual.mp4;

-y forces avconv to overwrite any file
-r 10 creates a clip with 10 frames per seconds (for some versions of avconv you have to specify it twice)
-i specifies the input file(s). %4d means any 4 decimal numbers
-vcodec specifies the video codec to be used (H.264 in this case)
-q:v specifies the quality, value ranges from 1 (best) to 31 (worse)
crop= specifies which area of the images will be cropped
scale= indicates how much scaling must take place (in the above example iw:ih indicates that the output width and height will be that of the in width and in height)
the last parameter is the output file

To create a clip that is a quater of the height and width as the original with less image quality, use the following command:-

avconv -y -r 10 -i myfile%4d.JPG -r 10 -vcodec libx264 -q:v 20 -vf crop=4256:2832,scale=iw/4:ih/4 tlsmallowqual.mp4;

To create a .flv file

avconv -y -r 10 -i myfile%4d.JPG -r 10 -vcodec libx264 -q:v 3 -vf crop=4256:2832,scale=320:-1 -c:v flv tlsmallest.flv;

Here I moved the quality up, because the resolution is low

Enter your Ubuntu credentials

This is an update of a previous post, found here. I’ve added a section to the bottom which explains how you can connect to the same session each time.

If you need to connect to a Linux machine, and in the scope of this guide, Ubuntu 14.04 (I’m sure this guide should be fine for earlier versions as well), then your options include:

  • Pure and simple SSH – The admin’s super tool! (just install openssh-server – works every time!)
  • VNC – I don’t like this method because you need to install software on your client AND server
  • XRDP – This still involves VNC to some degree but you can use the normal Windows Remote Desktop Client

The latter is the one I’ll guide you through here. Continue reading

To resize all the JPEG files in a directory so that one of the dimensions is maximum 800 pixels.
The \> implies that the images will only be made smaller, never bigger

ImageMagick must be installed

 mkdir tmp  
 for file in `ls *jpg`; do echo $file; convert $file -resize 800x800\> tmp/$file; done

So you’ve created a magnificent automated report in Excel that just pulls the data in via XML and your customers go “wow!” when they see how easily your reports work, until….

Error: User-defined type not defined

Error: User-defined type not defined

This seams to be because a newer version of MSXML (v6.0 in this case) was installed. To get your document to work as expected again, you need to select the proper reference libraries for MSXML. In my case I needed to change it back to MSXML v3.0 to get it to work.

Continue reading

Microsoft introduced a handy new command in Windows 7 to help you figure out your battery health.

To use it, do the following:
• Open a command prompt (as ‘administrator’)
• Type the following:

C:\powercfg -energy

• Give it time to run for 60 seconds
• An html file will be created in your Profile directory. In my case, I get the following output from the screen”

C:\Users\hschoeman>powercfg -energy
Enabling tracing for 60 seconds...
Observing system behavior...
Analyzing trace data...
Analysis complete.
 
Energy efficiency problems were found.
 
25 Errors
9 Warnings
23 Informational
 
See C:\Users\techedemic\energy-report.html for more details.

The part in red above shows the location of the output file. Sad but true, my battery is dying – it only charged about 39% on the last charge:

Battery ID	LGC06L09L6D16
Manufacturer	LGC06
Serial Number	
Chemistry	LION
Long Term	1
Design Capacity	64069
Last Full Charge	25186