# nginx proxy_pass based on domain

Nginx supports multiple server blocks listening on the same port; this is how Virtual Hosts work; thus we simply proxy_pass virtual hosts to our desired target.

https://stackoverflow.com/questions/21064401/route-different-proxy-based-on-subdomain-request-in-nginx

# Moving House

Previously I had this blog hosted on RedHat’s OpenShift PaaS using WordPress. I haven’t been blogging frequently for about 2 years, and I missed RedHat’s memo about the migration because I registered using an obscure email from a shell account without webmail. https://blog.openshift.com/migrate-to-v3-v2-eol/ Lo and behold my blog has vanished, although thankfully I have the entire SQL dump (and most of the crucial media) from the beginning of this year. To minimize the chance of this happening ever again (and to minimize the effort of getting my site up and running again, knock on wood) SSGs seem like the best solution since they have the content in a portable, versionable format, although I would have preferred a Ghost blog.

Hexo caught my eye over other static site generators due to:

• Complete compatibility with Octopress plugins
• hexo server -d watches the filesystem and automatically generates new content upon reload
• Prebuilt themes like the one I’m using now have the basics of what a nerdy blog needs OOTB:
• $\textbf{MathJax}$
• Instant support with an npm install hexo-tag-fontawesome
• SEO basics like a configurable sitemap and newfangled generator plugins for stuff like Google AMP which will close the gap between CMSes
• One line deploy to Git, (S)FTP, among other targets

# nVidia CUDA samples on Ubuntu 16.04 LTS

Here they are in case anyone else needs to download them separately (and the rest of cuda-repo-ubuntu1504-7-5-local_7.5-18_amd64.deb):

The file you’re looking for is var/cuda-repo-7-5-local/cuda-samples-7-5_7.5-18_amd64.deb

To extract and compile the samples (make sure you have your nVidia GPU active if you’re using Optimus, e.g. by using

sudo prime-switch nvidia

or otherwise;

nvidia-smi

# First Foray into MIPS Assembly

Task: Print Hello World 10 times.

# Concatenating FLV files with ffmpeg

Defining the combination formula (nCr) recursively.

This works because http://www.cs.nott.ac.uk/~vxc/g51mcs/ch05_combinatorics.pdf , page 9.

# How to fix popping on audio start/stop/resume with Intel HDA audio in Linux

https://wiki.archlinux.org/index.php/Alsa#Pops_when_starting_and_stopping_playback My ears were nearly wrecked by this awfulness. On a side note, the Conexant Audio CX20751/2 isn’t the best integrated sound card around. Even lowly Realteks have far better dynamic range and equalization. There is virtually no soundstage, mids are very muffled, even with headphones. It can be found on some lower end Thinkpads (e.g. S440/E440); considering that these are cheap SMB laptops it’s not surprising that they had to cut corners somewhere.

# Another alternative to checkinstall

Checkinstall didn’t work for me in CentOS 7 even after following this guide: http://www.patrickmin.com/linux/tip.php?name=checkinstall_fedora_13 and using –fstrans = no. Solution: https://github.com/jordansissel/fpm Using nginx 1.7.3 as an example:

Of course, this is by no means a substitute to properly packaging packages for upstream using rpm-build, but it is perfect for compiling from source quickly without having files strewn all over the place, especially when there is no make uninstall.

# GNU Screen on Steroids

Note: This is an old post, from an old blog far, far away Append this to your ~/.bashrc: