The other day I found that one of the domains on a busy server was sending unsolicited spam mail thousands of times a day. It happens: the nature of open source scripts is that they will get hacked if they’re not updated regularly.
The clue was a full-up mail queue and Gmail no longer accepting mails from the IP in question.
When I examined one of the spam mails I found a line like this:
Good to know the spam was sent from a PHP script… but from which domain? All we have here is the user ID of the domain in question (10040) but that doesn’t mean much to the average human administrator.
Here’s how to translate that Plesk User ID into the domain it’s coming from:
In this 6-part series I’ll show you how to create a searchable UITableView in an iOS App. We’ll start with a standard single view application template in Xcode, create a table view with dummy data, and finally make it searchable.
This course demonstrates how to do this with Xcode 5.1 and iOS 7.1. We’ll also make the app compatible to for in iOS 6.
I love the Twentythirteen theme – except for the captions that appear underneath images. If you’ve ever seen them they look so out of place as if someone forgot to style them altogether. Here’s what they look like by default:
Notice how the captions are actually larger than the post text. I wanted to drop this size a bit, but at the same time integrate the text better with images I post over at http://www.versluis.com, adding a bit of padding, some rounded corners and perhaps tint the background colour ever so slightly.
Here’s what I came up with:
And here’s how I did it:
/* make captions smaller */
Add this to your theme’s style.css file or override your stylesheet with an appropriate option. Here’s what this code does:
First we’ll reduce the 18 point caption size and bring it in line with the rest of the post text (1em). Then we’ll tint the background colour to a very light hint of grey. We’ll also add a bit of padding around all edges of the text, it looked a bit cramped in there before.
The second larger block is creating rounded corners at the bottom of the caption, but not at the top so it looks like an attachment. There’s a remarkable tool that lets you visually set this and return some code at http://border-radius.com – go check it out and have a play.
In this screencast I will show you how to move a WordPress website from one Plesk server to another without the Migration Manager.
We’ll extract the files on the source server and export the database. Then we’ll create a new WordPress instance on the destination server and upload the files and import the database. All that remains is to point the domain to the new IP.
I’m doing this without the Migration Manager because the source server is an Amazon EC2 instance and does not allow root access with a password (which the Migration Manager needs – and Plesk doesn’t yet have a feature that allows me to use a keyfile instead).
The workflow is entirely web-based and you won’t need anything other than your favourite web browser.
Just like before, we’re taking an array of buttons and remove the objects we don’t want. Since they were addressed with an index title (blockquote in our case), you must unset them in the same way. Once gone we return the array, and WordPress does not display said button anymore.
I really like the Distraction Free Writing Mode that WordPress offers. I mean the one you can access when you write a new post, then hit that big X and go into full screen mode.
It’s Zen at large.
But just in case there’s a single function you’d like to see up there as a button, because you’re using it all the time, there is a way to do it.
Bear with me. These are the buttons I mean:
Just in case you didn’t know: there are A LOT OF OTHER FUNCTIONS you get in this mode, much of which are hidden by the power of keyboard shortcuts. See that little question mark up there? Press it and see what else you can access at the speed of thought:
Seriously, this is dynamite stuff! Chances are that if you’re looking for something, it’s already there – and at the ready with a keystroke.
Anyway, let’s get back to that toolbar and see how we can tweak it.
Adding Buttons in DFW Mode
So really, all those buttons and their respective functionality is not coming from WordPress. Here’s a list of other functions that could potentially be up there as buttons:
In this example I’m adding the three justifications to the editor: left, centre and right. Add this code to your theme’s functions.php file, or if you’re writing a plugin add it to your main plugin file:
I know it looks a lot, but it’s relatively simple. Let’s go through this:
First we’re adding a function that gets called via the wp_fullscreen_buttons action. As you may imagine, this is called when the entire toolbar is displayed in fullscreen mode.
Our function takes a parameter ($buttons), which is an array of button objects that will show up there. We take it and add to the array with our own buttons.
The first item we’re adding to the array is a separator, just so that our own buttons appear with a little distance. Take it out of you don’t like it.
Next up are three button objects. We’ll talk about those more in a moment
Finally we return the amended array and WordPress can display it.
The result looks like this:
Not only does it look swish, it also works out of the box! Is that cool or what?
Thanks to the following links for helping me figure this out:
You can use the ftp command to talk to an FTP server from the Linux Command Line. Type ftp to see if the tool is installed. If you get a “command not found” message then go ahead and type yum install ftp to make it available on your system.
Using it is very straightforward – but I keep forgetting how because I only do it once in a blue moon. So here’s a handy cheat sheet:
Logging in to your FTP Server
Assuming our site is example.com, simply type this:
This will connect you, but the system wants to know the username and password at the prompt. Provide those and if your login was successful you’ll see something like this:
230Usertester logged in
Remotesystem type is UNIX.
Usingbinary mode to transfer files.
Note that you’re now at the FTP command line and no longer on the Linux command line (you can tell by the ftp> in front of the cursor). Therefore only FTP commands are now accepted, until you type “exit” or “bye” to go back to Linux.
To see a list of available commands type help and you’ll see a list much like this:
Commandsmay be abbreviated.Commandsare:
!debug mdir sendport site
$dir mget put size
account disconnect mkdir pwd status
append exit mls quit struct
ascii form mode quote system
bell get modtime recv sunique
binary glob mput reget tenex
bye hash newer rstatus tick
casehelp nmap rhelp trace
cd idle nlist rename type
cdup image ntrans reset user
chmod lcd open restart umask
close ls prompt rmdir verbose
cr macdef passive runique?
delete mdelete proxy send
No need to panic: The good news is that we don’t really use a plethora of new commands, and some (like ls and mkdir) are working the same way, just the output may look a bit different.
Let’s go through a few common scenarios now: listing and creating directories, uploading, downloading, and deleting files. Classic CRUD – FTP Style.
If you ever need to come out of a running command, CMD-D (or CTRL-D) will do the trick.
Listing and Switching Directories
Your usual Linux favourites will work fine to list and switch directories:
– ls (list directory, same as dir)
– cd (change into directory, for example “cd mydir”)
– cd .. (move one directory up in the tree)
Excellent: nothing new to learn here. Result!
Creating and Deleting Directories
Another nice thing is that mkdir is still working to create a directory. Here’s how we create a directory called test:
Likewise, rmdir does a good job at deleting (empty) directories:
To delete a directory that contains files you must first remove all files (see below under Deleting Files) and then use this command.
To download a single file we can use the get command (or recv if you can remember it better). You must type out the entire file name for this to work, and you won’t get a progress report while your file downloads:
local: testfile.tarremote: testfile.tar
150OpeningBINARYmode data connection for testfile.tar(86365356bytes)
86365356bytes received in11secs(7865.17Kbytes/sec)
This will save testfile.tar in the Linux directory that you were before you initiated the FTP session.
To save files in a directory other than the current one, I’m afraid you’re going to have to log out, cd into the directory you want those files to go, then re-connect. I know, ultra lame – but if there is another way then it’s kept so secret that no Google search will ever unveil it.
Sadly wildcards are no working in this operation, so you’ll always have to type out the exact file name. Lucky for us you CAN use wildcards to download multiple files with mget, like this:
Now all files starting with “test” are downloaded and you’ll be prompted one by one. This will work for single files too and saves you having to type out cryptic long names. Human 1 – FTP 0. Ha!
put and mput work just like get, but they upload local files to the current FTP directory. You can specify a local Linux path when doing this, but put and mput expect a local path to also exist on the FTP remote (and fail if they don’t). Read: messy. There probably is a way to deal with this, but life’s just too short.
Just like get, put also needs the whole file name and cannot deal with wildcards – but mput does:
150OpeningBINARYmode data connection for testfile.tar
236716bytes sent in0.0141secs(16825.36Kbytes/sec)
There’s also a delete and mdelete command which – you guessed it – removes unwanted files from the server. Same as before: no wildcards on delete, but they work fine on mdelete:
FTP transfers all files and passwords “in the clear” and does not work with encryption. Checkout the sftp command which will do all of this and more while using encryption on all transfers.
Note that there is a difference between SFTP and FTPS: the latter (FTPS) is the same as FTP but with encryption added to it. SFTP isn’t really FTP at all, it’s an SSH connection that works much like rsync and scp, and uses similar syntax.
In this video I will show you how to get the most out of the revolutionary P2 WordPress theme. It allows front-page posting and is an ideal solution for jotting down notes or communicating with others.
I will explain how to create lists with simple shortcuts, add links, how to embed YouTube videos by simply pasting the URL and some simple customisation options.
Add this code to your theme’s functions.php file. Note that if you (or your client) activates a different theme the widget will disappear.
Here’s what the code does: first we create a function that simply writes out the text that’s displayed inside our widget (contact_help). Next in register_widgets we register our widget in the WordPress Dashboard. This won’t do anything yet, as the register_widgets function is not called. We do that in the next step when we hook it into the wp_dashboard_setup action.
Remember this is sample code – you probably want to prefix your own functions with something unique.
This is a presentation Andrey Kugaevskiy and I gave at Parallels Summit 2014 in New Orleans. We’ll show you what the SDK is and what it can do for you.
If you would like to change the way Plesk behaves, or you want to integrate your application or service deep into the Plesk interface, then this session is for you. We’ll discuss the best practices for creating extensions that can be used to differentiate your services from everyone else or to promote your service to all Plesk instances online today.