RSSAmplifier

Blog

david winter

davidwinter.devRSS feed ↗81 posts

Latest posts

Updating a Raspberry Pi hostname

Changing the hostname the usual way with hostnamectl kept reverting after every reboot, until some digging turned up what was silently overriding it.

Keeping Claude Code MCP credentials out of git with 1Password

Resolve MCP server tokens from 1Password at launch so Claude Code gets its credentials without a single secret ever landing in a committed config file.

Making Firefox open new tabs where I expect

Three about:config settings that fix where Firefox drops new tabs, especially when pinned tabs are involved.

RustDesk direct connections over Tailscale

Skip the public RustDesk server entirely and connect straight to your machines over their Tailscale IP addresses.

Post-deployment triggers for PaaS providers

Not all hosting providers offer a mechanism to trigger follow up actions after a deployment. Here are a few examples using GitHub Actions to achieve it.

Simple Electron automatic updates

If you’re using electron-builder to publish your applications, then electron-auto-update provides you with a user-friendly simple auto update mechanism with one method call.

Managing GPG with Keybase

Use Keybase to setup and manage GPG, and start signing your git commits

Working remotely with SSH and VNC

A week long trip out in Spain with the need for CPU power back home

Tmux - the essentials

With only a handful of commands, tmux can still be your new best friend on the terminal

Quick and simple Github Gist oEmbed support

Get those code snippets embedded easily

Install and manage WordPress with Composer

Automated and repeatable WordPress deploys with Composer

Introduction to Ansible

The new, cool provisioning kid on the block

Poor mans VPN with sshuttle

Get around those evil firewalls and secure your net connection

Switch to a retro shell, Fish shell

Leave behind the millions of plugins, and slowness, and just use Fish

Identity theft and no one seeming to care but me

Maybe don’t waste your time reporting it in future…

Setting up a Puppet Master and Agents on EC2

One server to rule them all

Install EC2 command line tools with OS X

Be a ninja with EC2 using the CLI

Getting started with Amazon EC2

It’s not as difficult as it may first seem

Install and manage WordPress with Git

Keeping the core separate, but easy to update

Introduction to Puppet

Puppet can change your life

Testing Javascript websites with Behat

Using the Behat WebDriver driver to easily test websites with Javascript

Using Behat with Mink

Writing custom definitions

Setup rbenv on Mac OS X

Some quick setup instructions on getting rbenv installed on Lion

Getting started with Behat

A quick introduction on setting up Behat and writing your first test

Setting up Github Pages

Getting started with a Jekyll powered site and migrating from WordPress

Simple local web development with Apache and Dnsmasq

When you sit down and start work on a new project, what hoops do you have to jump through before you get your app running in your browser? There are more than likely always going to be two; creating a spoof domain that you create in /etc/hosts so that …

Install APF on Ubuntu 11.04

I just setup a new Linode to host my new twitter app, lists dj and wanted to lock it down to basically Apache and SSH. iptables gives me a headache, and I don’t want to spend a day learning how to use it. APF uses iptables, but the configuration …

Setup UFW on Ubuntu 11.04

Not much more than a few hours have passed since I posted my APF setup howto , but I’ve found something even simpler. ufw - uncomplicated firewall. It does exactly as it says on the tin. sudo aptitude install ufw sudo ufw allow 22 sudo ufw enable That’s ssh sorted …

PHP development on Mac OS X 10.6 Snow Leopard

Having a reliable and easy to use developer environment on my Mac is essential for my work, and the odd project I work on. I original used the Entropy PHP packages as they were so easy to install, and just worked . Unfortunately, Marc Liyanage had stopped updating the packages with …

Merging MKV files together

mkvmerge -o merged_file.mkv file1.mkv + file2.mkv

Mod rewrite rules in htaccess files

Rewrite rules in an htaccess file don’t need to leading slash, otherwise they won’t work. Be warned. Don’t waste two hours wondering why it isn’t working.

Authentication with CodeIgniter 2.0

I’ve started using CodeIgniter again recently, and have noticed that my how-to on implementing basic authentication could do with an upgrade for version 2.0. The process is identical. We subclass the base CI_Controller class. This simply checks whether a logged in session is present. If not, it redirects …

A simple chat room with WebSockets

Sorry, I promised a blog post, but instead you get a link to bitbucket with the source of a basic chat app written using WebSockets. https://bitbucket.org/davidwinter/websockets-chat/src

Setting up SSH host shortnames

Here’s an example setup to create SSH host shortnames. On you local computer, add the following to ~/.ssh/config : Host server1 HostName server1.internet.com User david Host server2 HostName server2.internet.com User david Host * User davidwinter Now with this file saved, you can ssh into server2.internet …

SSH and public key authentication

Fed up with having to type your password in each time you log into a server over SSH? Me too. Down with passwords, and in with public key authentication! First thing to do, is to check that you have a SSH key setup already on your local computer: cd ~/.ssh …

Using Capistrano to deploy Mercurial changes

We have a few production servers at work, and we have a central bitbucket repository to store our core code. Once we make a change on our testing server (!), we used to have to commit, push changes to bitbucket, and then ssh into each server, then pull changes, and update …

Using o2 PAYG mobile broadband

Our internet connection via our landline has been dead since Tuesday afternoon, so I’ve needed an alternative connection in the meantime to give me my twitter fix! I’d kept an eye on the o2 pay-as-you-go mobile broadband for a while, because it offered the cheapest, noncommittal setup. A …

Redirecting Apache traffic to a maintenance page

Here&rsquo;s a simple solution to redirect users to a maintenance page in Apache. This rewrite rule can stay in your config ( <VirtualHost> or .htaccess ) all the time; all that you need to enable it is to create the file maintenance.html . The first rewrite condition checks to see if …

Install Mercurial on CentOS 4

We&rsquo;ve finally moved to Mercurial at work (well, we didn&rsquo;t exactly move from anywhere, but that&rsquo;s another story&hellip;). Our production server is running CentOS 4, which comes installed with Python 2.3.4. Mercurial requires 2.4. No Python updates available in the yum repository. What to …

Apache, PHP and MongoDB on Mac OS X 10.6 Snow Leopard

MongoDB (from &ldquo;humongous&rdquo;) is a scalable, high-performance, open source, schema-free, document-oriented database. There&rsquo;s a lot of buzz brewing about it, so I wanted to give it a try with PHP on my development Mac. The following is how I went about installing Apache, PHP and MongoDB on Snow Leopard …

Remove startup scripts on Ubuntu

sudo update-rc.d -f script_name remove

Convert git repository to mercurial

Ensure that the mercurial convert extension is enabled: nano ~/.hgrc Inside that file add: [extensions] hgext.convert = Save. Now do: hg convert my-git-repo This will create a new directory called my-git-repo-hg . This will appear empty at first, so do this: cd my-git-repo-hg hg checkout All of your files will appear …

Enable PHP error logging

In php.ini: display_errors = Off log_errors = On error_log = / var / log / php - errors . log Make the log file, and writable by www-data: sudo touch / var / log / php - errors . log sudo chown www - data : www - data / var / log / php - errors . log

PHP and nginx on Ubuntu: the easy way

I&rsquo;ve now changed my slice from running lighttpd to nginx. Here&rsquo;s the simplest way, in around 6 commands, to get PHP up and running via FastCGI. Install and setup Install PHP 5: sudo aptitude install php5-cgi Install nginx: sudo aptitude install nginx Create PHP 5 FastCGI start-up script …

Authentication with CodeIgniter

Here&rsquo;s how I do some basic authentication for a controller in CodeIgniter . It basically consists of creating a new class that extends the default Controller class. You then sub-class this on any controller that requires authentication. Create your authentication controller in system/application/libraries and call it MY_Controller.php …

A simple PHP delicious REST example with pecl_http

<?php $username = 'your_username' ; $password = 'your_password' ; $url = "https:// $username : $password @api.del.icio.us/v1/posts/recent" ; $request = new HttpRequest ( $url , HTTP_METH_GET ); $response = $request -> send (); print $response -> getBody (); ?> You&rsquo;ll probably need to view the source in your browser to see the output. The second argument isn&rsquo;t required in this …

Install pecl_http for PHP

You will probably want to ensure that curl supports https before getting underway: curl -V Check that the output contains https : >: curl -V curl 7.19.2 (i386-apple-darwin9.5.0) libcurl/7.19.2 OpenSSL/0.9.8i zlib/1.2.3 Protocols: tftp ftp telnet dict http file https …

Install PHP5, lighttpd and Imagick on Mac OS X Leopard

It&rsquo;s a little tricky getting a nice clean install of PHP5 for OS X 10.5. The packages that I always used to depend on over at Entropy don&rsquo;t seem to work anymore. At least not for Leopard. A great shame. I&rsquo;m now switching to lighttpd for …

lighttpd and PHP on CentOS 5

Here&rsquo;s a quick run down on getting lighttpd and php running on CentOS 5 . yum install lighttpd lighttpd - fastcgi php mkdir / var / run / lighttpd touch / var / run / lighttpd / php - fastcgi . socket chown - R lighttpd : lighttpd / var / run / lighttpd / vim / etc / php . ini Add in php.ini the following; cgi …

Mac OS X/HFS+ case-insensitive? Why?

I just found out that HFS+, the preferred file system for Mac OS X, is case-insensitive when it comes to files and directories. I don&rsquo;t understand why? It&rsquo;s sure as hell causing issues with stuff I&rsquo;m copying from my Ubuntu PC. Just seems like a dumb idea …