Mason Law’s Email Newsletter

Need an email newsletter with Mason Law’s brand? Check out our new email newsletter template.

If you would like to use the template, follow these steps:

  1. Click on the template.
  2. View source and copy codes.
  3. Paste codes into an editor like Dreamweaver.
  4. Edit the contents.
  5. Save codes and paste into your email client using HTML view. If you’re using a Mac, open the new file in Safari and hit command-i. The email will be imported into Mail.
  6. Hit send.

Please note, the header image lives on our server so you don’t need to upload the header somewhere else. Just leave the URL absolute.

Mason Law Gets Responsive Makeover

In January 2012, we relaunched a responsive makeover for Mason Law web site. One of the challenges was that the new design has to work with and response to the existing contents, which being added and updated through  MODX, an open source content management system. Fortunately, MODX’s flexibility doesn’t get in the way and also allowed us to bring the markups up to HTML5.

In making responsive layout, we took the mobile first approach. The entire navigation system is moved to the bottom to allow the content to be more prominent and improve accessibility and SEO. On small screens (smartphones and tablets), users can get to the main content quickly without having to scroll through the menus. On larger screens such as desktops, the navigation is repositioned back to the top using CSS technique.

As an institution, accessibility is one of top priorities; therefore, we make sure the site works well with screen readers and legacy browsers including IE7 & 8. We hope that the new site could help you find information quickly and effectively on any device that you are holding in your hands.

Mason Law Networks

In March 2012, we launched three Mason Law networks using WordPress Multisite:

If you or your organization interested in one of the services above, please contact us.

Upgrade Notes

WordPress: Just hit the upgrade button

MODX: 1.06

  • Follow Upgrading Guide (Alternate Method).
  • Back up and
  • Once upgraded, change default sort order in resource tree:if (!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) {
    // This is the first startup, set default sort order
    $_SESSION['tree_sortby'] = 'menuindex'; // Change menuindex to a value of your choice.
    $_SESSION['tree_sortdir'] = 'ASC';
  • PHx Bug & pageTOC issue: The fix is to increase the pcre.backtrack_limit setting in php.inifrom 100000 to 800000

    ;PCRE library backtracking limit.

Modifying the

Add the following codes when upgrade:

// Ability to get all documents, whether deleted or unpublished, added by Paul Bohman
if ($published == '*') $sqlPublished = '';
else $sqlPublished = "AND sc.published=$published";
if ($deleted == '*') $sqlDeleted = '';
else $sqlDeleted = "AND sc.deleted=$deleted";

And here:

$result= $this->getTemplateVars($vars, "*", $docid, $published, "", "", $sep, $deleted=0);
// The deleted option above was added by Paul Bohman/Donny Truong

Remember to add the codes for CASifying MODX as well.

Posted in CMS

Frequently Used Linux Command Lines

Install WordPress
tar xfz latest.tar.gz
cp -r * ~/public_html/your/website/folder/

Change Permissions (rwx => 4 + 2 + 1 = 7)
For Directories: find /path/to/your/directory/ -type d -exec chmod 755 {} \;
For Files: find /path/to/your/file/ -type f -exec chmod 644 {} \;

chmod -R 755 directory
chmod -R 644 files

Remove files and directory (use carefully)
rm -rf YourDirectory

Change Owner
chown -R apache new_name (change entire directory)

Remane Directory
mv {old} {new}

To access database: mysql -u root -p
mysql> create database [database name];
mysql> show databases;
mysql> drop database [database name];

VI editor
Reference: Using the VI editor

Red Hat Training

Notes from Red Hat System Administration I (RH124) from April 2-6, 2012

Day 1

Installing Red Hat 6, which took almost half a day.
Using GNOME graphical desktop.
Editing files with gedit.
Managing files with Nautilus.
Getting help with manuals (F1 for help)
Managing system clock.
Configuring printers.

Command Lines:
uname -r (find out what version of Red Hat)
$ su – (log in as substitute user)
# useradd visitor (add username “visitor”)
# passwd visitor (add password to “visitor”)
# ip addr show eth0 (show ip address)
# ls /usr/share/doc (documentations)
# man man (access manual)
# man -k print (-k is for keyword)

Day 2

Introduced to Bash

Commands entered at the shell prompt have three basic parts:
# chmod +x gedit demo.txt
[command] [options] [arguments]

Command lines:
# pwd (path you’re currently in)
# history
Using the tab key (“tab” “tab”) for completion
# scp filename user@ip-address:/ (copy file from local folder to virtual server)

Introduced to managing physical storage using the graphical interface
Learned to manage logical volumes
Introduced to monitoring system resources

Day 3

# yum list (get the list of .rpm, which stands for RPM Package Manager)
# yum search kernel (kernel is the name of the package)
# yum install kernel
# yum update kernel
# yum remove kernel

# ip addr show eth0 (eth0 is the name of the network)
# more /etc/sysconfig/network-scripts/ifcfg-eth0
# service network restart
# system-config-network
# ip route
# host
# dig

Users and Groups
# useradd donny
# passwd donny
# vipw (let’s one user edit at the same time)

Manage Files
# echo $PATH
# pwd (current path)
# ls /home/{dir1,dir2} (show more two directories)
# ln file1 file2 (link file 1 to file 2)
# ln -s file1 file2 (symbolic link)
# su – username (change user)
# cp -av /dir/to/copy /dir/destination

r (view content)
w (change the content)
x (requires r to execute the content)

umask 002

u+s (suid=4: file executes as the user that owns the file, not the user that ran the file
g+s (sgid=2: file executes as the group that owns the file
o+t (sticky=1: no effect)

Day 4

Administer remote system including remote shell access, remote file transfer, using SSH keys

Managing physical storage including filesystem, partition and swap space

Install Linux with Anaconda.

# scp original-file new-file
# rsync -a /home/student demo:/tmp

# tar -cvf target/to/archive source/to/archive
-t=test (tell)

Using SSH
# ssh-keygen
# ssh-copy-id

# service crond status
# chkconfig –list crond

# vi /etc/ssh/sshd_config
PermissionRootLogin no
PassordAuthentication no
# service sshd restart

Day 5

# service vsftpd status
# service vsftpd start
# chkconfig vsftpd on
# chkconfig vsftpd –list

# ll /var/www/
# ln -s /var/ftp/pub /var/www/html/pub
# cat > /var/ftp/pub/index.html
Hello World!