Category Archives: How To

How to centre an element in CSS

In the olden days of HTML development, in the late 90ies, we only had inline styles. Centring an element was done using the <center> property. That approach isn’t very elegant anymore in modern CSS 🙂

Today we can use something like this:

It’s slightly more complicated than a single tag, but also opens up more options to tweak top and bottom margins at the same time.

How to find your Public Profile on Amazon

As much as I like Amazon, UI design isn’t their strong point. They have so many links to so many things hiding in their interface that it’s difficult to find what you’re looking for at times. Your Public Profile is one of those hidden gems.

It’s a collection of all your community activity you’ve engaged in on Amazon, such as post reviews or videos, your wish lists, Spark posts, Reviewer Ranking and so forth. Here’s a screenshot of what mine currently looks like:

Continue reading How to find your Public Profile on Amazon

How to take a screenshot on a Chromebook

My wife recently got hold of an Acer Chromebook. She just got a promotion in her job, and part of said promotion was a laptop so that she can work 18 hours a day more efficiently.

The biggest question we both had less than 10 monies after switching it on was: how to we take a screenshot with this thing?

Short Answer

To take a full screenshot, press CTRL + F5.

To take a partial screenshot, press SHIFT + CTRL + F5. Now left-drag the area you’d like to take a screenshot of.

If your Chromebook doesn’t have F keys, look for a rectangle with two lines next to it. It’s known as the Switch Window key. It’ll most likely be the fifth key from the left in the top row, not including the ESC key. It looks like this:

Resulting files will be stored in the Downloads folder.

Further Reading

Let Google dazzle you with a whole host of keyboard shortcuts available for Chromebooks:

  • https://support.google.com/chromebook/answer/183101?hl=en

How to build an Amazon link efficiently

When you want to share a product on Amazon with someone else, the easiest thing to do is to copy whatever is in the browser bar at the time and paste that elsewhere. While this works, it’s not an efficient way to link to a product.

The URL is often extremely long and contains additional parameters that tell Amazon’s systems either how the product was found or referred, or what else to display on the current product page. Most of that additional information makes the URL longer than it needs to be.

In this article I’ll show you how to build a short and efficient link without additional parameters, such as tracking information.

All we really need is the regional Amazon domain and the ASIN of the product and add these two together, separated by the letters “dp”.

Continue reading How to build an Amazon link efficiently

How to create a YouTube Subscription Prompt Link

Ever wondered how you can send a link to someone with an immediate prompt to subscribe to your YouTube channel?

It works by appending a parameter to the channel link you’d like people to subscribe to. It doesn’t have to be your own channel either.

Here’s how to do it.

Find the YouTube Channel URL

There are plenty of ways to do this, I won’t go into detail here. Check out my article on how to find your YouTube channel URL instead.

Let’s take my own YouTube channel’s URL for this example. It’s https://youtube.com/user/wphosting (if I remember correctly).

Append the sub_confirmation parameter

Ordinarily, if I would share this link with someone else, all that happens is that they land on my YouTube channel, and my channel trailer starts playing. The end.

But if we append the following parameter, the user is asked if they’d like to subscribe to that channel.

So in my case, the full subscribe URL would be https://youtube.com/user/wphosting?sub_confirmation=1. Try it out and see how it works!

When the other party receives the link, all they have to do is click on a SUBSCRIBE or CANCEL button.

If a user is already subscribed to the channel, no message appears. If a user is not logged into YouTube, they will be prompted to do so after the above dialogue (and then they’ll subscribe to the channel).

Credits

Thanks to David “The 8-Bit Guy” Murray for this insight! He’s been using such links successfully in one of his latest collaborative videos, the ThinkDifferentChallenge.

After it went live, Jan Beta noted in a Pattern post that his subscriber count went through the roof.

How to find the URL for your own YouTube Playlist (2018)

I’ve seen a lot of web interfaces in my time. YouTube’s has got to be one of the worst ever. Fact! I am frequently shocked how unintuitive the simplest of things are, and how cumbersome and ugly the whole design is.

Take something as simple as sharing your own Playlist. There’s this unbelievably unhelpful Google article that apparently explains how it works.

Which it doesn’t. At least not at the time of writing.

Here’s how to find and share your own YouTube Playlist’s URL (with screenshots, as of August 2018). Continue reading How to find the URL for your own YouTube Playlist (2018)

How to share ebooks with WordPress (EPUB and MOBI files)

If you’ve ever tried to upload an ebook in .MOBI or .EPUB format with the WordPress Media Uploader, you will have noticed an error message appear. Something along the lines of “Sorry, this file type is not permitted for security reasons”.

The only way then appears to be to ZIP the file and share it. That’s not a great experience for mobile users, who would simply like to click on a file and open it in an application such as iBooks or Kindle.

The solution to this puzzle lies in adding the required mime types to WordPress, so that these file types are allowed.

Let me show you how to do it in this article.

Continue reading How to share ebooks with WordPress (EPUB and MOBI files)

Fan Maintenance on my Samsung NC10

My Samsung NC10 Netbook has been in constant operation since 2013, for 24 hours a day, 7 days a week. It’s doing a great job as our internal office server, purring along quietly running CentOS 6.

When I put it in operation 5 years ago, I made sure no mechanical parts we being used anymore to avoid wear and tear: I’ve added an SSD, and once a day valuable data is backed up on a permanently mounted SD card.

The only mechanical thing still in use is the internal fan. I knew the day would come on which the poor thing would either give up and need replacing, or at least require some maintenance to make it go a few extra miles. Well, that day has come at the beginning on this month, when I noticed a bit of rattling noise that started happening behind my big monitor. That’s where I keep the little guy.

Turns out that the fan can be easily whipped back into shape with a drop of bicycle oil. It’s really easy to disassemble too – let me show you how I did it.

Continue reading Fan Maintenance on my Samsung NC10

How to remove OSSEC Agent on macOS Sierra

I’ve been trying to find a way to remove OSSEC on one of my Macs. Most documentation is a bit outdated and references files from yesteryear, so here’s how to do it on macOS Sierra in 2018.

These instructions were written with OSSEC 2.8 in mind. I’m not familiar with later versions.

Removing the three system users

The OSSEC Agent creates three system users that come up when your Mac is started. They’re called ossec, ossecm and ossecr. OSSEC uses these to run its various scrips and services.

To remove them on macOS, head over to System/Library/CoreServices/Applications and start the Directory Utility app. Unlock the little icon at the bottom left with your password to make changes (that lock icon only comes up when you click on Services or Search Policy).

Select the Directory Editor and search for “ossec”.  You should find the three system users. Select them and remove them using the little minus icon at the bottom left.

Removing files

We’ll have to remove all files from /var/ossec and the configuration file from /etc/ossec-init.conf.

Since OSSEC was likely installed from source, there are no handy graphic utilities to help us. Instead execute the following commands from the command line:

Removing System Daemons

While we find daemons in /etc/init.d on Linux distributions, they’re stored in .plist files in both /Library/LaunchAgents and /Library/LaunchDaemons. In the latter we find one like this:

The exact name will depend on your user name and machine name. Remove this file, then restart your system.

Further Reading

  • https://groups.google.com/forum/#!topic/ossec-list/ErhxXhQl5YE
  • https://en.wikipedia.org/wiki/Directory_Utility
  • https://stackoverflow.com/questions/15735320/osx-s-etc-init-d-equivalent
  • https://raymii.org/s/tutorials/Uninstall_OSSEC.html
  • https://github.com/ossec/ossec-hids

How to embed images in GitHub Readme Files

In this screencast I’ll show you how to add images to your GitHub Readme files. You can use the Markdown or HTML syntax for this, I’ll show you both versions. Make sure to upload images to your own repository and provide the relative path to them.

Here’s the syntax:

In Markdown

In Markdown syntax, use the following example to embed an image:

In HTML

GitHub also supported the HTML syntax, which uses the standard IMG tag. Pasting HTML code in a website is always a little tricky, but let me try:

Should you have spaces in your file names, you can replace them with %20, just like in standard HTML (like “file%20name”).

Now go and make those Readme.md files look handsome!

Catch this episode on my WP Guru Podcast: