├── Curiosity └── Be_Updated.md ├── Database └── Relational_Database.md ├── DevOps ├── Server │ └── Linux │ │ ├── Bash_Command_Custom_Alias.md │ │ ├── Curl.md │ │ └── Ubuntu_Basic_Commands.md └── Virtualization │ └── Docker │ ├── Basic_Commands.md │ ├── Cleanup.md │ ├── Docker_Compose_Example_Format.md │ ├── Docker_Images │ ├── java8_ubuntu16.04 │ │ ├── Dockerfile │ │ └── build.bash │ ├── nodejs10_ubuntu16.04 │ │ ├── Dockerfile │ │ └── build.bash │ ├── nodejs8_ubuntu16.04 │ │ ├── Dockerfile │ │ └── build.bash │ ├── php5.3-apache2_ubuntu16.04 │ │ ├── 000-default.conf │ │ ├── Dockerfile │ │ └── build.bash │ ├── php5.6-apache2_ubuntu16.04 │ │ ├── 000-default.conf │ │ ├── Dockerfile │ │ ├── build.bash │ │ └── composer-install.bash │ ├── php5.6-nginx_ubuntu16.04 │ │ ├── Dockerfile │ │ ├── build.bash │ │ ├── composer-install.bash │ │ └── site-nginx.conf │ ├── php7.0-apache2_ubuntu16.04 │ │ ├── 000-default.conf │ │ ├── Dockerfile │ │ ├── build.bash │ │ └── composer-install.bash │ ├── php7.1-apache2_ubuntu16.04 │ │ ├── 000-default.conf │ │ ├── Dockerfile │ │ ├── build.bash │ │ └── composer-install.bash │ ├── php7.1-nginx_ubuntu16.04 │ │ ├── Dockerfile │ │ ├── build.bash │ │ ├── composer-install.bash │ │ └── site-nginx.conf │ ├── php7.2-apache2_ubuntu16.04 │ │ ├── 000-default.conf │ │ ├── Dockerfile │ │ ├── build.bash │ │ └── composer-install.bash │ ├── python3.6_ubuntu16.04 │ │ ├── Dockerfile │ │ └── build.bash │ └── shiny_rbase │ │ ├── Dockerfile │ │ ├── build.bash │ │ ├── shiny-server.conf │ │ └── shiny-server.sh │ ├── Dockerized_Your_Projects.md │ └── Examples │ └── LAMP_Stack.md ├── Development_Setup ├── Github_SSH_Keys.md └── Install_gcloud_CLI_Ubuntu.md ├── Development_Tools ├── Boostnote.md ├── Chrome_Extension.md ├── Cmder.md ├── FontForge.md ├── Sublime_Text.md ├── Visual_Studio_Code.md └── Zsh.md ├── LICENSE ├── README.md └── Web_Development └── Front_End ├── CSS └── CSS_Reference_Browser_Support.md └── JavaScript └── Debounce.md /Curiosity/Be_Updated.md: -------------------------------------------------------------------------------- 1 | # Be Updated 2 | 3 | ## Information Technology 4 | 5 | - How to stay updated with the changes happening on the IT industry. 6 | 7 | - Daily: 8 | 9 | - Shows daily trending GitHub repo, you can opt to receive daily email: 10 | 11 | - 12 | 13 | - 14 | 15 | - More on technologies: 16 | 17 | - Medium: 18 | 19 | - 20 | 21 | - Weekly News Letters: 22 | 23 | - 24 | 25 | - 26 | 27 | - 28 | 29 | - 30 | 31 | - The Hacker News: 32 | 33 | - 34 | 35 | - Tip: It's too much information to grasp for one day. So make sure you do glance, but not get too much dwelve in it. 36 | -------------------------------------------------------------------------------- /Database/Relational_Database.md: -------------------------------------------------------------------------------- 1 | # Relational Database 2 | 3 | ## Form Normalization 4 | 5 | ### 1NF - First Normal Form 6 | 7 | - The most basic of normal forms. 8 | 9 | - The table values must be ```atomic```. 10 | 11 | - The table must be ```isomorphic```. 12 | 13 | 1. There's no top-to-bottom ordering to the rows. 14 | 15 | 2. There's no left-to-right ordering to the columns. 16 | 17 | 3. There are no duplicate rows. 18 | 19 | 4. Every row-and-column intersection contains exactly one value from the applicable domain (and nothing else). 20 | 21 | 5. All columns are regular [i.e. rows have no hidden components such as row IDs, object IDs, or hidden timestamps]. 22 | 23 | - Each cell in the table must contain only one piece of information and there can be no duplicate rows. 24 | 25 | #### Customer Table 26 | 27 | | Customer ID | First Name | Last Name | Telephone Number | 28 | | ----------- | ---------- | --------- | ---------------- | 29 | | 123 | John | Doe | 555-861-2025 | 30 | | 123 | John | Doe | 192-122-1111 | 31 | | 456 | Michael | Sauce | 182-929-2929 | 32 | | 456 | Michael | Sauce | (555) 403-1659 Ext. 53 | 33 | | 789 | Eunice | Calm | 555-808-9633 | 34 | 35 | - Note that the "ID" is no longer unique in this solution with duplicated customers. To uniquely identify a row, we need to use a combination of (ID, Telephone Number). The value of the combination is unique although each column separately contains repeated values. Being able to uniquely identify a row (tuple) is a requirement of 1NF. 36 | 37 | #### Customer Info Table 38 | 39 | | Customer ID | First Name | Last Name | 40 | | ----------- | ---------- | --------- | 41 | | 123 | John | Doe | 42 | | 456 | Michael | Sauce | 43 | | 789 | Eunice | Calm | 44 | 45 | #### Customer Contact Table 46 | 47 | | ID | Customer ID | Telephone Number | 48 | | -- | ----------- | ---------------- | 49 | | 1 | 123 | 555-861-2025 | 50 | | 2 | 123 | 192-122-1111 | 51 | | 3 | 456 | 182-929-2929 | 52 | | 4 | 456 | (555) 403-1659 Ext. 53 | 53 | | 5 | 789 | 555-808-9633 | 54 | 55 | - Columns do not contain more than one telephone number in this design. Instead, each Customer-to-Telephone Number link appears on its own row. Using Customer ID as key, a one-to-many relationship exists between the name and the number tables. A row in the "parent" table, Customer Name, can be associated with many telephone number rows in the "child" table, Customer Telephone Number, but each telephone number belongs to one, and only one customer. It is worth noting that this design meets the additional requirements for second and third normal form. 56 | 57 | - Reference: 58 | 59 | ### 2NF - Second Normal Form 60 | 61 | - A database is said to be in 2NF - Second Normal Form if: 62 | 63 | 1. The database meets 1NF requirements. 64 | 65 | 2. Each column in a table represents what the primary key is describing. 66 | 67 | - A functional dependency on part of any candidate key is a violation of 2NF. In addition to the primary key, the relation may contain other candidate keys; it is necessary to establish that no non-prime attributes have part-key dependencies on any of these candidate keys. 68 | 69 | #### Manufacturer Table 70 | 71 | | Manufacturer | Model | Model Full Name | Manufacturer Country | 72 | | ------------ | ----- | --------------- | -------------------- | 73 | | Forte | X-Prime | Forte X-Prime | Italy | 74 | | Forte | Ultraclean | Forte Ultraclean | Italy | 75 | | Dent-o-Fresh | EZbrush | Dent-o-Fresh | EZbrush USA | 76 | | Kobayashi | ST-60 | Kobayashi ST-60 | Japan | 77 | | Hoch | Toothmaster | Hoch Toothmaster | Germany | 78 | | Hoch | X-Prime | Hoch X-Prime | Germany | 79 | 80 | - Even if the designer has specified the primary key as {Model Full Name}, the relation is not in 2NF because of the other candidate keys. {Manufacturer, Model} is also a candidate key, and Manufacturer Country is dependent on a proper subset of it: Manufacturer. To make the design conform to 2NF, it is necessary to have two relations: 81 | 82 | #### Manufacturer Location Table 83 | 84 | | Manufacturer | Manufacturer Country | 85 | | ------------ | -------------------- | 86 | | Forte | Italy | 87 | | Dent-o-Fresh | USA | 88 | | Kobayashi | Japan | 89 | | Hoch | Germany | 90 | 91 | #### Manufacturer Model Table 92 | 93 | | Manufacturer | Model | Model Full Name | 94 | | ------------ | ----- | --------------- | 95 | | Forte | X-Prime | Forte X-Prime | 96 | | Forte | Ultraclean | Forte Ultraclean | 97 | | Dent-o-Fresh | EZbrush | Dent-o-Fresh EZbrush | 98 | | Kobayashi | ST-60 | Kobayashi ST-60 | 99 | | Hoch | Toothmaster | Hoch Toothmaster | 100 | | Hoch | X-Prime | Hoch X-Prime | 101 | 102 | - Reference: 103 | 104 | ### 3NF - Third Normal Form 105 | 106 | - A database is said to be in Third Normal Form if: 107 | 108 | 1. The databse meets 2NF requirements. 109 | 110 | 2. Any column, that is not the primary key, is not dependent on any other column. 111 | 112 | #### Courses Table 113 | 114 | | Course | Semester | Places | TeacherID | TeacherName | 115 | | ------ | -------- | ------ | --------- | ----------- | 116 | | IT101 | 2009-1 | 100 | 332 | Mr Jones | 117 | | IT101 | 2009-2 | 100 | 332 | Mr Jones | 118 | | IT102 | 2009-1 | 200 | 495 | Mr Bentley | 119 | | IT102 | 2010-1 | 150 | 332 | Mr Jones | 120 | | IT103 | 2009-2 | 120 | 242 | Mrs Smith | 121 | 122 | - Now it should be obvious that TeacherName is dependent on TeacherID - so this is not in 3NF. To fix this, we do much the same as we did in 2NF - take TeacherName out of this table, and put it in its own, which has TeacherID as the key. 123 | 124 | #### Teachers Table 125 | 126 | | TeacherID | TeacherName | 127 | | --------- |-------------| 128 | | 332 | Mr Jones | 129 | | 495 | Mr Bentley | 130 | | 242 | Mrs Smith | 131 | 132 | ### Simplified Definition 133 | 134 | - 1NF - must be atomic table and no duplicate in any direction. 135 | 136 | - 2NF - must passed the 1NF and if there's any column dependent on the primary key column, create a new table to pass the 2NF. 137 | 138 | - 3NF - must passed the 2NF and if there's any column which is not dependent on the primary key column but dependent on any other foreign key column in the same table, create a new table to pass the 3NF. 139 | -------------------------------------------------------------------------------- /DevOps/Server/Linux/Bash_Command_Custom_Alias.md: -------------------------------------------------------------------------------- 1 | # Bash Command Custom Alias 2 | 3 | - Open user .bashrc 4 | 5 | ```text 6 | vim ~/.bashrc 7 | ``` 8 | 9 | - Go to the end of the file 10 | 11 | - Using vim, hitting G or shift + G 12 | 13 | - Add the alias 14 | 15 | ```text 16 | alias custom-command='execute other command' 17 | ``` 18 | 19 | - Save the edited file 20 | 21 | - Using vim, press Escape then type the characters below. 22 | 23 | ```text 24 | :wq 25 | ``` 26 | 27 | - Install the new .bashrc cotent 28 | 29 | ```text 30 | source ~/.bashrc 31 | ``` 32 | 33 | - Reference: 34 | -------------------------------------------------------------------------------- /DevOps/Server/Linux/Curl.md: -------------------------------------------------------------------------------- 1 | # Curl 2 | 3 | - Curl Testing Endpoint in "application/json" Content Type. 4 | 5 | ```text 6 | curl -i -X [Your METHOD] -H "Content-Type:application/json" http://host/endpoint -d '{"uid": "1", "gender": "m", "token": "sandbox"}' 7 | ``` 8 | -------------------------------------------------------------------------------- /DevOps/Server/Linux/Ubuntu_Basic_Commands.md: -------------------------------------------------------------------------------- 1 | # Linux Basic Commands 2 | 3 | - Compatible and Tested with: 14.04+, 16.04+, 18.04+ 4 | 5 | ## FOLDER AND FILE PERMISSION SETUP 6 | 7 | - Change mode all with group write. 8 | 9 | ```text 10 | chmod -R g+w /path 11 | ``` 12 | 13 | - Change mode folder permission to drwxr-xr-x, will assign read, write and execute permission to the owner, and just read and execute permission to everyone. 14 | 15 | ```text 16 | chmod -R 755 = for directories 17 | ``` 18 | 19 | - Change mode file permission to -rw-r--r--, also means that files are readable and writeable by the owner of the file and readable by users in the group owner of that file and readable by everyone else. 20 | 21 | ```text 22 | chmod -R 644 = for files 23 | ``` 24 | 25 | - Change owner of the directories/files. 26 | 27 | ```text 28 | chown -R www-data:www-data /path 29 | chown {user:group} path/file.ext 30 | ``` 31 | 32 | - For accurate or automatic set of permission. 33 | 34 | ```text 35 | find {./path} -type d -exec chmod 755 {} \; # For Directory 36 | find {./path} -type f -exec chmod -Rf 644 {} \; # For Files 37 | ``` 38 | 39 | ## FOLDER AND FILE COMMANDS 40 | 41 | - File Rename. Its primary purpose is moving files and folders, but it can also rename them, since the act of renaming a file is interpreted by the filesystem as moving it from one name to another. 42 | 43 | ```text 44 | mv /path/source /path/destination 45 | ``` 46 | 47 | - File Copy. 48 | 49 | ```text 50 | cp {-R} source/file path/file (-R is for recursive copy) 51 | cp source/file /path/file (So far this is for the single copy tested) 52 | ``` 53 | 54 | - Folder or File Remove. (This will delete permanently) 55 | 56 | ```text 57 | rm -rf path/file 58 | ``` 59 | 60 | - Change directory view. 61 | 62 | ```text 63 | cd path/file 64 | ``` 65 | 66 | - View file using VIM. (This will need ```apt-get install vim```) 67 | 68 | ```text 69 | vim path/file 70 | ``` 71 | 72 | - To view the Root trash bin. 73 | 74 | ```text 75 | /root/.local/share/Trash/trash_files 76 | ``` 77 | 78 | - To compress a file using tar. 79 | 80 | ```text 81 | tar -czvf name-of-archive.tar.gz /path/to/directory-or-file 82 | ``` 83 | 84 | - To decompress a file using tar. 85 | 86 | ```text 87 | tar -xzvf /path/to/source/archive.tar.gz -C /tmp 88 | ``` 89 | 90 | - To check the directory or file size. 91 | 92 | ```text 93 | du -sh directory/ 94 | ``` 95 | 96 | - To check the free space in the disk 97 | 98 | ```text 99 | df -h . 100 | ``` 101 | 102 | ## NETWORK CONFIGURATION 103 | 104 | - To view the nmap NAT for host/ip. (This will need ```apt-get install nmap```) 105 | 106 | ```text 107 | nmap {host/ip} 108 | ``` 109 | 110 | - To show ip address of the current machine. 111 | 112 | ```text 113 | ip addr show 114 | ``` 115 | 116 | - IP Tables. (This will need ```apt-get install iptables```) 117 | 118 | ```text 119 | iptables -t nat -L 120 | ``` 121 | 122 | - The Firewall for ubuntu, this may help for preventing unwanted access to the server, atleast a first layer of protection. 123 | 124 | ```text 125 | ufw enable 126 | ufw disable 127 | ufw allow {port} 128 | ufw deny {port} 129 | ufw reset 130 | ``` 131 | 132 | - To show the bridges in ubuntu. (This will need ```apt-get install bridge-utils```) 133 | 134 | ```text 135 | brctl show 136 | ``` 137 | 138 | - Flush DNS in Ubuntu/Linux. 139 | 140 | ```text 141 | sudo /etc/init.d/dns-clean restart 142 | ``` 143 | 144 | - Restart network in Ubuntu/Linux. 145 | 146 | ```text 147 | sudo /etc/init.d/networking force-reload 148 | ``` 149 | 150 | - Route Table Management (This will show the current list of route(s) in the table). 151 | 152 | ```text 153 | route add -net x.x.x.x (The IPADDR of route that will be adding) netmask 255.x.x.x gw (The current gateway of the local machine) 192.x.x.x 154 | route del -net x.x.x.x/24 (The destination IPADDR, the 24 will be depend on the size of the IPADDR by default 24 can be use) 155 | ``` 156 | 157 | - To set static DNS. 158 | 159 | - Reference: 160 | 161 | ```text 162 | vim /etc/network/interfaces 163 | # The loopback network interface 164 | auto lo 165 | iface lo inet loopback 166 | # The primary network interface 167 | auto eth0 168 | iface eth0 inet static 169 | address 192.168.X.X 170 | netmask 255.255.255.0 171 | gateway 192.168.X.X 172 | dns-nameservers X.X.X.X 173 | :wq (Save the changes) 174 | 175 | /etc/init.d/networking restart (Refresh all the configuration) 176 | ``` 177 | 178 | - Some Reference to achive this command: 179 | 180 | - 181 | 182 | - 183 | 184 | - 185 | 186 | - 187 | 188 | ## UTILITIES 189 | 190 | - VGA or graphic card status. 191 | 192 | ```text 193 | lspci -vnnn | perl -lne 'print if /^\d+\:.+(\[\S+\:\S+\])/' | grep VGA 194 | ``` 195 | 196 | - To search application in the current proccess of linux. 197 | 198 | ```text 199 | ps aux | grep {appname} 200 | ``` 201 | 202 | - This will kill the searched ID application in the current proccess of linux. 203 | 204 | ```text 205 | kill {id} 206 | ``` 207 | 208 | - To check the server version linux. 209 | 210 | ```text 211 | lsb_release -a 212 | ``` 213 | 214 | - To delete downloaded packages (.deb) already installed (and no longer needed). 215 | 216 | ```text 217 | apt-get clean 218 | ``` 219 | 220 | - To remove unnecessary packages (after uninstalling an app there could be packages you don't need anymore). 221 | 222 | ```text 223 | apt-get autoremove 224 | ``` 225 | 226 | - To show the real path of the running application. (ex. java) 227 | 228 | ```text 229 | update-alternatives --list {java} 230 | ``` 231 | 232 | - To show the hard drive usage. 233 | 234 | ```text 235 | df 236 | ``` 237 | 238 | - To show all the services available. 239 | 240 | ```text 241 | service --status-all 242 | ``` 243 | 244 | - To change the server or local machine timezone. 245 | 246 | ```text 247 | dpkg-reconfigure tzdata 248 | ``` 249 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Basic_Commands.md: -------------------------------------------------------------------------------- 1 | # Docker Basic Commands 2 | 3 | - Execute the interactive terminal in a container. 4 | 5 | ```text 6 | docker exec -it {container-id} bash 7 | ``` 8 | 9 | - Reference: 10 | 11 | - 12 | 13 | - 14 | 15 | - Show all the registered container. 16 | 17 | ```text 18 | docker ps --all 19 | ``` 20 | 21 | - Remove a specific container. 22 | 23 | ```text 24 | docker rm {container-id} 25 | ``` 26 | 27 | - Show all the registered images. 28 | 29 | ```text 30 | docker images 31 | ``` 32 | 33 | - Build an image. 34 | 35 | ```text 36 | docker build --tag={image-name:tag-version} {docker-file-path} 37 | ``` 38 | 39 | - Remove a specific image. 40 | 41 | ```text 42 | docker rmi {image-id|image-name} 43 | -f Option force removal of the docker image. 44 | ``` 45 | 46 | - Run a container. 47 | 48 | ```text 49 | docker run -it -p {host-port:container-port} {docker-image} 50 | ``` 51 | 52 | - Reference: 53 | 54 | - 55 | 56 | - Stop all the registered containers. 57 | 58 | ```text 59 | docker stop $(docker ps -a -q) 60 | ``` 61 | 62 | - Remove all the registered containers. 63 | 64 | ```text 65 | docker rm $(docker ps -a -q) 66 | ``` 67 | 68 | - Show the docker events. 69 | 70 | ```text 71 | docker events 72 | ``` 73 | 74 | - Reference: 75 | 76 | - 77 | 78 | - Show the docker logs. 79 | 80 | ```text 81 | docker logs 82 | ``` 83 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Cleanup.md: -------------------------------------------------------------------------------- 1 | # Cleanup 2 | 3 | - Once in a while, you may need to cleanup unused containers, volumes, images and networks. 4 | 5 | - *Warning:* Make sure to double check and backup the data that may depend on docker before committing any actions. 6 | 7 | - Remove unused volumes. 8 | 9 | ```text 10 | docker volume rm $(docker volume ls -qf dangling=true) 11 | ``` 12 | 13 | ```text 14 | docker volume ls -qf dangling=true | xargs -r docker volume rm 15 | ``` 16 | 17 | - Reference: 18 | 19 | - 20 | 21 | - Remove networks. 22 | 23 | - To show all the existing docker networks. 24 | 25 | ```text 26 | docker network ls 27 | docker network ls | grep "bridge" 28 | ``` 29 | 30 | - To remove all the unused bridge networks. 31 | 32 | ```text 33 | docker network rm $(docker network ls | grep "bridge" | awk '/ / { print $1 }') 34 | ``` 35 | 36 | - Remove docker images. 37 | 38 | - To show all existing docker images or with none name status. 39 | 40 | ```text 41 | docker images 42 | docker images | grep "none" 43 | ``` 44 | 45 | - To remove all the unused docker images. 46 | 47 | ```text 48 | docker rmi $(docker images --filter "dangling=true" -q --no-trunc) 49 | ``` 50 | 51 | ```text 52 | docker rmi $(docker images | grep "none" | awk '/ / { print $3 }') 53 | ``` 54 | 55 | - Reference: 56 | 57 | - 58 | 59 | - Remove docker containers. 60 | 61 | - To show all the existing docker containers. 62 | 63 | ```text 64 | docker ps 65 | docker ps -a 66 | ``` 67 | 68 | - To remove all the unused docker images. 69 | 70 | ```text 71 | docker rm $(docker ps -qa --no-trunc --filter "status=exited") 72 | ``` 73 | 74 | - Resize disk space for docker vm. 75 | 76 | ```text 77 | docker-machine create --driver virtualbox --virtualbox-disk-size "40000" default 78 | ``` 79 | 80 | - Reference: 81 | 82 | - 83 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Compose_Example_Format.md: -------------------------------------------------------------------------------- 1 | # Docker Compose Example Format 2 | 3 | ```yml 4 | version: '3.2' 5 | 6 | networks: 7 | compose-network: 8 | external: 9 | name: '' 10 | 11 | services: 12 | app: 13 | image: '' 14 | volumes: 15 | - ':' 16 | networks: 17 | compose-network: 18 | ipv4_address: '' 19 | ports: 20 | - ':' 21 | tty: true 22 | stdin_open: true 23 | restart: 'no' 24 | container_name: '' 25 | ``` 26 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/java8_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | RUN apt-get update -y && \ 4 | apt-get install -y --no-install-recommends \ 5 | default-jre \ 6 | default-jdk && \ 7 | add-apt-repository ppa:webupd8team/java && \ 8 | apt-get update -y && \ 9 | apt-get install -y --no-install-recommends \ 10 | oracle-java8-installer \ 11 | wget \ 12 | curl \ 13 | git \ 14 | git-core \ 15 | bash-completion && \ 16 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc 17 | EXPOSE 80 18 | ENTRYPOINT ["/bin/bash"] 19 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/java8_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="java8:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/nodejs10_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | RUN apt-get update -y && \ 4 | apt-get install -y --no-install-recommends \ 5 | # https://askubuntu.com/a/1000120 6 | software-properties-common \ 7 | wget \ 8 | curl \ 9 | git \ 10 | git-core \ 11 | bash-completion && \ 12 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 13 | curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ 14 | apt-get update -y && \ 15 | apt-get install -y --no-install-recommends \ 16 | nodejs \ 17 | build-essential 18 | EXPOSE 80 19 | ENTRYPOINT ["/bin/bash"] 20 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/nodejs10_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="nodejs10:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/nodejs8_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | RUN apt-get update -y && \ 4 | apt-get install -y --no-install-recommends \ 5 | # https://askubuntu.com/a/1000120 6 | software-properties-common \ 7 | wget \ 8 | curl \ 9 | git \ 10 | git-core \ 11 | bash-completion && \ 12 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 13 | curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ 14 | apt-get update -y && \ 15 | apt-get install -y --no-install-recommends \ 16 | nodejs \ 17 | build-essential 18 | EXPOSE 80 19 | ENTRYPOINT ["/bin/bash"] 20 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/nodejs8_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="nodejs8:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.3-apache2_ubuntu16.04/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | DocumentRoot /var/www/site 4 | 5 | 6 | Options Indexes FollowSymLinks MultiViews 7 | AllowOverride All 8 | Order deny,allow 9 | Allow from all 10 | 11 | 12 | ErrorLog ${APACHE_LOG_DIR}/error.log 13 | 14 | 15 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.3-apache2_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | SHELL ["/bin/bash", "-c"] 4 | COPY 000-default.conf /tmp/ 5 | RUN apt-get update -y && \ 6 | apt-get install -y --no-install-recommends \ 7 | # https://askubuntu.com/a/1000120 8 | software-properties-common \ 9 | wget \ 10 | curl \ 11 | # https://stackoverflow.com/questions/36674667/png-h-file-not-found-linux 12 | libpng-dev \ 13 | # https://community.c9.io/t/phpbrew-and-apache/3565/5 14 | apache2 \ 15 | apache2-dev \ 16 | # https://github.com/phpbrew/phpbrew/wiki/Requirement 17 | php7.0 \ 18 | php7.0-curl \ 19 | php7.0-json \ 20 | php7.0-cgi \ 21 | php7.0-fpm \ 22 | # To fix issue related to: https://github.com/phpbrew/phpbrew/issues/1149 23 | php7.0-bz2 \ 24 | autoconf \ 25 | automake \ 26 | libxml2-dev \ 27 | libcurl4-openssl-dev \ 28 | libssl-dev \ 29 | openssl \ 30 | gettext \ 31 | libicu-dev \ 32 | libmcrypt-dev \ 33 | libmcrypt4 \ 34 | libbz2-dev \ 35 | libreadline-dev \ 36 | build-essential \ 37 | libmhash-dev \ 38 | libmhash2 \ 39 | libxslt1-dev \ 40 | libjpeg-dev \ 41 | libfreetype6-dev \ 42 | git \ 43 | composer \ 44 | git-core \ 45 | bash-completion && \ 46 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 47 | # https://github.com/phpbrew/phpbrew/wiki/Quick-Start 48 | # http://sandeep-bisht.blogspot.com/2017/08/phpbrew-install-php-53-in-ubuntu-1604.html 49 | curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew && \ 50 | chmod +x phpbrew && \ 51 | mv phpbrew /usr/local/bin/phpbrew && \ 52 | phpbrew init && \ 53 | echo "[[ -e ~/.phpbrew/bashrc ]] && . ~/.phpbrew/bashrc" >> ~/.bashrc && \ 54 | . ~/.phpbrew/bashrc && \ 55 | phpbrew update --old && \ 56 | phpbrew known && \ 57 | phpbrew variants && \ 58 | phpbrew --debug install 5.3.28 +bz2 +calendar +cli +gd +ctype +dom +iconv +fileinfo +filter +ipc +json +mbregex +mbstring +mhash +mcrypt +pcntl +pcre +pdo +phar +posix +readline +sockets +tokenizer +xml +curl +zip +mysql +intl +debug +apxs2 && \ 59 | phpbrew use 5.3.28 && \ 60 | # https://github.com/phpbrew/phpbrew/issues/106#issuecomment-26313340 61 | phpbrew ext install gd -- --with-libdir=lib/i386-linux-gnu --with-gd=shared --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr && \ 62 | # https://askubuntu.com/questions/453377/how-to-enable-event-mpm-apache-2-4-on-ubuntu-14-04-with-thread-safe-php 63 | a2dismod mpm_event && \ 64 | a2enmod mpm_prefork && \ 65 | a2enmod rewrite && \ 66 | a2enmod headers && \ 67 | a2enmod proxy_fcgi setenvif actions && \ 68 | mv /tmp/000-default.conf /etc/apache2/sites-enabled/000-default.conf && \ 69 | echo "AddType application/x-httpd-php .php" >> /etc/apache2/mods-enabled/php5.load && \ 70 | sed -i "s/short_open_tag = On/short_open_tag = Off/" ~/.phpbrew/php/php-5.3.28/etc/php.ini && \ 71 | sed -i "s/date.timezone = ;/date.timezone = Asia\/Manila/" ~/.phpbrew/php/php-5.3.28/etc/php.ini && \ 72 | sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" ~/.phpbrew/php/php-5.3.28/etc/php.ini && \ 73 | echo "ServerName localhost" >> /etc/apache2/apache2.conf && \ 74 | chown -R www-data:www-data /var/www && \ 75 | find /var/www -type d -exec chmod 755 {} \; && \ 76 | find /var/www -type f -exec chmod 644 {} \; 77 | ENV APACHE_RUN_USER www-data 78 | ENV APACHE_RUN_GROUP www-data 79 | ENV APACHE_LOG_DIR /var/log/apache2 80 | ENV APACHE_LOCK_DIR /var/lock/apache2 81 | ENV APACHE_PID_FILE /var/run/apache2.pid 82 | EXPOSE 80 83 | ENTRYPOINT ["/bin/bash"] 84 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.3-apache2_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="php5.3-apache2:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.6-apache2_ubuntu16.04/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | DocumentRoot /var/www/site 4 | 5 | 6 | Options Indexes FollowSymLinks MultiViews 7 | AllowOverride All 8 | Order deny,allow 9 | Allow from all 10 | 11 | 12 | ErrorLog ${APACHE_LOG_DIR}/error.log 13 | 14 | 15 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.6-apache2_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | COPY 000-default.conf composer-install.bash /tmp/ 4 | RUN apt-get update -y && \ 5 | apt-get install -y --no-install-recommends \ 6 | # https://askubuntu.com/a/1000120 7 | software-properties-common \ 8 | wget \ 9 | curl \ 10 | git \ 11 | git-core \ 12 | bash-completion && \ 13 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 14 | LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ 15 | apt-get update -y && \ 16 | apt-get install -y --no-install-recommends \ 17 | php-xdebug \ 18 | php-gd \ 19 | libapache2-mod-php5.6 \ 20 | apache2 \ 21 | php5.6 \ 22 | php5.6-fpm \ 23 | php5.6-mbstring \ 24 | php5.6-curl \ 25 | php5.6-mcrypt \ 26 | php5.6-tokenizer \ 27 | php5.6-dom \ 28 | php5.6-zip \ 29 | php5.6-mysql \ 30 | php5.6-imap \ 31 | php5.6-xml \ 32 | php5.6-cli \ 33 | php5.6-gd \ 34 | php5.6-mongo \ 35 | php5.6-intl && \ 36 | mv /tmp/000-default.conf /etc/apache2/sites-enabled/000-default.conf && \ 37 | chmod +x /tmp/composer-install.bash && \ 38 | sh /tmp/composer-install.bash && \ 39 | rm /tmp/composer-install.bash && \ 40 | a2enmod php5.6 && \ 41 | a2enconf php5.6-fpm && \ 42 | a2enmod rewrite && \ 43 | a2enmod headers && \ 44 | a2enmod proxy_fcgi setenvif && \ 45 | cp /usr/lib/php/5.6/php.ini-development /etc/php/5.6/apache2 && \ 46 | mv /etc/php/5.6/apache2/php.ini /etc/php/5.6/apache2/php.ini.bak && \ 47 | mv /etc/php/5.6/apache2/php.ini-development /etc/php/5.6/apache2/php.ini && \ 48 | sed -i "s/short_open_tag = On/short_open_tag = Off/" /etc/php/5.6/apache2/php.ini && \ 49 | sed -i "s/date.timezone = ;/date.timezone = Asia\/Manila/" /etc/php/5.6/apache2/php.ini && \ 50 | sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/5.6/apache2/php.ini && \ 51 | echo "ServerName localhost" >> /etc/apache2/apache2.conf && \ 52 | chown -R www-data:www-data /var/www && \ 53 | find /var/www -type d -exec chmod 755 {} \; && \ 54 | find /var/www -type f -exec chmod 644 {} \; 55 | ENV APACHE_RUN_USER www-data 56 | ENV APACHE_RUN_GROUP www-data 57 | ENV APACHE_LOG_DIR /var/log/apache2 58 | ENV APACHE_LOCK_DIR /var/lock/apache2 59 | ENV APACHE_PID_FILE /var/run/apache2.pid 60 | EXPOSE 80 61 | ENTRYPOINT ["/bin/bash"] 62 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.6-apache2_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="php5.6-apache2:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.6-apache2_ubuntu16.04/composer-install.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" 4 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 5 | ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" 6 | 7 | if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] 8 | then 9 | >&2 echo 'ERROR: Invalid installer signature' 10 | rm composer-setup.php 11 | exit 1 12 | fi 13 | 14 | php composer-setup.php --install-dir=/usr/local/bin --filename=composer 15 | RESULT=$? 16 | rm composer-setup.php 17 | exit $RESULT 18 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.6-nginx_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | COPY site-nginx.conf composer-install.bash /tmp/ 4 | RUN apt-get update -y && \ 5 | apt-get install -y --no-install-recommends \ 6 | # https://askubuntu.com/a/1000120 7 | software-properties-common \ 8 | wget \ 9 | curl \ 10 | git \ 11 | git-core \ 12 | bash-completion && \ 13 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 14 | LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ 15 | apt-get update -y && \ 16 | apt-get install -y --no-install-recommends \ 17 | php-xdebug \ 18 | php-gd \ 19 | nginx \ 20 | php5.6 \ 21 | php5.6-fpm \ 22 | php5.6-mbstring \ 23 | php5.6-curl \ 24 | php5.6-mcrypt \ 25 | php5.6-tokenizer \ 26 | php5.6-dom \ 27 | php5.6-zip \ 28 | php5.6-mysql \ 29 | php5.6-imap \ 30 | php5.6-xml \ 31 | php5.6-cli \ 32 | php5.6-gd \ 33 | php5.6-intl && \ 34 | mv /tmp/site-nginx.conf /etc/nginx/sites-available/ && \ 35 | chmod +x /tmp/composer-install.bash && \ 36 | sh /tmp/composer-install.bash && \ 37 | rm /tmp/composer-install.bash && \ 38 | ln -s /etc/nginx/sites-available/site-nginx.conf /etc/nginx/sites-enabled/site && \ 39 | chown -R www-data:www-data /var/www && \ 40 | find /var/www -type d -exec chmod 755 {} \; && \ 41 | find /var/www -type f -exec chmod 644 {} \; && \ 42 | echo "\ndaemon off;" >> /etc/nginx/site-nginx.conf && \ 43 | sed -i -e "s/;\?daemonize\s*=\s*yes/daemonize = no/g" /etc/php/5.6/fpm/php-fpm.conf && \ 44 | echo "\ncgi.fix_pathinfo = 0" >> /etc/php/5.6/fpm/php.ini && \ 45 | echo "\nfile_uploads = On" >> /etc/php/5.6/fpm/php.ini && \ 46 | echo "\nallow_url_fopen = On" >> /etc/php/5.6/fpm/php.ini && \ 47 | echo "\nmemory_limit = 512M" >> /etc/php/5.6/fpm/php.ini && \ 48 | echo "\nmax_execution_time = 360" >> /etc/php/5.6/fpm/php.ini && \ 49 | echo "\nupload_max_filesize = 100M" >> /etc/php/5.6/fpm/php.ini && \ 50 | echo "\npost_max_size = 100M" >> /etc/php/5.6/fpm/php.ini && \ 51 | echo "\ndate.timezone = Asia\/Manila" >> /etc/php/5.6/fpm/php.ini 52 | EXPOSE 80 53 | ENTRYPOINT ["/bin/bash"] 54 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.6-nginx_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="php5.6-nginx:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.6-nginx_ubuntu16.04/composer-install.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" 4 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 5 | ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" 6 | 7 | if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] 8 | then 9 | >&2 echo 'ERROR: Invalid installer signature' 10 | rm composer-setup.php 11 | exit 1 12 | fi 13 | 14 | php composer-setup.php --install-dir=/usr/local/bin --filename=composer 15 | RESULT=$? 16 | rm composer-setup.php 17 | exit $RESULT 18 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php5.6-nginx_ubuntu16.04/site-nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80 default_server; 4 | listen [::]:80 default_server; 5 | 6 | root /var/www/site; 7 | 8 | index index.php index.html index.htm index.nginx-debian.html; 9 | 10 | server_name localhost; 11 | 12 | location / { 13 | add_header 'Access-Control-Allow-Origin' '*'; 14 | add_header 'Access-Control-Allow-Methods' 'GET, POST'; 15 | add_header 'Access-Control-Allow-Headers' 'x-requested-with, Content-Type, Origin, Authorization, accept, client-security-token, token, X-Auth-Token'; 16 | try_files $uri $uri/ /index.php?$query_string; 17 | } 18 | 19 | error_log /var/log/nginx/site.error.log; 20 | error_page 404 /404.html; 21 | error_page 500 502 503 504 /50x.html; 22 | 23 | location = /50x.html { 24 | root /usr/share/nginx/html; 25 | } 26 | 27 | location ~ \.php$ { 28 | try_files $uri /index.php =404; 29 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 30 | fastcgi_pass unix:/var/run/php/php5.6-fpm.sock; 31 | fastcgi_index index.php; 32 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 33 | include fastcgi_params; 34 | } 35 | 36 | location ~ /\.ht { 37 | deny all; 38 | } 39 | 40 | location ~ /\.git { 41 | deny all; 42 | } 43 | 44 | client_max_body_size 1024M; 45 | } 46 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.0-apache2_ubuntu16.04/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | DocumentRoot /var/www/site 4 | 5 | 6 | Options Indexes FollowSymLinks MultiViews 7 | AllowOverride All 8 | Order deny,allow 9 | Allow from all 10 | 11 | 12 | ErrorLog ${APACHE_LOG_DIR}/error.log 13 | 14 | 15 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.0-apache2_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | COPY 000-default.conf composer-install.bash /tmp/ 4 | RUN apt-get update -y && \ 5 | apt-get install -y --no-install-recommends \ 6 | # https://askubuntu.com/a/1000120 7 | software-properties-common \ 8 | wget \ 9 | curl \ 10 | git \ 11 | git-core \ 12 | bash-completion && \ 13 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 14 | LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ 15 | apt-get update -y && \ 16 | apt-get install -y --no-install-recommends \ 17 | php-xdebug \ 18 | php-gd \ 19 | libapache2-mod-php7.0 \ 20 | apache2 \ 21 | php7.0 \ 22 | php7.0-fpm \ 23 | php7.0-mbstring \ 24 | php7.0-curl \ 25 | php7.0-mcrypt \ 26 | php7.0-tokenizer \ 27 | php7.0-dom \ 28 | php7.0-zip \ 29 | php7.0-mysql \ 30 | php7.0-imap \ 31 | php7.0-xml \ 32 | php7.0-cli \ 33 | php7.0-gd \ 34 | php7.0-intl && \ 35 | mv /tmp/000-default.conf /etc/apache2/sites-enabled/000-default.conf && \ 36 | chmod +x /tmp/composer-install.bash && \ 37 | sh /tmp/composer-install.bash && \ 38 | rm /tmp/composer-install.bash && \ 39 | a2enmod php7.0 && \ 40 | a2enconf php7.0-fpm && \ 41 | a2enmod rewrite && \ 42 | a2enmod headers && \ 43 | cp /usr/lib/php/7.0/php.ini-development /etc/php/7.0/apache2 && \ 44 | mv /etc/php/7.0/apache2/php.ini /etc/php/7.0/apache2/php.ini.bak && \ 45 | mv /etc/php/7.0/apache2/php.ini-development /etc/php/7.0/apache2/php.ini && \ 46 | sed -i "s/short_open_tag = /short_open_tag = Off/" /etc/php/7.0/apache2/php.ini && \ 47 | sed -i "s/date.timezone = ;/date.timezone = Asia\/Manila/" /etc/php/7.0/apache2/php.ini && \ 48 | sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.0/apache2/php.ini && \ 49 | echo "ServerName localhost" >> /etc/apache2/apache2.conf && \ 50 | chown -R www-data:www-data /var/www && \ 51 | find /var/www -type d -exec chmod 755 {} \; && \ 52 | find /var/www -type f -exec chmod 644 {} \; 53 | ENV APACHE_RUN_USER www-data 54 | ENV APACHE_RUN_GROUP www-data 55 | ENV APACHE_LOG_DIR /var/log/apache2 56 | ENV APACHE_LOCK_DIR /var/lock/apache2 57 | ENV APACHE_PID_FILE /var/run/apache2.pid 58 | EXPOSE 80 59 | ENTRYPOINT ["/bin/bash"] 60 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.0-apache2_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="php7.0-apache2:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.0-apache2_ubuntu16.04/composer-install.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" 4 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 5 | ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" 6 | 7 | if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] 8 | then 9 | >&2 echo 'ERROR: Invalid installer signature' 10 | rm composer-setup.php 11 | exit 1 12 | fi 13 | 14 | php composer-setup.php --install-dir=/usr/local/bin --filename=composer 15 | RESULT=$? 16 | rm composer-setup.php 17 | exit $RESULT 18 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.1-apache2_ubuntu16.04/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | DocumentRoot /var/www/site 4 | 5 | 6 | Options Indexes FollowSymLinks MultiViews 7 | AllowOverride All 8 | Order deny,allow 9 | Allow from all 10 | 11 | 12 | ErrorLog ${APACHE_LOG_DIR}/error.log 13 | 14 | 15 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.1-apache2_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | COPY 000-default.conf composer-install.bash /tmp/ 4 | RUN apt-get update -y && \ 5 | apt-get install -y --no-install-recommends \ 6 | # https://askubuntu.com/a/1000120 7 | software-properties-common \ 8 | wget \ 9 | curl \ 10 | git \ 11 | git-core \ 12 | bash-completion && \ 13 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 14 | LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ 15 | apt-get update -y && \ 16 | apt-get install -y --no-install-recommends \ 17 | php-xdebug \ 18 | php-gd \ 19 | libapache2-mod-php7.1 \ 20 | apache2 \ 21 | php7.1 \ 22 | php7.1-fpm \ 23 | php7.1-mbstring \ 24 | php7.1-curl \ 25 | php7.1-mcrypt \ 26 | php7.1-tokenizer \ 27 | php7.1-dom \ 28 | php7.1-zip \ 29 | php7.1-mysql \ 30 | php7.1-imap \ 31 | php7.1-xml \ 32 | php7.1-cli \ 33 | php7.1-gd \ 34 | php7.1-intl && \ 35 | mv /tmp/000-default.conf /etc/apache2/sites-enabled/000-default.conf && \ 36 | chmod +x /tmp/composer-install.bash && \ 37 | sh /tmp/composer-install.bash && \ 38 | rm /tmp/composer-install.bash && \ 39 | a2enmod php7.1 && \ 40 | a2enconf php7.1-fpm && \ 41 | a2enmod rewrite && \ 42 | a2enmod headers && \ 43 | cp /usr/lib/php/7.1/php.ini-development /etc/php/7.1/apache2 && \ 44 | mv /etc/php/7.1/apache2/php.ini /etc/php/7.1/apache2/php.ini.bak && \ 45 | mv /etc/php/7.1/apache2/php.ini-development /etc/php/7.1/apache2/php.ini && \ 46 | sed -i "s/short_open_tag = /short_open_tag = Off/" /etc/php/7.1/apache2/php.ini && \ 47 | sed -i "s/date.timezone = ;/date.timezone = Asia\/Manila/" /etc/php/7.1/apache2/php.ini && \ 48 | sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.1/apache2/php.ini && \ 49 | echo "ServerName localhost" >> /etc/apache2/apache2.conf && \ 50 | chown -R www-data:www-data /var/www && \ 51 | find /var/www -type d -exec chmod 755 {} \; && \ 52 | find /var/www -type f -exec chmod 644 {} \; 53 | ENV APACHE_RUN_USER www-data 54 | ENV APACHE_RUN_GROUP www-data 55 | ENV APACHE_LOG_DIR /var/log/apache2 56 | ENV APACHE_LOCK_DIR /var/lock/apache2 57 | ENV APACHE_PID_FILE /var/run/apache2.pid 58 | EXPOSE 80 59 | ENTRYPOINT ["/bin/bash"] 60 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.1-apache2_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="php7.1-apache2:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.1-apache2_ubuntu16.04/composer-install.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" 4 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 5 | ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" 6 | 7 | if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] 8 | then 9 | >&2 echo 'ERROR: Invalid installer signature' 10 | rm composer-setup.php 11 | exit 1 12 | fi 13 | 14 | php composer-setup.php --install-dir=/usr/local/bin --filename=composer 15 | RESULT=$? 16 | rm composer-setup.php 17 | exit $RESULT 18 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.1-nginx_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | COPY site-nginx.conf composer-install.bash /tmp/ 4 | RUN apt-get update -y && \ 5 | apt-get install -y --no-install-recommends \ 6 | # https://askubuntu.com/a/1000120 7 | software-properties-common \ 8 | wget \ 9 | curl \ 10 | git \ 11 | git-core \ 12 | bash-completion && \ 13 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 14 | LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ 15 | apt-get update -y && \ 16 | apt-get install -y --no-install-recommends \ 17 | php-xdebug \ 18 | php-gd \ 19 | nginx \ 20 | php7.1 \ 21 | php7.1-fpm \ 22 | php7.1-mbstring \ 23 | php7.1-curl \ 24 | php7.1-mcrypt \ 25 | php7.1-tokenizer \ 26 | php7.1-dom \ 27 | php7.1-zip \ 28 | php7.1-mysql \ 29 | php7.1-imap \ 30 | php7.1-xml \ 31 | php7.1-cli \ 32 | php7.1-gd \ 33 | php7.1-intl && \ 34 | mv /tmp/site-nginx.conf /etc/nginx/sites-available/ && \ 35 | chmod +x /tmp/composer-install.bash && \ 36 | sh /tmp/composer-install.bash && \ 37 | rm /tmp/composer-install.bash && \ 38 | ln -s /etc/nginx/sites-available/site-nginx.conf /etc/nginx/sites-enabled/site && \ 39 | chown -R www-data:www-data /var/www && \ 40 | find /var/www -type d -exec chmod 755 {} \; && \ 41 | find /var/www -type f -exec chmod 644 {} \; && \ 42 | echo "\ndaemon off;" >> /etc/nginx/site-nginx.conf && \ 43 | sed -i -e "s/;\?daemonize\s*=\s*yes/daemonize = no/g" /etc/php/7.1/fpm/php-fpm.conf && \ 44 | echo "\ncgi.fix_pathinfo = 0" >> /etc/php/7.1/fpm/php.ini && \ 45 | echo "\nfile_uploads = On" >> /etc/php/7.1/fpm/php.ini && \ 46 | echo "\nallow_url_fopen = On" >> /etc/php/7.1/fpm/php.ini && \ 47 | echo "\nmemory_limit = 512M" >> /etc/php/7.1/fpm/php.ini && \ 48 | echo "\nmax_execution_time = 360" >> /etc/php/7.1/fpm/php.ini && \ 49 | echo "\nupload_max_filesize = 100M" >> /etc/php/7.1/fpm/php.ini && \ 50 | echo "\npost_max_size = 100M" >> /etc/php/7.1/fpm/php.ini && \ 51 | echo "\ndate.timezone = Asia\/Manila" >> /etc/php/7.1/fpm/php.ini 52 | EXPOSE 80 53 | CMD ["/bin/bash"] 54 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.1-nginx_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="php7.1-nginx:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.1-nginx_ubuntu16.04/composer-install.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" 4 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 5 | ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" 6 | 7 | if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] 8 | then 9 | >&2 echo 'ERROR: Invalid installer signature' 10 | rm composer-setup.php 11 | exit 1 12 | fi 13 | 14 | php composer-setup.php --install-dir=/usr/local/bin --filename=composer 15 | RESULT=$? 16 | rm composer-setup.php 17 | exit $RESULT 18 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.1-nginx_ubuntu16.04/site-nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | 3 | listen 80 default_server; 4 | listen [::]:80 default_server; 5 | 6 | root /var/www/site; 7 | 8 | index index.php index.html index.htm index.nginx-debian.html; 9 | 10 | server_name localhost; 11 | 12 | location / { 13 | add_header 'Access-Control-Allow-Origin' '*'; 14 | add_header 'Access-Control-Allow-Methods' 'GET, POST'; 15 | add_header 'Access-Control-Allow-Headers' 'x-requested-with, Content-Type, Origin, Authorization, accept, client-security-token, token, X-Auth-Token'; 16 | try_files $uri $uri/ /index.php?$query_string; 17 | } 18 | 19 | error_log /var/log/nginx/site.error.log; 20 | error_page 404 /404.html; 21 | error_page 500 502 503 504 /50x.html; 22 | 23 | location = /50x.html { 24 | root /usr/share/nginx/html; 25 | } 26 | 27 | location ~ \.php$ { 28 | try_files $uri /index.php =404; 29 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 30 | fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; 31 | fastcgi_index index.php; 32 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 33 | include fastcgi_params; 34 | } 35 | 36 | location ~ /\.ht { 37 | deny all; 38 | } 39 | 40 | location ~ /\.git { 41 | deny all; 42 | } 43 | 44 | client_max_body_size 1024M; 45 | } 46 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.2-apache2_ubuntu16.04/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | DocumentRoot /var/www/site 4 | 5 | 6 | Options Indexes FollowSymLinks MultiViews 7 | AllowOverride All 8 | Order deny,allow 9 | Allow from all 10 | 11 | 12 | ErrorLog ${APACHE_LOG_DIR}/error.log 13 | 14 | 15 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.2-apache2_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | COPY 000-default.conf composer-install.bash /tmp/ 4 | RUN apt-get update -y && \ 5 | apt-get install -y --no-install-recommends \ 6 | # https://askubuntu.com/a/1000120 7 | software-properties-common \ 8 | wget \ 9 | curl \ 10 | git \ 11 | git-core \ 12 | bash-completion && \ 13 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 14 | LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php && \ 15 | apt-get update -y && \ 16 | apt-get install -y --no-install-recommends \ 17 | php-xdebug \ 18 | php-ast \ 19 | php-gd \ 20 | libapache2-mod-php7.2 \ 21 | apache2 \ 22 | php7.2 \ 23 | php7.2-fpm \ 24 | php7.2-mbstring \ 25 | php7.2-curl \ 26 | php7.2-tokenizer \ 27 | php7.2-dom \ 28 | php7.2-zip \ 29 | php7.2-mysql \ 30 | php7.2-imap \ 31 | php7.2-xml \ 32 | php7.2-cli \ 33 | php7.2-gd \ 34 | php7.2-intl && \ 35 | mv /tmp/000-default.conf /etc/apache2/sites-enabled/000-default.conf && \ 36 | chmod +x /tmp/composer-install.bash && \ 37 | bash /tmp/composer-install.bash && \ 38 | rm /tmp/composer-install.bash && \ 39 | a2enmod php7.2 && \ 40 | a2enconf php7.2-fpm && \ 41 | a2enmod rewrite && \ 42 | a2enmod headers && \ 43 | cp /usr/lib/php/7.2/php.ini-development /etc/php/7.2/apache2 && \ 44 | mv /etc/php/7.2/apache2/php.ini /etc/php/7.2/apache2/php.ini.bak && \ 45 | mv /etc/php/7.2/apache2/php.ini-development /etc/php/7.2/apache2/php.ini && \ 46 | sed -i "s/short_open_tag = /short_open_tag = Off/" /etc/php/7.2/apache2/php.ini && \ 47 | sed -i "s/date.timezone = ;/date.timezone = Asia\/Manila/" /etc/php/7.2/apache2/php.ini && \ 48 | sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.2/apache2/php.ini && \ 49 | echo "ServerName localhost" >> /etc/apache2/apache2.conf && \ 50 | chown -R www-data:www-data /var/www && \ 51 | find /var/www -type d -exec chmod 755 {} \; && \ 52 | find /var/www -type f -exec chmod 644 {} \; 53 | ENV APACHE_RUN_USER www-data 54 | ENV APACHE_RUN_GROUP www-data 55 | ENV APACHE_LOG_DIR /var/log/apache2 56 | ENV APACHE_LOCK_DIR /var/lock/apache2 57 | ENV APACHE_PID_FILE /var/run/apache2.pid 58 | EXPOSE 80 59 | ENTRYPOINT ["/bin/bash"] 60 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.2-apache2_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="php7.2-apache2:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/php7.2-apache2_ubuntu16.04/composer-install.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" 4 | php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" 5 | ACTUAL_SIGNATURE="$(php -r "echo hash_file('SHA384', 'composer-setup.php');")" 6 | 7 | if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] 8 | then 9 | >&2 echo 'ERROR: Invalid installer signature' 10 | rm composer-setup.php 11 | exit 1 12 | fi 13 | 14 | php composer-setup.php --install-dir=/usr/local/bin --filename=composer 15 | RESULT=$? 16 | rm composer-setup.php 17 | exit $RESULT 18 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/python3.6_ubuntu16.04/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | RUN apt-get update -y && \ 4 | apt-get install -y --no-install-recommends \ 5 | # https://askubuntu.com/a/1000120 6 | software-properties-common \ 7 | wget \ 8 | curl \ 9 | git \ 10 | git-core \ 11 | bash-completion && \ 12 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 13 | add-apt-repository ppa:jonathonf/python-3.6 && \ 14 | apt-get update -y && \ 15 | apt-get install -y python3.6 && \ 16 | update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1 && \ 17 | update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2 && \ 18 | update-alternatives --config python3 && \ 19 | # https://askubuntu.com/a/1154616 20 | cp /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-x86_64-linux-gnu.so /usr/lib/python3/dist-packages/apt_pkg.so && \ 21 | # https://askubuntu.com/a/1121758 22 | add-apt-repository ppa:pypy/ppa && \ 23 | apt-get update -y && \ 24 | apt-get install -y pypy3 && \ 25 | # https://www.rosehosting.com/blog/how-to-install-pip-on-ubuntu-16-04/ 26 | apt-get install -y python3-pip && \ 27 | pip3 install --upgrade pip && \ 28 | # https://github.com/pypa/pip/issues/5447#issuecomment-407693701 29 | # https://github.com/pypa/pip/issues/5221#issuecomment-381568428 30 | hash -r pip3 31 | EXPOSE 80 32 | ENTRYPOINT ["/bin/bash"] 33 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/python3.6_ubuntu16.04/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="python3.6:ubuntu16.04" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/shiny_rbase/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM r-base:latest 2 | LABEL maintainer="Joshua Clifford Reyes " 3 | COPY shiny-server.conf /etc/shiny-server/shiny-server.conf 4 | COPY shiny-server.sh /usr/bin/shiny-server.sh 5 | RUN apt-get update && \ 6 | apt-get install -y --no-install-recommends \ 7 | # https://askubuntu.com/a/1000120 8 | software-properties-common \ 9 | sudo \ 10 | gdebi-core \ 11 | pandoc \ 12 | pandoc-citeproc \ 13 | libcurl4-gnutls-dev \ 14 | libcairo2-dev/unstable \ 15 | libxt-dev \ 16 | libssl-dev \ 17 | wget \ 18 | curl \ 19 | git-core \ 20 | bash-completion && \ 21 | echo "source /usr/share/bash-completion/completions/git" >> ~/.bashrc && \ 22 | wget https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/VERSION -O "version.txt" && \ 23 | VERSION=$(cat version.txt) && \ 24 | wget "https://s3.amazonaws.com/rstudio-shiny-server-os-build/ubuntu-12.04/x86_64/shiny-server-$VERSION-amd64.deb" -O ss-latest.deb && \ 25 | gdebi -n ss-latest.deb && \ 26 | rm -f version.txt ss-latest.deb && \ 27 | R -e "install.packages(c('shiny', 'shinydashboard', 'ggplot2', 'dplyr'), repos='http://cran.rstudio.com/')" 28 | EXPOSE 80 29 | ENTRYPOINT ["/bin/bash"] 30 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/shiny_rbase/build.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker build --tag="shiny:rbase" . 4 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/shiny_rbase/shiny-server.conf: -------------------------------------------------------------------------------- 1 | # Define the user we should use when spawning R Shiny processes 2 | run_as shiny; 3 | 4 | # Define a top-level server which will listen on a port 5 | server { 6 | # Instruct this server to listen on port 80. The app at dokku-alt need expose PORT 80, or 500 e etc. See the docs 7 | listen 80; 8 | 9 | # Define the location available at the base URL 10 | location / { 11 | 12 | # Run this location in 'site_dir' mode, which hosts the entire directory 13 | # tree at '/srv/shiny-server' 14 | site_dir /var/www/site; 15 | 16 | # Define where we should put the log files for this location 17 | log_dir /var/log/shiny-server; 18 | 19 | # Should we list the contents of a (non-Shiny-App) directory when the user 20 | # visits the corresponding URL? 21 | directory_index on; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Docker_Images/shiny_rbase/shiny-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Make sure the directory for individual app logs exists 4 | mkdir -p /var/log/shiny-server 5 | chown shiny.shiny /var/log/shiny-server 6 | 7 | exec shiny-server >> /var/log/shiny-server.log 2>&1 8 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Dockerized_Your_Projects.md: -------------------------------------------------------------------------------- 1 | # Dockerized Your Projects 2 | 3 | ## On the Development 4 | 5 | ### Network 6 | 7 | - Create a separate docker network and give your desire IP address pool or list. 8 | 9 | - Note this process will only be executed once. 10 | 11 | ```txt 12 | Using docker network create --driver=bridge --subnet=<192.168.x.x/16> 13 | ``` 14 | 15 | ### Dockerfile 16 | 17 | - Create your Dockerfile and include all the necessary libraries or packages that will support the desire project you want to build. 18 | 19 | - You can check this example: [Docker Files](https://github.com/LordDashMe/knowledge/tree/master/DevOps/OS_Virtualization/Docker/Docker_Files) 20 | 21 | ### Images 22 | 23 | - Once you have a Dockerfile you will build it and the name and tag will based on what the docker file you created extends from and the name of primary technology used in the docker file. 24 | 25 | ```txt 26 | docker build --tag=":" 27 | ``` 28 | 29 | ### Compose 30 | 31 | - Create your Docker Compose configuration. The Docker Compose helps to easily manipulate or provide a command to the Docker Engine. 32 | 33 | ```yml 34 | version: '3.2' 35 | 36 | networks: 37 | compose-network: 38 | external: 39 | name: '' 40 | 41 | services: 42 | app: 43 | image: '' 44 | volumes: 45 | - ':' 46 | networks: 47 | compose-network: 48 | ipv4_address: '' 49 | ports: 50 | - ':' 51 | tty: true 52 | stdin_open: true 53 | restart: 'no' 54 | container_name: '' 55 | ``` 56 | 57 | - Once done you can now use the command inside the folder of each project inside the Docker Compose folder: 58 | 59 | ```txt 60 | docker-compose up -d 61 | ``` 62 | -------------------------------------------------------------------------------- /DevOps/Virtualization/Docker/Examples/LAMP_Stack.md: -------------------------------------------------------------------------------- 1 | # Linux Apache MySQL PHP Stack 2 | 3 | Example steps implementing LAMP stack using docker. 4 | 5 | - Build a Docker Image. 6 | 7 | ```text 8 | docker build --tag={php5/apache:latest} {docker-file-path} 9 | ``` 10 | 11 | - Create a Network Bridge. 12 | 13 | ```text 14 | docker network create --driver=bridge --subnet={192.168.116.0/16} {docker-bridge-local} 15 | ``` 16 | 17 | - Run a MySQL Server with Network Bridge. 18 | 19 | ```text 20 | docker run --name={mysql-server} --net={docker-bridge-local} --ip={192.168.116.2} -v {/var/lib/docker-mysql-5.6/:/var/lib/mysql} -e MYSQL_ROOT_PASSWORD={password} -d -p {3306:3306} {mysql:5.6} 21 | ``` 22 | 23 | - Run a PHPMyAdmin with Network Bridge. 24 | 25 | ```text 26 | docker run -d --name={phpmyadmin-dev} --net={docker-bridge-local} --ip={192.168.116.3} -p {8800:80} --link={mysql-server:db} {phpmyadmin/phpmyadmin:latest} 27 | 28 | docker run -d --name=phpmyadmin-dev --net=docker-bridge-local --ip=192.168.116.100 -e PMA_HOST=192.168.116.2 -e PMA_PORT=3306 -p 8800:80 phpmyadmin/phpmyadmin:latest 29 | ``` 30 | 31 | - Run a Docker Image PHP5 Apache to generate Container with Network Bridge. 32 | 33 | ```text 34 | docker run --name={docker-container-name} --net={docker-bridge-local} --ip={192.168.x.x} -it -v {/var/www/site/source/path:/var/www/site/} -p {0000:80} --link={mysql-server} {php5/apache:latest]} bash 35 | ``` 36 | 37 | ```text 38 | docker run --name={project-test-2017} --net={docker-bridge-local} --ip={192.168.116.100} -it -v {/var/www/site/drupal/test-2017/:/var/www/site/} --link={mysql-server:db} {php5/apache:latest]} bash 39 | ``` 40 | 41 | - Run Interactive Terminal in the Docker Container. 42 | 43 | ```text 44 | docker exec -it {container-id|container-name} bash 45 | ``` 46 | 47 | - Run command inside of the Docker Container. 48 | 49 | ```text 50 | docker exec service apache2 start {container-id|container-name} 51 | ``` 52 | -------------------------------------------------------------------------------- /Development_Setup/Github_SSH_Keys.md: -------------------------------------------------------------------------------- 1 | # Github SSH Keys 2 | 3 | ## Steps 4 | 5 | ### Generate SSH Keys Local 6 | 7 | - Generate ssh keys with the email 8 | 9 | ```sh 10 | ssh-keygen -t rsa -b 4096 -C "john.doe@example.com" 11 | ``` 12 | 13 | - Enter to accept the default file location. 14 | 15 | - If required to change the file name, it needs to properly setup on `~/.ssh/config` 16 | 17 | ```sh 18 | Host github.com 19 | AddKeysToAgent yes 20 | # IdentityFile ~/.ssh/ 21 | IdentityFile ~/.ssh/id_rsa 22 | ``` 23 | 24 | - (Optional) For multiple ssh key that's available for single host, you can use this format 25 | 26 | ```sh 27 | Host host1.github.com 28 | HostName github.com 29 | User git 30 | PreferredAuthentications publickey 31 | IdentityFile ~/.ssh/id_rsa 32 | IdentitiesOnly yes 33 | ``` 34 | 35 | - Enter a secure passphrase. 36 | 37 | - Enter this command to display the contents of your **public key**. 38 | 39 | ```sh 40 | cat .ssh/id_rsa.pub 41 | ``` 42 | - Copy the contents (we will need it later). 43 | 44 | ### Add SSH Keys in Github Account 45 | 46 | - Log into your GitHub account. 47 | 48 | - Go to Settings. 49 | 50 | - Find SSH and GPG keys. 51 | 52 | - New SSH key. 53 | 54 | - Provide a title in the field (i.e Local Device SSH Keys, ...). 55 | 56 | - Provide the **public key** (content of `.ssh/id_rsa.pub`) into the Key field. 57 | 58 | ### Test SSH Connection with Github 59 | 60 | - Run the following 61 | 62 | ```sh 63 | $ ssh -vT git@github.com 64 | ``` 65 | 66 | - You may see a warning like this: 67 | 68 | ```text 69 | > The authenticity of host 'github.com (IP ADDRESS)' can't be established. 70 | > ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. 71 | > Are you sure you want to continue connecting (yes/no)? 72 | ``` 73 | 74 | - Verify that the fingerprint in the message you see matches GitHub's public key fingerprint. If it does, then type `yes`: 75 | 76 | ```text 77 | > Hi USERNAME! You've successfully authenticated, but GitHub does not 78 | > provide shell access. 79 | ``` 80 | 81 | ## Reference 82 | 83 | - 84 | 85 | - 86 | -------------------------------------------------------------------------------- /Development_Setup/Install_gcloud_CLI_Ubuntu.md: -------------------------------------------------------------------------------- 1 | # Install the gcloud CLI - Ubuntu 2 | 3 | ## Commands 4 | 5 | ```sh 6 | $ sudo apt-get update 7 | 8 | $ sudo apt-get install apt-transport-https ca-certificates gnupg curl sudo 9 | 10 | $ echo "deb https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list 11 | 12 | $ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - 13 | 14 | $ sudo apt-get update && sudo apt-get install google-cloud-cli 15 | 16 | $ gcloud init 17 | ``` 18 | 19 | ## Reference 20 | 21 | - 22 | -------------------------------------------------------------------------------- /Development_Tools/Boostnote.md: -------------------------------------------------------------------------------- 1 | # Boostnote 2 | 3 | - Stable Version: https://github.com/BoostIO/boost-releases/releases/tag/v0.12.1 4 | 5 | - Keyboard Shortcuts 6 | 7 | - [Keyboard Shortcuts · BoostIO/Boostnote Wiki · GitHub](https://github.com/BoostIO/Boostnote/wiki/Keyboard-Shortcuts) 8 | -------------------------------------------------------------------------------- /Development_Tools/Chrome_Extension.md: -------------------------------------------------------------------------------- 1 | # Chrome Extension 2 | 3 | Collection of all useful Chrome Extension for Development. 4 | 5 | ## JSON Formatter 6 | 7 | - Link: [JSON Formatter - Chrome Web Store](https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en) 8 | 9 | ## Meta SEO Inspector 10 | 11 | - Link: [META SEO inspector - Chrome Web Store](https://chrome.google.com/webstore/detail/meta-seo-inspector/ibkclpciafdglkjkcibmohobjkcfkaef?hl=en) 12 | 13 | ## React Developer Tools 14 | 15 | - Link: [React Developer Tools - Chrome Web Store](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en) 16 | -------------------------------------------------------------------------------- /Development_Tools/Cmder.md: -------------------------------------------------------------------------------- 1 | # Cmder 2 | 3 | This is like a Terminal in linux and can be utilize in windows environment. cmder can be by default provided by Laragon. 4 | 5 | - How to change the command alias of the terminal: [How do you create an alias? · Issue #421 · cmderdev/cmder · GitHub](https://github.com/cmderdev/cmder/issues/421) 6 | 7 | - Find ```user-alias.cmd``` in the ```config/``` folder. 8 | 9 | - To change the default ```ll``` command and use the ```ls -al``` like in the linux: 10 | 11 | ```bash 12 | ll=ls -al --show-control-chars -F --color $* 13 | ``` 14 | 15 | - How to change the default startup of the terminal: 16 | 17 | - [windows - Start up cmder ConEmu console in a specific folder - Stack Overflow](https://stackoverflow.com/questions/31933766/start-up-cmder-conemu-console-in-a-specific-folder) 18 | 19 | - To modify the CLI style, ex. removing the lambda character and break line. Just follow the step in the reference. 20 | 21 | - [Is it possible to show the current folder in front of cursor on the current line? · Issue #338 · cmderdev/cmder · GitHub](https://github.com/cmderdev/cmder/issues/338) 22 | 23 | ```lua 24 | -- local cmder_prompt = "\x1b[1;32;40m{cwd} {git}{hg}{svn} \n\x1b[1;39;40m{lamb} \x1b[0m" 25 | local cmder_prompt = "\x1b[1;00;40m{cwd}{git}{hg}{svn}\x1b[1;39;40m{lamb}" 26 | -- local lambda = "λ" 27 | local lambda = "$ " 28 | ``` 29 | -------------------------------------------------------------------------------- /Development_Tools/FontForge.md: -------------------------------------------------------------------------------- 1 | # FontForge 2 | 3 | Tool use to create or edit fonts like woff, etc. 4 | 5 | ## Download 6 | 7 | - Ubuntu: [FontForge on GNU+Linux and other UNIXes](http://fontforge.github.io/en-US/downloads/gnulinux-dl/#ubuntu) 8 | -------------------------------------------------------------------------------- /Development_Tools/Sublime_Text.md: -------------------------------------------------------------------------------- 1 | # Sublime Text 2 | 3 | ## Custom Side Bar 4 | 5 | - To add custom size of the sidebar apply the below code in the Default Theme used. 6 | 7 | ```json 8 | { 9 | "class": "icon_folder", 10 | "layer0.texture": "Theme - Default/common/light/folder_closed.png", 11 | "layer0.opacity": 0.3, 12 | "content_margin": [8, 7] 13 | }, 14 | { 15 | "class": "icon_folder", 16 | "parents": [{"class": "tree_row", "attributes": ["expanded"]}], 17 | "layer0.texture": "Theme - Default/common/light/folder_open.png", 18 | "layer0.opacity": 0.3, 19 | "content_margin": [8, 7] 20 | }, 21 | { 22 | "class": "sidebar_label", 23 | "font.size": 12, 24 | }, 25 | 26 | ``` 27 | 28 | ## :wrench: Refresh 29 | 30 | - To enable the refresh project using a keyboard key for example using ```F5``` follow the steps below: 31 | 32 | - Preferences > Key Bindings - User 33 | 34 | - Add the code below: 35 | 36 | ```json 37 | { 38 | "keys" : ["f5"], 39 | "command" : "refresh_folder_list" 40 | } 41 | ``` 42 | 43 | --- 44 | 45 | ## Configuration for Sublime Text 3 Build 3176 46 | 47 | - Download Sublime Text 3 using below link: 48 | 49 | - General: 50 | 51 | - Linux: 52 | 53 | - Use free license for Build 3176 sgbteam: 54 | 55 | ```text 56 | ----- BEGIN LICENSE ----- 57 | sgbteam 58 | Single User License 59 | EA7E-1153259 60 | 8891CBB9 F1513E4F 1A3405C1 A865D53F 61 | 115F202E 7B91AB2D 0D2A40ED 352B269B 62 | 76E84F0B CD69BFC7 59F2DFEF E267328F 63 | 215652A3 E88F9D8F 4C38E3BA 5B2DAAE4 64 | 969624E7 DC9CD4D5 717FB40C 1B9738CF 65 | 20B3C4F1 E917B5B3 87C38D9C ACCE7DD8 66 | 5F7EF854 86B9743C FADC04AA FB0DA5C0 67 | F913BE58 42FEA319 F954EFDD AE881E0B 68 | ------ END LICENSE ------ 69 | ``` 70 | 71 | ## Configuration for Sublime Text 3 Build 3143 72 | 73 | - Download Sublime Text 3 using below link: 74 | 75 | - General: 76 | 77 | - Linux: 78 | 79 | - Use free license for Build 3143 by TwitterInc: 80 | 81 | ```text 82 | —– BEGIN LICENSE —– 83 | TwitterInc 84 | 200 User License 85 | EA7E-890007 86 | 1D77F72E 390CDD93 4DCBA022 FAF60790 87 | 61AA12C0 A37081C5 D0316412 4584D136 88 | 94D7F7D4 95BC8C1C 527DA828 560BB037 89 | D1EDDD8C AE7B379F 50C9D69D B35179EF 90 | 2FE898C4 8E4277A8 555CE714 E1FB0E43 91 | D5D52613 C3D12E98 BC49967F 7652EED2 92 | 9D2D2E61 67610860 6D338B72 5CF95C69 93 | E36B85CC 84991F19 7575D828 470A92AB 94 | —— END LICENSE —— 95 | ``` 96 | 97 | ## :bulb: PHP Stack 98 | 99 | - Download the following packages: 100 | 101 | - phpfmt 102 | 103 | - SublimeLinter 104 | 105 | - SublimeLinter-php 106 | 107 | - PHPCompanion 108 | 109 | - GitGutter 110 | 111 | - A File Icon 112 | 113 | - Markdown Preview 114 | 115 | - Configuration: 116 | 117 | - Set the User Settings of ```phpfmt``` - The default properties for PSR-2 Coding Style. 118 | 119 | ```json 120 | { 121 | "autocomplete": false, 122 | "autoimport": false, 123 | "excludes": 124 | [ 125 | "OnlyOrderUseClauses", 126 | "OrderAndRemoveUseClauses", 127 | "OrderMethod" 128 | ], 129 | "format_on_save": false, 130 | "indent_with_space": 4, 131 | "passes": 132 | [ 133 | "GeneratePHPDoc", 134 | "StripNewlineWithinClassBody", 135 | "AutoSemicolon", 136 | "SortUseNameSpace" 137 | ], 138 | "psr1": false, 139 | "psr1_naming": false, 140 | "psr2": true, 141 | "readini": false, 142 | "version": 1 143 | } 144 | ``` 145 | 146 | - Ctrl + Shift + P 147 | 148 | - To show the package installer for Sublime Text. 149 | 150 | - Also show the Packages that currently installed to the Sublime Instance. 151 | 152 | - Usage: 153 | 154 | - Use ```F11``` to format the current PHP file using ```phpfmt``` configuration. 155 | -------------------------------------------------------------------------------- /Development_Tools/Visual_Studio_Code.md: -------------------------------------------------------------------------------- 1 | # VSCode Setup 2 | 3 | ## Extensions 4 | 5 | ### Main 6 | 7 | - VSCode Great Icons 8 | 9 | - GitLens 10 | 11 | - Docker 12 | 13 | - Prettier - Code formatter 14 | 15 | ### Optional 16 | 17 | - Edit csv 18 | 19 | - Markdown All in One 20 | 21 | ## Configuration 22 | 23 | - To add ruler in the editor view. 24 | 25 | ```text 26 | "editor.rulers": [ 27 | 100 28 | ], 29 | ``` 30 | 31 | - To auto add new line in every save files. 32 | 33 | - [Visual Studio Code — Insert New Line at the End of Files - Stack Overflow](https://stackoverflow.com/questions/44704968/visual-studio-code-insert-new-line-at-the-end-of-files) 34 | 35 | - Add this to the File > Preferences > Settings 36 | 37 | ```text 38 | "files.insertFinalNewline": true, 39 | ``` 40 | 41 | - To adjust the editor font size instead of adjusting the editor zoom level. 42 | 43 | ```text 44 | "editor.mouseWheelZoom": true, 45 | "editor.fontSize": 12, 46 | "editor.tabSize": 2 47 | ``` 48 | 49 | - To adjust terminal font size. 50 | 51 | ```text 52 | "terminal.integrated.fontSize": 12, 53 | ``` 54 | 55 | ### How to open User or Workspace settings json file 56 | 57 | You can open the settings.json file with the Preferences: Open Settings (JSON) command in the Command Palette (Ctrl+Shift+P) or for Mac (Command+Shift+P). 58 | 59 | ## Default Settings.json 60 | 61 | ```json 62 | { 63 | "security.workspace.trust.untrustedFiles": "open", 64 | "workbench.colorTheme": "Monokai", 65 | "workbench.iconTheme": "vscode-great-icons", 66 | "editor.codeActionsOnSave": {}, 67 | "editor.rulers": [100], 68 | "files.insertFinalNewline": true, 69 | "editor.mouseWheelZoom": true, 70 | "editor.fontSize": 12, 71 | "terminal.integrated.fontSize": 12, 72 | "editor.tabSize": 2, 73 | "diffEditor.ignoreTrimWhitespace": false, 74 | "typescript.updateImportsOnFileMove.enabled": "never", 75 | "editor.formatOnSave": true, 76 | "files.associations": { 77 | ".prettierrc": "json" 78 | }, 79 | "[typescriptreact]": { 80 | "editor.defaultFormatter": "esbenp.prettier-vscode" 81 | }, 82 | "[typescript]": { 83 | "editor.defaultFormatter": "esbenp.prettier-vscode" 84 | }, 85 | "[javascript]": { 86 | "editor.defaultFormatter": "esbenp.prettier-vscode" 87 | }, 88 | "[json]": { 89 | "editor.defaultFormatter": "vscode.json-language-features" 90 | }, 91 | "[jsonc]": { 92 | "editor.defaultFormatter": "esbenp.prettier-vscode" 93 | }, 94 | "[markdown]": { 95 | "editor.defaultFormatter": "esbenp.prettier-vscode" 96 | } 97 | } 98 | ``` 99 | 100 | ## Useful Shortcut Keys 101 | 102 | - Command Palette: `Shift + Cmd + P` 103 | 104 | - Show settings: `Cmd + ,` 105 | 106 | - Show files: `Cmd + P` 107 | 108 | - Exit project view: `Cmd + K + F` 109 | -------------------------------------------------------------------------------- /Development_Tools/Zsh.md: -------------------------------------------------------------------------------- 1 | # Zsh 2 | 3 | ## Packages 4 | 5 | - [Oh My Zsh](https://ohmyz.sh/#install) 6 | 7 | - Follow the manual font installation: 8 | 9 | - [powerlevel10k](https://github.com/romkatv/powerlevel10k) 10 | 11 | - Oh My Zsh installer: 12 | 13 | - [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) 14 | 15 | - Oh My Zsh installer: 16 | 17 | - [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) 18 | 19 | - Oh My Zsh installer: 20 | 21 | ## Reference 22 | 23 | - 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2019 - 2020 Joshua Clifford Reyes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Knowledge 2 | 3 | Everything that you need. :bulb: :books: :telescope: 4 | 5 | ## Explore The Content 6 | 7 | - [Curiosity](Curiosity/) 8 | 9 | - [Development_Tools](Development_Tools/) 10 | 11 | - [Development_Setup](Development_Setup/) 12 | 13 | - [DevOps](DevOps/) 14 | 15 | - [Virtualization](DevOps/Virtualization/) 16 | 17 | - [Docker](DevOps/Virtualization/Docker/) 18 | 19 | - [Docker_Images](DevOps/Virtualization/Docker/Docker_Images/) 20 | 21 | - [Examples](DevOps/Virtualization/Docker/Examples/) 22 | 23 | - [Server](DevOps/Server/) 24 | 25 | - [Linux](DevOps/Server/Linux/) 26 | 27 | - [Database](Database/) 28 | 29 | - [Web_Development](Web_Development/) 30 | 31 | - [Front_End](Web_Development/Front_End/) 32 | 33 | - [CSS](Web_Development/Front_End/CSS/) 34 | 35 | - [JavaScript](Web_Development/Front_End/JavaScript/) 36 | 37 | ## License 38 | 39 | This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). 40 | -------------------------------------------------------------------------------- /Web_Development/Front_End/CSS/CSS_Reference_Browser_Support.md: -------------------------------------------------------------------------------- 1 | # CSS Referece Browser Support 2 | 3 | ## FLEX 4 | 5 | ```css 6 | display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */ 7 | display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */ 8 | display: -ms-flexbox; /* TWEENER - IE 10 */ 9 | display: -webkit-flex; /* NEW - Chrome */ 10 | display: flex; /* NEW, Spec - Opera 12.1, Firefox 20+ */ 11 | ``` 12 | 13 | ## FLEX-GROW 14 | 15 | ```css 16 | -webkit-flex-grow: 1; 17 | -moz-flex-grow: 1; 18 | -ms-flex-grow: 1; 19 | flex-grow: 1; 20 | ``` 21 | 22 | ## FLEX-WRAP 23 | 24 | ```css 25 | -webkit-flex-wrap: wrap; 26 | -moz-flex-wrap: wrap; 27 | -ms-flex-wrap: wrap; 28 | flex-wrap: wrap; 29 | ``` 30 | 31 | ## FLEX-DIRECTION 32 | 33 | ```css 34 | -webkit-flex-direction: column; 35 | -moz-flex-direction: column; 36 | -ms-flex-direction: column; 37 | flex-direction: column; 38 | ``` 39 | 40 | ## FLEX-FLOW 41 | 42 | ```css 43 | -webkit-flex-flow: column; 44 | -moz-flex-flow: column; 45 | -ms-flex-flow: column; 46 | flex-flow: column; 47 | ``` 48 | 49 | ## JUSTIFY CONTENT 50 | 51 | ```css 52 | -webkit-justify-content: center; 53 | -moz-justify-content: center; 54 | -ms-justify-content: center; 55 | justify-content: center; 56 | ``` 57 | 58 | ## ORDER 59 | 60 | ```css 61 | -webkit-order: 1; 62 | -moz-order: 1; 63 | -ms-order: 1; 64 | order: 1; 65 | ``` 66 | 67 | ## TRANSFORM 68 | 69 | ```css 70 | -webkit-transform: translate3d(0, -2.5rem, 0); 71 | -moz-transform: translate3d(0, -2.5rem, 0); 72 | -ms-transform: translate3d(0, -2.5rem, 0); 73 | transform: translate3d(0, -2.5rem, 0); 74 | ``` 75 | 76 | ## GRADIENT IN CSS 77 | 78 | ```css 79 | /* IE10 Consumer Preview */ 80 | background-image: -ms-linear-gradient(left, #162D67 0%, #00A3EF 100%); 81 | /* Mozilla Firefox */ 82 | background-image: -moz-linear-gradient(left, #162D67 0%, #00A3EF 100%); 83 | /* Opera */ 84 | background-image: -o-linear-gradient(left, #162D67 0%, #00A3EF 100%); 85 | /* Webkit (Safari/Chrome 10) */ 86 | background-image: -webkit-gradient(linear, left, left, color-stop(0, #162D67), color-stop(1, #00A3EF)); 87 | /* Webkit (Chrome 11+) */ 88 | background-image: -webkit-linear-gradient(left, #162D67 0%, #00A3EF 100%); 89 | /* W3C Markup, IE10 Release Preview */ 90 | background-image: linear-gradient(to left, #162D67 0%, #00A3EF 100%); 91 | ``` 92 | -------------------------------------------------------------------------------- /Web_Development/Front_End/JavaScript/Debounce.md: -------------------------------------------------------------------------------- 1 | # Debounce 2 | 3 | ```js 4 | /** 5 | * The code snippet for Debounce Strategy. 6 | * 7 | * @param {Function} callback The callback function that will be debouce. 8 | * @param {Number} waitingTime The (N) milliseconds that the callback function 9 | * will be call after no call action made. 10 | * 11 | * @return {Function} 12 | */ 13 | function debounce(callback, waitingTime = 0) { 14 | 15 | if (typeof callback !== 'function') { 16 | throw Error('The first argument is not a type function.'); 17 | } 18 | 19 | if (typeof waitingTime !== 'number') { 20 | throw Error('The second argument is not a type number'); 21 | } 22 | 23 | var timeout = null; 24 | 25 | return function() { 26 | 27 | var context = this; 28 | var args = arguments; 29 | 30 | clearTimeout(timeout); 31 | 32 | timeout = setTimeout(function() { 33 | timeout = null; 34 | callback.apply(context, args); 35 | }, waitingTime); 36 | }; 37 | }; 38 | ``` 39 | --------------------------------------------------------------------------------