2021年4月26日 星期一

Docker centos7 to run systemd

 1. 

# docker run -d -name centos7 --privileged=true centos:7 /usr/sbin/init

進入容器:

# docker exec -it centos7 /bin/bash



再說到systemd,這個套件已經成為主流Linux發行版(比如CentOS7、Ubuntu14+)默認的服務管理,取代了傳統的SystemV風格服務管理。systemd維護系統服務程序,它需要特權去會訪問Linux內核。而容器並不是一個完整的作業系統,只有一個文件系統,而且默認啟動只是普通用戶這樣的權限訪問Linux內核,也就是沒有特權,所以自然就用不了!

原文網址:https://kknews.cc/code/ybkvyyg.html



ref: https://kknews.cc/zh-tw/code/ybkvyyg.html

https://plutoacharon.github.io/2020/02/23/Docker%E5%AE%B9%E5%99%A8%E5%87%BA%E7%8E%B0%E4%BD%BF%E7%94%A8systemctl%E9%97%AE%E9%A2%98%EF%BC%9AFailed-to-get-D-Bus-connection-Operation-not-permitted/

2021年4月19日 星期一

SRS content

 

https://longrm.com/2019/10/29/2019-10-29-srs_ffmpeg_transcode_as_needed/


https://hackmd.io/@Eotones/stream/%2F%40Eotones%2FHk42GMAJV



https://straas.io/blog/archives/2726/


https://blog.csdn.net/vn9PLgZvnPs1522s82g/article/details/78780562


https://github.com/ossrs/srs

2021年3月11日 星期四

Linux inotify

 https://www.centos.bz/2018/01/centos-6-9%E4%B8%8Ainotify-tools-%E5%AE%89%E8%A3%85%E5%8F%8A%E4%BD%BF%E7%94%A8%E6%96%B9%E6%B3%95/


https://centos.pkgs.org/7/epel-x86_64/inotify-tools-3.14-9.el7.x86_64.rpm.html


https://blog.arkey.fr/2019/09/13/watchservice-and-bind-mount/


https://www.linuxjournal.com/content/linux-filesystem-events-inotify


https://github.com/gmethvin/directory-watcher

2021年3月3日 星期三

git merge and branch

 https://ithelp.ithome.com.tw/articles/10211792


https://gitbook.tw/chapters/branch/fix-conflict.html



# git  tracking and branch

https://matthung0807.blogspot.com/2019/09/git-head-detached-at-remote-branch.html


# config

git config --global credential.helper cache


# ref

https://git-scm.com/book/zh-tw/v2/%E4%BD%BF%E7%94%A8-Git-%E5%88%86%E6%94%AF-%E9%81%A0%E7%AB%AF%E5%88%86%E6%94%AF


https://matthung0807.blogspot.com/2019/09/git-head-detached-at-remote-branch.html

2021年2月25日 星期四

java watcher folder

 

A good guide:

https://www.baeldung.com/java-nio2-watchservice

https://www.codota.com/code/java/methods/java.nio.file.WatchKey/pollEvents



Generic

http://puremonkey2010.blogspot.com/2010/12/gossip-in-java-generics.html

https://www.journaldev.com/1663/java-generics-example-method-class-interface


2020年12月23日 星期三

dotnet core redirect

 1. Good

ref: https://www.dotnettricks.com/learn/mvc/return-view-vs-return-redirecttoaction-vs-return-redirect-vs-return-redirecttoroute

ASP.NET MVC - View() vs RedirectToAction() vs Redirect() Methods



The Redirect() Method

This method is used to redirect to specified URL instead of rendering HTML. In this case, the browser receives the redirect notification and make a new request for the specified URL. This also acts like Response.Redirect() in Asp.Net WebForm. In this case, you have to specify the full URL to redirect.


Moreover, Redirect also cause the browser to receive a 302 redirect within your application, but you have to construct the URLs yourself.


public ActionResult Index()

{

 return View();

}


[HttpPost]

public ActionResult Index(string Name)

{

 ViewBag.Message = "Hi, Dot Net Tricks";

 //Like Response.Redirect() in Asp.Net WebForm

 return Redirect("Home/MyIndex");

}


public ActionResult MyIndex()

{

 ViewBag.Msg = ViewBag.Message; // Assigned value : Null

 return View("MyIndex");

############################################################################

############################################################################

2. How to redirect a request in ASP.NET Core MVC


Redirect("/Author/Index");
RedirectPermanent("/Author/Index");
RedirectPermanentPreserveMethod("/Author/Index");
RedirectPreserveMethod("/Author/Index");

2020年12月1日 星期二

iptables

 http://163.20.160.24/~pc/modules/tadnews/index.php?nsn=58


https://stevenitlife.blogspot.com/2020/01/k8s-cluster.html


https://mileslin.github.io/2019/05/%E7%9E%AD%E8%A7%A3-Docker-%E7%9A%84%E9%A0%90%E8%A8%AD%E7%B6%B2%E8%B7%AF%E8%A8%AD%E7%BD%AE/


http://linux.vbird.org/linux_server/0250simple_firewall.php


https://blog.jangmt.com/2015/09/centos7-firewalld-iptables.html


https://www.itread01.com/content/1541339230.html


https://blog.gtwang.org/linux/centos-7-firewalld-command-setup-tutorial/


https://www.hwchiu.com/iptables-1.html


https://www.digitalocean.com/community/tutorials/how-to-list-and-delete-iptables-firewall-rules