WordPress Job Interview Preparation

If I were to hire a WordPress developer, my wish list would look like this: Knows HTML and CSS inside and out; Has at least a basic grasp of JavaScript; Knows their way around PHP, and produces beautiful code (clean, consistent, DRY) Has a good grasp of database design and SQL: if I show you … Read more

How do I know the script file name in a Bash script?

For reading through a symlink1, which is usually not what you want (you usually don’t want to confuse the user this way), try: IMO, that’ll produce confusing output. “I ran foo.sh, but it’s saying I’m running bar.sh!? Must be a bug!” Besides, one of the purposes of having differently-named symlinks is to provide different functionality … Read more

bash sh – command not found 

Remove ; from the end of your script lines. This doesn’t happen in my bash, so I’m not sure what exactly is wrong, but my guess is this: ; is a separator of commands. Since your last command ends in ;, your bash probably expects another command after. Since the script finishes, though, it reads an empty command, which … Read more

How to use shared memory with Linux in C

There are two approaches: shmget and mmap. I’ll talk about mmap, since it’s more modern and flexible, but you can take a look at man shmget (or this tutorial) if you’d rather use the old-style tools. The mmap() function can be used to allocate memory buffers with highly customizable parameters to control access and permissions, and to back them with file-system storage if … Read more

What does ‘bash -c’ do?

Quoting from man bash: -c string If the -c option is present, then commands are read from string.If there are arguments after the string, they are assigned to the positional parameters, starting with $0. The command quoted by you would append the text in heredoc (i.e. the text in VirtualHost tag) to the file /etc/apache2/sites-available/magento-store.com.