njfcs.org registration system

gibbon

URL – http://studenst.njfcs.org

Guide –

  1. https://docs.gibbonedu.org/administrators/getting-started/getting-started-with-gibbon/
  2. https://www.youtube.com/channel/UCff1byXVvT5QJMiLcteUr8w

open sis

URL – http://registrar.njfcs.org

Guide – https://www.youtube.com/channel/UCcYDDbIhYQVZ1U6yNzWHAkw

 

 

 

 

https://docs.gibbonedu.org/administrators/getting-started/installing-gibbon/

Advertisements

work with wordpress themes and plugins API

reference

  1. https://codex.wordpress.org/WordPress.org_API#Plugins
  2. https://developer.wordpress.org/reference/functions/themes_api/
  3. https://code.tutsplus.com/tutorials/communicating-with-the-wordpressorg-plugin-api–wp-33069
  4. https://dd32.id.au/projects/wordpressorg-plugin-information-api-docs/

themes and plugins

  1. total counts

important ideas and best practices

  1. cloudwatch default/custom metrics – dfault is hypervisor level metrics, all else is custom
  2. count how many RI we need; RI reseller policy
  3. AWS limit/data cheat sheet
    1. 400 kb/DynamoDB record or 5TB max file size in S3
    2. service hard/soft limit

 

what we do right so far

  1. multi account
  2. automation
  3. steering committee

Docker, Nginx and Wordpress

https://medium.com/aws-activate-startup-blog/running-services-using-docker-and-amazon-ec2-container-service-bde16b099cb9#.6fnm215tc

 

object In AWS ECS
docker
  1. A server which is a type of long-running program called a daemon process.
  2. A REST API which specifies interfaces that programs can use to talk to the daemon and instruct it what to do.
  3. A command line interface (CLI) client.The Docker client can either be installed local to the daemon, or on a different host altogether.
dockerfile A Dockerfile is a text file that describes how to “build” the image. tasks?
libcontainer Execution environment of container; interface to various Linux kernel isolation features, like namespaces and cgroups
Linux cgroup (abbreviated from control groups) is a Linux kernel feature that limits, accounts for and isolates the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes.
Linux namespaces are a feature of the Linux kernel that isolates and virtualizes system resources of a collection of processes. Examples of resources that can be virtualized include process IDs, hostnames, user IDs, network access, interprocess communication, and filesystems. Namespaces are a fundamental aspect of containers on Linux.
Image build component of a container. It is a read-only template from which one or more container instances can be launched. Conceptually, it’s similar to an AMI.
Registry used to store images. Registries can be local or remote. When we launch a container, Docker first searches the local registry for the image. If it’s not found locally, then it searches a public remote registry, called DockerHub. If the image is there, Docker downloads it to the local registry and uses it to launch the container.
Container is a running instance of an image. Docker uses containers to execute and run the software contained in the image.

 

Setup CLI – http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-msi-on-windows

  1. Install python
  2. Install pip
  3. yum install aws-cli
  4. aws configure (setup access key ID, access key and default region)
  5. aws ec2 describe-instances
  6. aws ecs  list-container-instances
  7. aws ecs describe-container-instances –cluster wordpress –container-instances e22a5fc8-3655-4941-aabd-c91b591e39dc

 

https://medium.com/aws-activate-startup-blog/running-services-using-docker-and-amazon-ec2-container-service-bde16b099cb9#.yzqpaowtw

  1. Create ECS cluster using GUI or CLI
  2. aws ecs create-cluster –cluster-name “wordpress”
  3. Create task definition Tell ECS how to run containers that comprise wordpress application – create task definition
  4. Create service

 

{
 “containerDefinitions”: [
   {
     “name”: “wordpress”,
     “links”: [
       “mysql”
     ],
     “image”: “wordpress”,
     “essential”: true,
     “portMappings”: [
       {
         “containerPort”: 80,
         “hostPort”: 80
       }
     ],
     “memory”: 400,
     “cpu”: 10
   },
   {
     “environment”: [
       {
         “name”: “MYSQL_ROOT_PASSWORD”,
         “value”: “password”
       }
     ],
     “name”: “mysql”,
     “image”: “mysql”,
     “cpu”: 10,
     “memory”: 400,
     “essential”: true
   }
 ],
 “family”: “wordpressFamily”
}

 

Sample YML

 

version: ‘2
services:
 wordpress:
   image: wordpress
   cpu_shares: 100
   mem_limit: 404288000
   ports:
     – “80:80”
   links:
     – mysql
 mysql:
   image: mysql
   cpu_shares: 100
   mem_limit: 404288000
   environment:
     MYSQL_ROOT_PASSWORD: password

 

Sample YML

 

version: ‘2
services:
 mysql:
   image: ‘mysql:5.7’

   cpu_shares: 100
   mem_limit: 404288000
   environment:
     – MYSQL_ROOT_PASSWORD=secret
 php-fpm:
   image: wordpress:4.6-fpm

   cpu_shares: 100
   mem_limit: 404288000
   environment:
     – WORDPRESS_DB_USER=root
     – WORDPRESS_DB_PASSWORD=secret
   volumes:
     – ‘./data/html:/var/www/html’
 web:
   image: bcardiff/nginx-4-wordpress-fpm

   cpu_shares: 100
   mem_limit: 404288000
   environment:
     – PHP_FPM_SOCK=php-fpm:9000
   ports:
     – 8080:80
   volumes:
     – ‘./data/html:/var/www/html’

 

Terminology

Container instance – EC2 instance

Cluster – resource pool

Task definition version – code version

 

Troubleshooting

  1. Set desired count to 0 so that you can delete a ‘service’ from a cluster

 

Ecs-cli

 

Update ECS container agent before you go?

 

sudo yum install aws-cli

aws configure

aws ec2 describe-instances

 

sudo curl -o /usr/local/bin/ecs-cli https://s3.amazonaws.com/amazon-ecs-cli/ecs-cli-linux-amd64-latest

 

sudo chmod +x /usr/local/bin/ecs-cli

 

ecs-cli configure –region us-east-1 –access-key $AWS_ACCESS_KEY_ID –secret-key $AWS_SECRET_ACCESS_KEY –cluster ecs-cli-dchang

 

ecs-cli up –keypair dchangwebmd –capability-iam –size 1 –instance-type t2.small

 

Note that dchangwebmd is imported via AWS console

 

ecs-cli compose –file hello-world.yml up

ecs-cli compose –file hello-world.yml –project-name dchang-hello up

ecs-cli compose –file hello-world.yml –project-name dchang-hello down

Note – project-name = task definition name; it will be prefixed by whatever set in .ecs/config

ecs-cli compose –file hello-world.yml –project-name dchang-hello service up (this will start container from scratch every time; data will be erased)

 

ECR

Build a docker image

 

sudo usermod -a -G docker ec2-user – enable ec2-user to run docker command

 

docker images – show what you have on the ec2 instance

docker info – show the system info

 

sudo yum install -y git

git clone https://github.com/awslabs/ecs-demo-php-simple-app

cd ecs-demo-php-simple-app

docker build -t 256428178804.dkr.ecr.us-east-1.amazonaws.com/dchang .

docker build -t dchangusc .

docker tag dchangusc:latest dchangusc

To tag a local image with name “dchangusc” and tag “latest” into the “256428178804.dkr.ecr.us-east-1.amazonaws.com” repository with “version1.0.test”:

 

aws ecr get-login –region us-east-1

 

docker tag dchangusc:latest 256428178804.dkr.ecr.us-east-1.amazonaws.com/dchangusc:latest

 

docker push 256428178804.dkr.ecr.us-east-1.amazonaws.com/dchang:latest

 

docker rmi 256428178804.dkr.ecr.us-east-1.amazonaws.com/dchangusc (remove images)

 

docker login -u AWS -p AQECAHhwm0YaISJeRtJm5n1G6uqeekXuoXXPe5UFce9Rq8/14wAAAw0wggMJBgkqhkiG9w0BBwagggL6MIIC9gIBADCCAu8GCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMxZbkRPnqs5jeF88sAgEQgIICwHbybvJc7qMmPfzs86jNTMr2w9Ovxc0haEutw58Mli/wghTmVSdkQeW8e7JnT4X3oOMJIEQePGBWKrC2ep1uo1JGx3CWNpyh0a7ydIPoatULH2g+V7sGh2ydWA0xBzW7bQppD2BR1tX3WrfhKp4Y7Agwh+P7H+txPd3mEiibv89ZIsVWMYKTgZT2NeAEJoMDcMEViYtjOk4ul+EyxeRMJRpL+P76iCPDYNVQcBcaaoXPsyHBA71qiNEgqJPCqrlKpgE5E1V9E8O+zyTLi9JVs3csqtMnud+AhqJeBrkprfqkaLffBXkDUc8meGwetmj82IF9KBdYRx7Bmuw7eXCYFAH+w2LPeJSIStoSJ/1tQFC5zjSDgAapBU34ixcG6Kx2Aj6AAxTpUxeiMpPQgM2iOKMUDG9LoDUl7jF1Pmgr57bUQResTnq2i/sGKvmQTqFanB1njdMktRx+ByxkMQ4Cd3+Dghhy4SrcVDrxxOARQGEnS9aDieGYAjLoXpWgEmXavg/HQO7CG66DprXZGNvyRrS8yj3QsXGv32eeaiTV+z+KE3BE5M0WfliSl0XpVvQSxe9SPitxbs9hhSHikTEZZgrnEKKctI4wlr4MEXBaMD6IiLFhEtEg1Ob/1V7H6YqOT1OfQTACp0+PT0WZOCsdHR9VyUd5/wttxIUN2hrutjWaT5sDet9bvfErRrVrXpDWq2mU2IudBZpNxB+qsNrpHiZkdHNoQ0FRtaa4LNAY9+83JGCVt7GxlU446bBk2fcGFbLteKCsqmt5rka+fYx7vwmTFS5XR8a9Nhalg0CiZf/4YwhekiiplOaiYl1LzeuC0Fn7Cu2g6SycF/qFuND1x15Gzu2lwU0w9eX1i9k8ZhOlT3hTgRGUzy2db7YfgiXyck+CHErKjriyQuPu20ZKLZND6KfC7B5paszwAMzr9wOx -e none https://256428178804.dkr.ecr.us-east-1.amazonaws.com

 

Sample .bash_profile

# .bash_profile

 

# Get the aliases and functions

if [ -f ~/.bashrc ]; then

       . ~/.bashrc

fi

 

# User specific environment and startup programs

 

PATH=$PATH:$HOME/.local/bin:$HOME/bin

AWS_ACCESS_KEY_ID=AKIAILVHFNGW5J7JNZIA

AWS_SECRET_ACCESS_KEY=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

export PATHA AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID

 

AWS ECS CLI

aws ecs list-clusters

aws ecs list-services –cluster ecs-cli-dchang

aws ecs list-tasks –cluster ecs-cli-dchang

aws

aws ecs stop-task  –cluster ecs-cli-dchang –task 0be6c2a5-4e49-43af-9c5c-19fe247db194

 

References

http://docs.aws.amazon.com/cli/latest/reference/ecs/

http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cloudwatch_alarm_autoscaling.html

 

 

  • Email to Sean 2017 budget
  • Email to cloud working group – survey, Roe and Thomas
  • Email to tech senior management at AWS conference
  • Email to Rick 2017 projects (slides, Madhura’s feedback)
  • Email to finance – 2017 budget
  • Email to Paul Mort about qa environment and CD pipeline
  • Check Madhura’s writing (load testing data)
  • Check Roger’s forms additional headcount
  • Check Madhura’s forms additional headcount – for ongoing and site performance project
  • Accomplishment table (Madhura)
  • Writing in load testing data (Madhura)
  • API testing data (Derek)
  • Real Device load testing for mobile web – requested by Mahesh. Marquee video is the use case. (Derek)
  • 2017 project table (Derek)
  • QA environment cost anaysis
  • Jacek – CI pipeline end to end

 

 

Nginx

https://gist.github.com/ericandrewlewis/95239573dc97c0e86714

 

Sample YML

image: nginx
 volumes:
  – ./mysite.template:/etc/nginx/conf.d/mysite.template
 ports:
  – “8080:80”
 environment:
  – NGINX_HOST=foobar.com
  – NGINX_PORT=80
 command: /bin/bash -c “envsubst < /etc/nginx/conf.d/mysite.template > /etc/nginx/conf.d/default.conf && nginx -g ‘daemon off;'”

 

Docker hub – https://hub.docker.com/r/bcardiff/nginx-4-wordpress-fpm/

 

Terraform vs Cloudformation

 

http://www.slideshare.net/ServNet/cloudformation-vs-terraform-vs-ansible

 

AWS solutions architect

 

  • Business logic in EC2, structured data in RDS and static content in S3

 

 

Training

 

  • AWS associate
  • AWS professional – devops engineer and solutions architect

 

 

嬉風帆船學校網站設計專頁

WordPress 新手教學

  1. 發表文章與管理文章 https://startpress.cc/post/wordpress-post-new.html
  2. 選單 https://startpress.cc/post/wordpress-nav-menus.html
  3. 全部內容 https://startpress.cc/post/category/wordpress-tutorials

設計大綱

  1. 只用文章發表 每篇文章必須分類
  2. 文章名稱使用中文
  3. 文章位址(URL) 使用英文
  4. SSL/HTTPS
  5. 全部使用開源/免費外掛和佈景主題

site functions

  1. reference to other sites (booking.com agoda, airbnb)
  2. move all media on google drive to ‘google photos’ and videos to youtube so that site can source from it.
  3. logo location
  4. link to social media
    1. facebook feed
    2. facebook like button
    3. facebook page – call to action button
    4. sign in to facebook
    5. link wordpress comment to facebook comment and the other way around
    6. pinterest and instagram
  5. online booking
    1. availability check for online reservation
    2. online payment 易付寶
  6. web: amp page
  7. plugins
    1. use contact form 7 for online form submission
      1. signature
      2. probably sent it to facebook messenger instead of gmail
    2. google translate/dictionary completed
    3. google map
    4. plugin auto optimize
    5. plugin hyper cache and wp cache
    6. plugin site statistics
    7. plugin jetpack

social media

  1. instagram, pinterest, facebook, twitter and other popular one in taiwan
  2. a lot of photos

twenty-seventeen theme – header media sizing

  1. https://core.trac.wordpress.org/ticket/39035

twenty-seventeen theme use slider as header media

  1. https://wordpress.org/support/topic/slider-as-header-image-how/
  2. ensure you set a page as static front page

twenty-seventeen header video no sound

  1. workaround https://wordpress.org/support/topic/youtube-header-video-no-sound/

About twenty-seventeen theme

  1. how to customize https://premium.wpmudev.org/blog/twenty-seventeen-wordpress-theme/?ptma=b&utm_expid=3606929-109.P6e7JvhjTrWFxwrJZjRkog.1&utm_referrer=https%3A%2F%2Fwww.google.com%2F
  2. 5 ways to hack https://premium.wpmudev.org/blog/five-hacks-twenty-seventeen/?ptma=b&utm_expid=3606929-109.P6e7JvhjTrWFxwrJZjRkog.1&utm_referrer=https%3A%2F%2Fwww.google.com%2F
  3. how to master it https://www.designbombs.com/master-twenty-seventeen-wordpress-theme/

Journal and Progress

  1. fine tune twenty-seventeen
  2. create categories
  3. create contact us page
  4. create main menu

 

home audio system

The LOOK

Before i forgot, one thing for you to consider is the ‘furniture’ for your equipments. to me, the ‘look’ of your setup is probably equally important as the audio part of it

one thing i wasn’t able to accomplish when i built my home theater is that it doesn’t fit my living environment. and home theater has the inherent challenge since there will be equipments, cables everywhere. how to store them properly, decorate with your home is something for you to consider. also because most of HT components don’t have the classy look of a stereo system but it can be fixed if you select your audio furniture and equipments properly.

some sites with quality audio furniture for your consideration

https://www1.crutchfield.com/g_15720/Audio-Cabinets-Racks.html#&nvpair=FFBrand|Bell’O&nvpair=FFBrand|Salamander Designs&nvpair=FFBrand|Sanus&nvpair=FFBrand|Solidsteel&nvpair=YCStyle|Cabinet

http://www.audioadvisor.com/

Recommended Home Theater System Brands

 

K8 Quick Guide for MacOS and VirtualBox

Commands

 

# Commands What it does
1 sysctl -a | grep machdep.cpu.features | grep VMX Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS ru
2 brew update && brew install kubectl && brew cask install docker minikube virtualbox use brew to install kubectl, docker, minikube and virtualbox
3 docker –version

docker-compose –version

docker-machine –version

minikube version

kubectl version –client

verify the installation
4 minikube start start minikube

a local kubernetes cluster with one node

5 kubectl get nodes should show only one node
6 eval $(minikube docker-env) Use minikube’s built-in docker daemon:
7 docker ps
8 docker run -d -p 5000:5000 –restart=always –name registry registry:2 First setup a local registry, so Kubernetes can pull the image(s) from there.
9 docker build . –tag my-app build the Dockerfile below locally if you want to follow this guide to the letter. Store the Dockerfile locally, preferably in an empty directory and run:
10 docker tag my-app localhost:5000/my-app:0.1.0 You should now have an image named ‘my-app’ locally, check by using docker images (or your own image of course). You can then publish it to your local docker registry:
11 docker images
12 kubectl create -f my-app.yml deployment “my-app” created

service “my-app” created

13 kubectl get all show the pod and service
14 minikube service my-app –url The configuration exposes my-app outside of the cluster, you can get the address to access it by running
15 minikube dashboard start gui dashboard

URL is something like http://192.168.99.100:30000/

minikube ssh ssh to minikube
16 kubectl delete deploy my-app

kubectl delete service my-app

Delete deployment of my-app
17 minikube stop;

minikube delete;

rm -rf ~/.minikube .kube;

brew uninstall kubectl;

brew cask uninstall docker virtualbox minikube;

clean up everything

mysql-wordpress

 

# Commands What it does
1 kubectl version check version
2 kubectl create secret generic mysql-pass –from-literal=password=michelle create secret

use ‘michelle’ as password

3 kubectl get secrets verify secret
4 kubectl create -f mysql-deployment.yaml Deploy MySQL from the mysql-deployment.yaml file

The MYSQL_ROOT_PASSWORD environment variable sets the database password from the Secret

5 kubectl get pvc Verify that a PersistentVolume got dynamically provisioned
6 kubectl create -f wordpress-deployment.yaml Create a WordPress Service and Deployment from the wordpress-deployment.yaml file
7 kubectl get pvc kubectl get pvc
8 kubectl get services wordpress Verify that the Service is running by running the command
9 minikube service wordpress –url
10 kubectl delete secret mysql-pass

kubectl delete deployment -l app=wordpress

kubectl delete service -l app=wordpress

kubectl delete pvc -l app=wordpress

delete secret

delete all deployments and services

delete the PersistentVolumeClaims. The dynamically provisioned PersistentVolumes will be automatically deleted.

expose mysql to local
11 kubectl get pods retrieve the name of mysql pod
12 kubectl port-forward wordpress-mysql-86987f6b9-9zvbx 3306:3306 port forwarding

https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#port-forward/

13 connect to it use mysql workbench to connect via localhost:3306

References

  1. https://gist.github.com/kevin-smets/b91a34cea662d0c523968472a81788f7
  2. https://kubernetes.io/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/#objectives
  3. Kubectl https://kubernetes.io/docs/tasks/tools/install-kubectl/#configure-kubectl
  4. Minikube https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/

Blog at WordPress.com.

Up ↑