## Simple Stop Motion with ffmpeg

Posted in Computers, Uncategorized by pgadey on 2020/09/12

Andrew Lindesay has a nice script for simple script for using ffmpeg to do stop motion:

``` ffmpeg -framerate 10 \ -pattern_type glob -i '*.JPG' \ -vf scale=640:-1 -c:v libx264 -pix_fmt yuv420p \ out.mp4 ```

This works great for compiling photos shot by a GoPro!
The shots are labelled chronologically by frame number:

``` G0107340.JPG G0107341.JPG G0107342.JPG G0107343.JPG G0107344.JPG G0107345.JPG G0107346.JPG G0107347.JPG G0107348.JPG G0107349.JPG ```

So, the `-pattern_type glob -i '*.JPG'` argument picks them up in order.

The argument `scale 640:-1` automatically resizes frames to 640xY and preserves the aspect ratio. This might not be what you want, but it makes for small videos.

Tagged with: , ,

## PreTeXt on Ubuntu 18.04

Posted in Computers, Math by pgadey on 2020/04/19

As part of the trying out new things bonanza, I installed PreTeXt. It turned out that my install was missing a couple packages: texlive-fonts-extra, texlive-science, and xsltproc.

Once these packages were installed, things worked great!

``` sudo apt-get install texlive-fonts-extra texlive-science xsltproc git clone https://github.com/rbeezer/mathbook.git```

``` cd mathbook git checkout dev cd examples/minimal/ ```

```xsltproc ../../xsl/mathbook-html.xsl minimal.xml xsltproc -o minimal.tex ../../xsl/mathbook-latex.xsl minimal.xml pdflatex minimal.tex ```

Tagged with: , , ,

## P5.js Test-Run

Posted in Computers, geometry by pgadey on 2020/04/19

I played around with P5.js today. It is really nice software! There is an in-browser P5.js editor, so you can start playing around instantaneously.

```function setup() { angleMode(RADIANS); // Change the mode to RADIANS createCanvas(200, 130); }```

``` function draw() { background(256); v1 = [1,0]; v2 = [cos(PI/3),sin(PI/3)]; n=0; m=0; while (n <= 5){ while (m <= 5){ p = [20+(20*v1[0]*n)+(20*v2[0]*m), 20+(20*v1[1]*n)+(20*v2[1]*m)] if ( (n*m) % 2 == 0){ circle(p[0],p[1],20); fill(200, 0, 0); } else { circle(p[0],p[1],20); fill(0, 0, 200); } m += 1; } m = 0; n += 1; } } ```

Tagged with: , , ,

## Installing Ubuntu 18.04 on Asus Zenbook 13 UX333F

Posted in Computers by pgadey on 2020/03/08

To access the BIOS on boot:
Hold F2 and restart the laptop.

With factory defaults, the machine is not set up to play nicely with bootable USB keys. You will need to remove the secure boot keys. To so do, open up the BIOS and go to Security. Select “Secure Boot” and then Key Management. This will show a list of various security keys, their sizes, and origins. (This probably voids some warranties. Proceed with caution.) Select “Restore Factory Keys”.

To install from a bootable USB key:
Again, the BIOS is not set up for this. You will need to add in the bootable USB key by hand. To do so, insert your bootable USB key. Open up the BIOS, and go to “Boot”. Select “Add New Boot Option” and then “Path for boot option.” Select the USB key (mine is called “HDD USB 30GB”) If you’ve made a bootable Ubuntu installation USB key, select `EFI`, then `BOOT`, then `BOOTx64.EFI`. This will create a new boot option. Go back to the “Boot” menu in the BIOS, and move the new USB option above the hard disk option. Reboot, and install Ubuntu.

Back-up and synchronization managed by syncthing. For details on using syncthing with Linux, see the docs.

You can manage closing/opening the laptop lid using systemd. Edit: /etc/systemd/logind.conf to include:
```[Login] ... HandlePowerKey=hibernate #HandleSuspendKey=suspend #HandleHibernateKey=hibernate HandleLidSwitch=suspend ... HoldoffTimeoutSec=30s IdleAction=hybrid-sleep IdleActionSec=30min ...```

Brightness management:

Create the file /usr/share/X11/xorg.conf.d/20-intel.conf with contents:

```Section "Device" Identifier "card0" Driver "intel" Option "Backlight" "intel_backlight" BusID "PCI:0:2:0" EndSection```

You can then use xbacklight to manage the backlight.

See this Bug Report.

To deal with flickering screen:
This is probably an Intel graphics issue with Panel Self Refresh . See ArchWiki.
To handle it, pass the kernel parameter:
`i915.enable_psr=0`

## 3D Printer Models for MAT 232

Posted in Computers, Math, Teaching and Learning by pgadey on 2019/11/07

This semester, I am teaching MAT 232 Multivariable Calculus. We often talk about level curves and use the saddle surface $z = x^2 - y^2$ as a key example. Every time it comes up, I ask students to stare at the part of their hand where the thumb meets the palm. Of course, they stare at me like I am crazy! This region of the hand is a good model for a saddle surface. If you start looking around at biological examples, you’ll see saddle surfaces everywhere.

I got interested in getting some 3D printed models of saddle surfaces to hand around the class. I found a great project 3D Printed Models for Multivariable Calculus put together by John Zweck. The STL files for the models are freely available, and I asked Reinhard Grassmann of the Continuum Robotics Lab if he could 3D print some models of saddle surfaces and the paraboloid $z = x^2 + y^2$ for me.

They arrived yesterday and they turned out GREAT! You can clearly see the level curves in one model, and the coordinate grid in another. They feel great to hold and are durable enough to hand around to a class of students.

Tagged with: , ,

## Backing Up with TAR

Posted in Computers by pgadey on 2019/11/03

My laptop is on its last legs. I manage to wear out laptops at an alarming rate. The Lenovo X220 has served me well, but the battery is flaking out and it shuts down everytime the wind blows. So, I looked up some options for backing up the disk. I found this brief guide to backing up.

Here are the relevant commands for reference:

```\$ sudo tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --one-file-system / \$ sudo tar -xvpzf /path/to/backup.tar.gz -C /restore/location --numeric-owner```

Tagged with: , ,

## Symmetry @ Otterbein

Posted in Computers by pgadey on 2019/06/03

The image represents a molecule of chloropentacarbonylmanganese or ClMn(CO)5. For the last half-hour or so, I have been playing around in the Symmetry Gallery put together by Otterbein. Lots of lovely molecules with high degrees of symmetry. It is remarkable (to me) that such things even exist in nature. I encourage you to go and check out the lovely interactive demos on the site.

## Office Camera

Posted in Computers by pgadey on 2016/09/13

There is a camera in my office which I use to take photos of the white board. The photos are automatically posted to http://pgadey.ca/office/cam/. If we work on a question during office hours, then it will appear on that page.