Caching YUM Proxy

I often need VMs with {minimal-centos} + {docker} for my learning experiments in my basement-lab. For example, an experimental Mesosphere DC/OS cluster requires 10+ nodes (one boot, three masters, five+ agents, one public-agent). I’ve automated the build process using ansible playbook & kickstart to make my life easier (just execute a shell script, and entire cluster-farm is ready in about 20 minutes).

So far so good – but a single iteration of such build makes over 550 URL requests and transfers about 300 MB files from various YUM repositories. That’s why I wrote this caching YUM proxy which considerably speeds up my build process. Also a respectful gesture to mirror-providers who donate their valuable resource to the community.

Here are the list of repo mapping that I needed.

http://centos.mirror.constant.com/7/os/x86_64/
mapped to => http://local.sudhaker.com/centos-7-os/

http://centos.mirror.constant.com/7/updates/x86_64/
mapped to => http://local.sudhaker.com/centos-7-updates/

http://centos.mirror.constant.com/7/extras/x86_64/
mapped to => http://local.sudhaker.com/centos-7-extras/

http://dl.fedoraproject.org/pub/epel/7/x86_64/
mapped to => http://local.sudhaker.com/epel-7/

http://yum.dockerproject.org/repo/main/centos/7/
mapped to => http://local.sudhaker.com/dockerproject/

And following nginx-configuration did the magic!
Continue reading Caching YUM Proxy

Wireless AP on Raspberrey Pi 2 & Alpine Linux

Alpine Linux for Raspberry PI is my favorite mainly because of the “diskless mode”, which ensures that my sdcard won’t be touched except boot and “lbu commit” hence minor wear-n-tear for the media.

This article is the phase-1 of the building of an AP with MTIM proxy + ssl_bump. Stay tuned for squid3 + ssl_bump and other configuration

Setup: RASPBERRY PI 2 Model B + alpine-rpi-3.4.2-armhf.rpi.tar.gz

Alpine install for PI was pretty straight-forward except following issues:

#1 DHCP timeout issue that randomly leaving LAN from getting a valid IP address. The fix is adding a “udhcpc_opts -t 12” in the “eth0” section of “/etc/network/interfaces” (as shown below).

auto eth0
iface eth0 inet dhcp
        hostname pi-router
        udhcpc_opts -t 12

#2 Remote login for “root” was denied by default. The fix is changing the “PermitRootLogin” flag to “yes” in the “/etc/ssh/sshd_config”.

sed -i -e 's|^#PermitRootLogin .*$|PermitRootLogin yes|' /etc/ssh/sshd_config

Now you just need to run the following script to turn your PI into a cool wi-fi access-point.

Continue reading Wireless AP on Raspberrey Pi 2 & Alpine Linux