Top

Tags: Linux InstallGuide Django Web-frontend Python Storage Docker HPC k8s Bootstrap

Docker Tutorials

Aug 25, 2020 | 874 views

#Docker

Basic Tutorials:

  1. Docker Build: A Beginner’s Guide to Building Docker Images
  2. Docker Curriculum
  3. Awesome Docker

Docker Volume: 

  1. Understanding Docker Volumes with an example 
  2. Docker Tutorial Series : Part 7 : Data Volumes [recommended]

General and comprehensive  Tutorial:

  1. Docker Tutorial Series (Recommended,  there are a lot of content)
  2. Container Tutorials (Looks like a really good resources)

Configure docker image autorestart:


# In order to enable a restart policy, you need to use the --restart argument when executing docker run
docker run -dit --restart unless-stopped httpd

# Or configure a running container
# unless-stopped: The container would always be restarted unless it was manually stopped
docker update --restart unless-stopped container_id


Content from Docker Tutorial Series : 

    Part 1 — Installation

    Part 2 — Basic Commands

    Part 3 — More on Images and Containers

    Part 4 — Docker Hub

    Part 5 — Building your own Docker Images

    Part 6 — Docker Private Registry

    Part 7 — Data Volumes

    Part 8 — Linking Containers

    Part 9 — Writing a Dockerfile

    Part 10 — Docker Swarm Tutorial

    Part 11 — Docker Swarm on Google Compute Engine

    Part 12 — Getting Started with Kubernetes using Minikube

    Part 13 — Docker Management Commands

    Appendix

    Docker : Learning Resources

    Docker Use Cases

    Learning Docker ? Move To The Cloud !


      Comments: 0

      An Introduction to Firewalld

      Aug 25, 2020 | 695 views

      #Linux

      Refer to An Introduction to Firewalld

      Add a Port for TCP or UDP

      You do have to specify TCP or UDP and to open a port for both. You will need to add rules for each protocol.

      firewall-cmd --permanent --add-port=443/tcp

      Saving Firewall Rules

      After you have completed all the additions and subtraction of rules, you need to reload the firewall rules to make them active. To do this, you again use the firewall-cmd tool but using the option –reload.

      firewall-cmd --reload


      Config to accept all traffic between the nodes:
      
      [root@mgt ~]$ firewall-cmd --permanent --direct --add-rule ipv4 filter INPUT 0 -s  192.168.x.xxx -j ACCEPT
      success
      [root@mgt ~]$ firewall-cmd --reload
      success
      

      Refer to add rule to firewalld in Centos7 to allow all traffic from a server 


      Comments: 0

      Syntax highlight in html pre code block

      Aug 12, 2020 | 850 views

      #Web-frontend


      Check here: highlight.js

      and Stackoverflow

      Comments: 0

      Learning Web Development

      Aug 12, 2020 | 766 views

      #Web-frontend



      Refer to 

      Comments: 0

      Django: Highlight Search Results

      Aug 10, 2020 | 1273 views

      #Python #Django


      Solution refer to below links


      Python re.sub() case insensitive replace coding example: 

      
      In [54]: re.sub('(%s)'%re.escape('hE'), r'<abc>\g<1></abc>', 'hello', flags=re.IGNORECASE)
      Out[54]: '<abc>he</abc>llo'
      In [56]: re.sub('(%s)'%re.escape('hE.'), r'<abc>\g<1></abc>', 'he.llo', flags=re.IGNORECASE)
      Out[56]: '<abc>he.</abc>llo'

      Or another version (Here we exclude URL replacement from HTML text): 

          pattern = re.compile('(^%s|[\s]%s|%s[\s])' % tuple([re.escape(word),]*3), re.IGNORECASE)
      highlighted = pattern.sub(r'<span class="highlight">\g<1></span>', highlighted)

      Regex resource refer to:

      Comments: 0

      About This Blog Application

      Aug 10, 2020 | 633 views

      This blog application mainly shares knowledge of  Linux administration and management. You are welcome to leave a comment for query.


      Here is my major git commit log:

      commit 57e4f7988a7f2789986833b31c09f155b6230570
      Author: hide
      Date:   Fri Aug 7 11:04:10 2020 +0000
      
          updated sitemap
      
      commit 80f6db8b105f079aa262bd8aee848a6e47fbb1b3
      Author: hide
      Date:   Wed Aug 5 14:58:12 2020 +0000
      
          1. implemented safe delete action for Post by updating Post model, so it
          could be recovered from database if needed;
          2. fixed tags issue on post_list, only show post's relative tags
      
      commit e1cd24bbdea24e4b820fcce7b2e797d255852835
      Author: hide
      Date:   Wed Aug 5 12:38:12 2020 +0000
      
          - fixed URL issue for post_detail, now support utf-8 URI
          - added a confirm-delete modal for Remove button
          - fixed delaying update on ListView by switching back to view.post_list
          - updated a few field in models.py as not required
      
      commit a57b30e9968c57111768aefd1c25f265dc3dbe40
      Author: hide
      Date:   Mon Aug 3 17:03:42 2020 +0000
      
          implemented readable url
      
      commit a9f5b3030e4b9e9c2cf0b772b9fb1b5ba6663975
      Author: hide
      Date:   Mon Aug 3 11:34:17 2020 +0000
      
          implemented Pagination and sitemap
      
      commit 51b6eca341e41e93b099cb3963702a798d3cc765
      Author: hide
      Date:   Fri Jul 31 13:43:27 2020 +0000
      
          1. implemented views tracking for url
      commit 785f4f6445d7a620650e5b4aebdb6eb09c27adfa
      Author: hide
      Date:   Thu Jul 30 19:50:25 2020 +0000
      
          added a 'Top' button; and updated navbar appearance
      
      commit abac5c57c27f075b44e8b3c44e3d7623d6067e40
      Author: hide
      Date:   Wed Jul 29 13:12:22 2020 +0000
      
          updated font for h1,h2,h3,h4 and navbar
      
      commit 0159a610e62d6eadd92408d878f3761136072af4
      Author: hide
      Date:   Wed Jul 29 11:47:00 2020 +0000
      
          1. updated tagged() in blog/views.py and post_list.html
          2. implemented autohide navbar when scroll down
      
      commit 6b59e58e09569eb6d1d8092a449568458f0ceacf
      Author: hide
      Date:   Tue Jul 28 12:43:26 2020 +0000
      
          updated templates
      
      commit 4953f170201af35b2e3cd570a81799c63e33506b
      Author: hide
      Date:   Mon Jul 27 16:15:03 2020 +0000
      
          1. optimize some templates into post_preview.html;
          2. added blog/static/taggit/
      
      commit a5805fde9107cf7260d9efac7153f11a28931095
      Author: hide
      Date:   Mon Jul 27 12:23:40 2020 +0000
      
          implemented Tags function
      
      

      Comments: 0

      Elliott Wave Theory is an Over-fitting Model which is Useless and Unprofitable

      Aug 07, 2020 | 810 views

      #TA-model

      This post reminded me that why Elliott Wave so-called theory is nonsense, because it is an over-fitting model that has little predictive value for the future.

       

      "What is overfitting in trading? Overfitting in trading is the process of designing a trading system that adapts so closely to historical data that it becomes ineffective in the future."

      Refer to What is Overfitting in Trading?

      Comments: 0

      Nested list comprehension syntax in Python

      Aug 05, 2020 | 790 views

      #Python


      Refer to 


      Example: 

      >>> non_flat = [ [1,2,3], [4,5,6], [7,8] ]
      >>> [y for x in non_flat for y in x]
      [1, 2, 3, 4, 5, 6, 7, 8]
      

      Comments: 0

      Bootstrap 4: Delete confirmation modal for list of items

      Aug 05, 2020 | 828 views

      #Django #Bootstrap

      Refer to 

      Comments: 0

      The right way to create database for Django - collation error

      Aug 04, 2020 | 1094 views

      #Python #Django

      The right way to create a database

      Refer to 

      When creating a new database, remember to create with the right collate settings:

      CREATE DATABASE foo CHARACTER SET utf8 COLLATE utf8_general_ci;


      Change MySQL default character set to UTF-8 in my.cnf? 

      Error Number: 1267

      Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='


      Solutions refer to :

      config on /etc/my.cnf

      [mysqld]
      collation-server = utf8_unicode_ci
      init-connect='SET NAMES utf8'
      character-set-server = utf8



      Comments: 0