DNS Servers

Here is a list of DNS servers that I commonly use:

OpenDNS 208.67.222.222
208.67.220.220
Google 8.8.8.8
8.8.4.4
Comcast 68.87.66.196 (National Primary)
68.87.64.196 (National Secondary)
68.57.32.5 (Virginia)
68.57.32.6 (Virginia)
216.148.227.68 (Denver, Colorado)
204.127.202.4 (Denver, Colorado)
68.42.244.5 (Taylor, Michigan)
68.42.244.6 (Taylor, Michigan)
68.62.160.5 (Huntsville, Alabama)
68.62.160.6 (Huntsville, Alabama)
68.87.96.3 (Pennsylvania)
68.87.96.4 (Pennsylvania)
Earthlink and Mindspring 207.69.188.185
207.69.188.186
207.69.188.187

Joyent (TextDrive) shared server addresses

Here are important addresses for TextDrive (VCII, VCIII, VCIV, Mixed Grill) and Joyent (Accelerator and Golden Ticket upgraded) shared hosting accounts.

Newer accounts (Joyent):

Virtualmin

https://virtualmin.joyent.us/SERVER/

https://virtualmin.joyent.us/SERVER/password-recovery/

Usermin and Webmail

https://usermin.joyent.us/SERVER/

SSH or SFTP

SERVER.joyent.us

phpMyAdmin

https://SERVER.joyent.us/phpmyadmin/

DNS

  • dns1.joyentdns.com
  • dns2.joyentdns.com
  • dns3.joyentdns.com
  • dns4.joyentdns.com

Older accounts (TextDrive):

Webmin

https://webmin.SERVER.textdrive.com/

Usermin

https://usermin.SERVER.textdrive.com/

SSH or SFTP

SERVER.textdrive.com

phpMyAdmin

https://mysql.SERVER.textdrive.com/

Webmail

https://webmail.textdrivehosting.com/

DNS

  • dns1.textdrive.com
  • dns2.textdrive.com
  • dns3.textdrive.com
  • dns4.textdrive.com

Delete folder and contents with rm via unix command line

To delete a folder and it’s contents, enter the following in your terminal
# rm -dfr foldername
Analysis of the above command

-d remove folders
-f remove the files without prompting for confirmation or error messages
-r remove recursively, folder and its contents

More Examples

rm myfile.jpg Remove the file called myfile.jpg in the current directory.
rm *.jpg Remove all files that end with .jpg.

Zip only some files (jpg) via unix command line

To create a new zip archive ‘filename.zip’ including only select files, you can use an expression argument after the command. Enter the following in your terminal to compress all jpg fies in current directory:
# zip filename.zip *.jpg
If you want to only compress mp4 files with ‘720p’ in the filename, enter the following:
# zip filename.zip *720p*.mp4

htaccess 301 (permanent) Redirect and RedirectMatch

There are many different types of redirects. Here are a few different permanent redirects. All of these can be added to your htaccess file. The directories listed are relative to the htaccess location.

Redirect visitors of a single page to a different page.

# Redirect permanent /directory/index.html http://subdomain.domain.tld/AnotherPage.html

Redirect visitors of any page within a directory to a specific page.

# RedirectMatch 301 ^/mydirectory/ http://subdomain.domain.tld/AnotherPage.html

Redirect visitors of any page within a directory to that page in a different location. Notice the missing slash here, compared to above.

# RedirectMatch 301 ^/mydirectory http://subdomain.domain.tld/AnotherPage.html

Redirect your entire website to any other domain or directory

# Redirect 301 / http://domain.tld/

301 (Permanent) Redirect: Point an entire site to a different URL on a permanent basis. This is the most common type of redirect and is useful in most situations. In this example, we are redirecting to the “my-example.com” domain:

# This allows you to redirect your entire website to any other domain
Redirect 301 / http://my-example.com/

302 (Temporary) Redirect: Point an entire site to a different temporary URL. This is useful for SEO purposes when you have a temporary landing page and plan to switch back to your main landing page at a later date:

# This allows you to redirect your entire website to any other domain
Redirect 302 / http://my-example.com/

Redirect index.html to a specific subfolder:

# This allows you to redirect index.html to a specific subfolder
Redirect /index.html http://example.com/newdirectory/

Redirect an old file to a new file path:

# Redirect old file path to new file path
Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html

Redirect to a specific index page:

# Provide Specific Index Page (Set the default handler)
DirectoryIndex index.html

mod_rewrite subdomain to directory (not redirect)

This is the code I used to setup a subdomain on my webserver. Paste these lines into the .htaccess file at the root level of the web/public folder. It seemed that nothing I read online could satisfy my needs and I found mod_rewire to be very challenging to work with. My main problem was that I ended up creating a loop and didn’t know it.

Here are my requirements:

  • When users visit http://subdomain.domain.tld, display files located at http://domain.tld/mydirectory/
  • Do not show /mydirectory/ in the url.
  • Allow for the possibility of a user prefixing the subdomain with www.

Steps

  • Make sure your DNS settings are correct. If you host your own DNS, setup an A record * and point to your IP Address. [*.domain.tld   A   1.2.3.4].
  • Make sure your webserver is setup to handle wildcard subdomains.
  • Test your DNS by performing a lookup of subdomain.domain.tld
  • Test your webserver by visiting subdomain.domain.tld and you should see the same thing you would see at domain.tld.
  • Add the following code to your .htaccess file

Code Summary

# Required for mod_rewrite to work
Options +FollowSymLinks

# Users should not view my directory listing.
# Other sites are wrong that this is required.
Options -Indexes

# Turn on mod_rewrite
RewriteEngine On

# Set directory for rewrites to occur, based on htaccess location.
# Mine will occur at the root level.
RewriteBase /

# Don’t mess with www.domain.tld
# Unnecessary in this rule because no regexp
# used in subdomain portion of the next condition.
# Left here because it is used in some of my other rules.
RewriteCond %{HTTP_HOST} !www.domain.tld$ [NC]

# Select what to rewrite.
# Only process pages beginning with
# www.subdomain.domain.tld or subdomain.domain.tld.
# Stores anything after ‘subdomain.domain.tld’ as string variable $1
RewriteCond %{HTTP_HOST} ^(www.)?subdomain.domain.tld [NC]

# Prevent a loop.
# Don’t process pages that already referencing correct directory.
RewriteCond %{REQUEST_URI} !mydirectory/ [NC]

# This tells mod_rewrite to load files in mydirectory.
# $1 is the string variable stored from
RewriteRule (.*) mydirectory/$1 [L]

Just the code

Options +FollowSymLinks
Options -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www.)?subdomain.domain.tld [NC]
RewriteCond %{REQUEST_URI} !mydirectory/ [NC]
RewriteRule (.*) mydirectory/$1 [L]

 

Extract .zip file (unzip) via unix command line

To extract a zip file into current directory, enter this code in your terminal window.
# unzip filename.zip