How to use one Gmail account for two Twitter accounts

Want to make two (or more) Twitter accounts, but don’t feel like creating another Gmail address for each one? You can!

Technique 1: Use + (plus)

Let’s say your email is

Simply add +, then a string of email-safe characters to the end of your email address, but before the @. Emails sent to any of these addresses will be delivered to your ‘real’ address:

Technique 2: Use dots

Let’s use the same base email as before.

Gmail allows you to add dots to your email address, and will consider all of these variations the same as your ‘real’ address for email delivery purposes.

That’s all!

You can sign up for several twitter accounts using these techniques, 

These are both officially supported techniques, mentioned on Gmail’s blog. Have fun!

Set up HTTPS (TLS) for a NearlyFreeSpeech.NET website

Any responsible site that accepts passwords, form responses, or other user data must use HTTPS.

If you’re hosting your site with NearlyFreeSpeech.NET, it is very easy to set up a TLS cert and HTTPS. Here’s how:

  1. Connect to your website via a SSH client like PuTTY.
  2. Run the command
  3. Accept the Let’s Encrypt Subscriber Agreement by entering “y”
  4. Wait while the script sets up the TLS cert and HTTPS

That’s it!

(Please note that other hosts will not have the script. These steps will only work on sites hosted with NFS.NET)

Manually trigger a git post-receive hook for testing

Using a post-receive hook is a good way to perform a scripted action each time new changes are pushed to a git repo. (If you have not yet set up a basic post-receive hook, consider consulting this article.)

If you’re interested in adding more to your post-receive hook, you might want to have a quick way to test it, without adding & pushing a bunch of test commits. We can trigger it manually with this advice from Kris Jordan.

When you’re working on a post-receive hook, it’s annoying to muck up your project’s commit history and push each time you make a change. Luckily, because it’s just a script, we can fake it from the command-line.

cd ../remote
git log -2 --format=oneline --reverse

First, we need to get the IDs of our most recent 2 commits. The git log command, above, will give us these two IDs in the order you’ll want to replace the $FROM_ID and $TO_ID variables with, respectively.

echo "$FROM_ID $TO_ID refs/heads/master" | ./hooks/post-receive

This method makes setting up your post-receive hooks enjoyable, enabling you to quickly iterate on your script and execute it repeatedly.

Use git with just a shared network drive. No git server required!

Want to use git for a small team of developers, but can’t (or don’t want to) use a git server? No problem! All you need is a shared network drive (like a dev server) that all of your developers can access. You’ll set up a repository for each developer, a central bare repository for them to push files to, and a git hook to auto-deploy files to a folder of your choice. This workflow works great for projects like websites and web applications.

How to install WordPress as fast as possible

This guide intends to walk you through every step of a WordPress install. It was designed with NearlyFreeSpeech.NET hosting in mind, but may be helpful on other hosts as well.

  1. Use PuTTY to SSH into the server where you wish to install WordPress.
  2. Run
    wget && tar -xzvf latest.tar.gz

    To get the latest install files for WordPress and unzip the wordpress folder.

  3. Run
    rm latest.tar.gz

    To delete the zipped folder.

  4. Run
    cp -rp wordpress/* /home/public/

    To copy the contents of the unzipped WordPress directory to the root directory of your server. You might have to use a path different than "/home/public/" depending on your particular server.

  5. Run
    rm -r wordpress

    To delete the unzipped WordPress directory.

  6. Log into  phpMyAdmin (or equivalent UI for your server’s MySQL Database).
  7. Click on “Databases”.
  8. Create a new database by providing a database name like “sitenamewp”, then clicking “Create”. WordPress recommends using “utf8mb4_general_ci” collation when creating a database. Write the database name down–it will be required later.
  9. Return to the main page by clicking phpMyAdmin logo in the top left.
  10. Click “User Accounts”
  11. Click “Add user account”
  12. Give the user a name like “wpuser_sitename” Write the user name down–it will be required later.
  13. Generate a password for the user by clicking the “Generate” button. Write the password down–it will be required later.
  14. Click “Go” to create the user.
  15. Go back to “User accounts”, then click “Edit privileges” for the recently created user.
  16. Click “Database”.
  17. Select the database that you created for this WordPress site, then click “Go”.
  18. Click “Check all”, then click “Go” to give this user all permissions on the selected database.
  19. Look at the top of the page and write down the host name for your MySQl server. It will look something like “hostname.db” and be found after the text “Server:”.
  20. Run
    pico wp-config-sample.php

    to begin editing the WordPress config file. The section of the file that you’ll focus on editing looks like this:

    // ** MySQL settings ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'database_name_here' );
    /** MySQL database username */
    define( 'DB_USER', 'username_here' );
    /** MySQL database password */
    define( 'DB_PASSWORD', 'password_here' );
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost' );
  21. Replace the text that says database_name_here with the name of the database you created in step 9.
  22. Replace the text that says username_here with the name of the user you created in step 13.
  23. Replace the text that says password_here with the password you generated in step 14.
  24. Replace the text that says localhost with the host name you made a note of in step 20.
  25. Optionally, add the line, define('FS_METHOD','direct'); to the end of the wp-config-sample.php file. This can make WordPress, Theme and Plugin upgrades easier, but be sure you are aware of the security concerns before doing this.
  26. Press CTRL + X to exit pico.
  27. Press Y to Save modified buffer.
  28. Change the “File Name to write” to wp-config.php, then press enter.
  29. Leave PuTTY open, we’ll come back to it later.
  30. Visit in your browser to run the install script using the config settings you provided.
  31. Follow the on screen instructions to choose a title for your site, and set up the first user.
  32. Click “Install WordPress”.
  33. In PuTTY, run the following commands one after another:
    cd wp-content
    mkdir -p uploads
    chgrp -R web uploads
    chmod -R 775 uploads
    cd ..

    This should ensure that you can upload files to your site (based on recommendation here.)

  34. In PuTTY, run the following command:
    touch .htaccess

    This creates an empty .htaccess file, which can be used for setting up permalinks. (source).

  35. In PuTTY, run the following commands one after another:
    chgrp -R web ../public
    find ../public -type f -exec chmod 664 {} \;
    find ../public -type d -exec chmod 775 {} \;
    chgrp -R web *
    find . -type d -exec chmod 775 {} \;
    find . -type f -exec chmod 664 {} \;

    This will allow the web server to create and modify files. It also sets proper permissions for directories and files. It’s riskier than using the WordPress CLI from a security standpoint, but more convenient for WordPress users. (source and source).

And that’s it! WordPress should be set up and ready to go!