Setup SSL for nginx for Ubuntu 14.04

Refer: https://www.digitalocean.com/community/tutorials/how-to-create-an-ssl-certificate-on-nginx-for-ubuntu-14-04

Install nginx

sudo apt-get update
sudo apt-get install nginx

Setup SSL Self-signed Cert, Good for 10 Years

sudo mkdir /etc/nginx/ssl
sudo openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt

Here's an example for local.hollandamerica.com, it creates files in folder the same place your run it.

openssl req -x509 -newkey rsa:2048 -nodes -keyout cert.key -out cert.crt -days 3650 -subj "/C=US/ST=State/L=Locality/O=Organization/CN=local.hollandamerica.com"

Sample Values

Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:New York City
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Bouncy Castles, Inc.
Organizational Unit Name (eg, section) []:Ministry of Water Slides
Common Name (e.g. server FQDN or YOUR name) []:your_domain.com
Email Address []:admin@your_domain.com

Sample Server Code, Magic Sauce is the following 4 lines:

listen 443 ssl;
server_name localhost;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

listen 443 ssl;

root /usr/share/nginx/html;
index index.html index.htm;

server_name your_domain.com;
ssl_certificate /etc/nginx/ssl/nginx.crt;
ssl_certificate_key /etc/nginx/ssl/nginx.key;

location / {
try_files $uri $uri/ =404;
}
}

Change Date/Time of File Using Touch Command

Refer: http://askubuntu.com/questions/62492/how-can-i-change-the-date-modified-created-of-a-file

Find all the files in a directory and change date/time, even the script itself.

find -print | while read filename; do
# do whatever you want with the file
touch -t 201203101513 "$filename"
done

Change 2 hours from current time
touch -d "2 hours ago" filename

Change 2 hours from modify time of file itself
touch -d "$(date -R -r filename) - 2 hours" filename

SMBClient from the Command Line in Ubuntu

Ubuntu 14.04 Installation Update

$ sudo apt-get install cifs-utils
Refer: https://help.ubuntu.com/community/MountWindowsSharesPermanently

## List the shares
smbclient -L <windows-server-ip> -U<username>  ## It will prompt for password

## Access a share. Choose the one which you have access to from the list above
smbclient //<windows-server-ip>/<share-name> -U<username>  ## It will prompt for password

smbclient //192.168.1.13/temp -Umruckman

\\192.168.1.13\users\Public\Videos\

mput filename.extension

LDAP from Linux Command Line

> net group /DOMAIN TLAdmin
> net group /DOMAIN TLAdmin
> NET USER loginname /DOMAIN | FIND /I " name "

$ adquery user -p loginname

$ for i in `cat file.txt` do adquery user -p $i; done

You might try ldapsearch too

# Turn off word wrap with -r switch
$ ldapsearch mail=somone@hotmail.com -r

$ ldapsearch sAMAccountName=userId

Installing Kobi onto Ubuntu 14.04 Media Player

Refer: http://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:team-xbmc/ppa
$ sudo apt-get update
$ sudo apt-get install kodi

Note: To keep the XMBC player from always going full screen, go to:

System, System, Video output, and set Display Mode to Window

WD My Cloud with Ubuntu

smb://192.168.1.18/public

Then XnView can find it here:
Computer/run/user/1000/gvfs/smb-share:server=192.168.1.18

This works much faster locally

While trying to figure this out, installed this, probably not necessary:

$ sudo apt-get install nfs-common

Mount FTP Drive on Ubuntu that’s Anonymous

$ apt-get install curlftpfs
$ sudo /mnt/HS-DHGLF7B

Change the permissions for everyone to add/update/delete

The following command will mount it:
$ sudo curlftpfs -o allow_other 192.168.1.14 /mnt/HS-DHGLF7B/

This is for an FTP with a user account:
$ curlftpfs ftp-user:ftp-pass@my-ftp-location.local /mnt/my_ftp/