As a step further to my previous post, I have created a boilerplate for future WordPress projects. It can be accessed at https://github.com/andrewwippler/WordPress-Containerization-Boilerplate.
To quickly start a WordPress environment, simply run the following commands:
git clone git@github.com:andrewwippler/WordPress-Containerization-Boilerplate.git
cd WordPress-Containerization-Boilerplate/
docker-compose up
and by visiting http://localhost:8080
More instructions are in the repo README.
Happy Plugin/Theme development.
This is the script I use to change the DNS record of my home IP when it changes. I have it running once a week and have not noticed a lapse in coverage. If your ISP has DHCP configured correctly, you will receive the same IP address when you are due for a renew. Otherwise you need a script like the one below.
#!/usr/bin/ruby
require 'aws-sdk'
require 'socket'
def my_first_public_ipv4
Socket.ip_address_list.detect{|intf| intf.ipv4? and !intf.ipv4_loopback? and !intf.ipv4_multicast? and !intf.ipv4_private?}
end
ip = my_first_public_ipv4.ip_address
unless ip.nil?
change = {
:action => 'UPSERT',
:resource_record_set => {
:name => "home.andrewwippler.com",
:type => "A",
:ttl => 600,
:resource_records => [{:value => ip}]
}}
route53 = Aws::Route53::Client.new(
region: 'us-east-1'
)
route53.change_resource_record_sets({
hosted_zone_id: '/hostedzone/XXXXXXXXXXXXXXX', # required
change_batch: { # required
changes: [change],
},
})
end
I have been studying for my OpenStack certification test (the COA) which is scheduled next week. One thing that was painful to keep track of was the user I was using to interface with OpenStack as the rc file you download from OpenStack does not update your PS1 prompt. I came up with the following solution and placed it in my ~/.bashrc
:
function parse_os_user() {
if [ ! "${OS_USERNAME}" == "" ]
then
echo "(${OS_USERNAME})"
else
echo ""
fi
}
PS1='\u@\h \w `parse_os_user` $ '
A captive portal is a piece of software that prompts for user interaction before allowing the client to access the internet or other resources on the network. It is a combination of a firewall and a webserver. In this tutorial, I will explain how to create an open WiFi network. Before deploying an open WiFi network, you may want to consult a lawyer of the legality and restrictions for having one. You can also review what has been said by lawyers here and here.
When a device first connects to any network, it sends out a HTTP request and expects an HTTP status code of 200. If the device receives a HTTP 200 status code, it assumes it has unlimited internet access. Captive portal prompts are displayed when you are able to manipulate this first HTTP message to return a HTTP status code of 302 (redirect) to the captive portal of your choice.
To set up a captive portal on a Raspberry Pi, you will need a wired network (I will refer to this as WAN or uplink) and a wireless network (such as the Ralink RT5372 or the Ralink RT5370) which you can set into AP mode. A server with 2 NICs would also suffice if you want to perform this on a wired LAN instead.
UPDATE 2/15/2017: If you get the too many redirects error, look at the hotspot.localnet
nginx configuration. It could be that the dollar signs $
are not present. The below block is what the location / block should look like in the hotspot.localnet
virtual host.
location / {
try_files $uri $uri/ index.php;
}
Continue reading WiFi Captive Portal →
Wouldn’t it be nice to program a script that expects a certain line of text then sends a predetermined string? How about copy your ssh id to 40 different RPi units without typing the command for every one? Expect is that sort of program we all have been dreaming about. Continue reading Expect with expect →
I was recently tasked to install a group of fonts on windows systems. In order to do it the Internet way, you have to:
- Install the font on a system
- Export the registry file
- Create a GPO
- Place the font in an accessible location (domain readable)
- Make sure the GPO has the .reg and the font file installing
- Reboot the machine 2-3 times
Continue reading Installing fonts on Windows using Puppet →
Bash reads aliases from a file only; however, this file does not have to reside on the server you are connecting to. With OpenSSH, we have to ability to send environment variables that the server allows. Continue reading Send Aliases over SSH connections →
I am currently using 14.2 of Kodi on my home media center. In order to save money and energy, our rule of thumb is to keep the media center powered off during the night. At first thought, it would make sense to use Kodi’s built-in sleep function; however, it gets too mundane to open the setting option every time you want to watch something on the media center. Our second choice was to install a cron job to shutdown every night before we went to sleep. Our trouble with this aspect is that while we normally would be in bed before 2230, sometimes our kids would not fall asleep until 2100. This would make our together time begin later than normal. If we chose to watch a movie in our together time, we often found out we had to restart our media center just to get the last 5 minutes of the movie.
Continue reading Kodi Shutdown Script →