Category Archives: 伺服器 網站服務

[Docker] time sync with host

Source: stackoverflow: How to make sure docker’s time syncs with that of the host?

Posted in Docker | Comments Off on [Docker] time sync with host

[Apache] wordpress permalink 404 issue

edit site conf (vim /etc/apache2/sites-available/pr.site.org.conf)

enable apache2 rewrite module

restart apache2 service

  Ref. [1] Victor Hung’s Diary: 「教學」解決 WordPress 固定網址設定 404 錯誤 [2] DigitalOcean: WordPress permalinks tried everything  

Posted in Apache, Ubuntu, WordPress | Leave a comment

[Docker] The crontab is not work in docker

Source: docker容器内cron不执行 vim /etc/pam.d/crond # The PAM configuration file for the cron daemon # # No PAM authentication called, auth modules not needed account required pam_access.so account sufficient pam_access.so account include password-auth session required pam_loginuid.so session sufficient pam_loginuid.so session include … Continue reading

Posted in Docker, Linux | Leave a comment

[Git] edit commit message after push

Source: stackopenflow: Changing git commit message after push (given that no one pulled from remote) git comment –amend git push –force

Posted in Git | Leave a comment

[Git] find the file’s latest edited time

Source: stackoverflow: Find when a file was deleted in Git $ git log -1 — o-core/o-service/src/main/java/path/file.java commit 0d5ab0e5d9df7d7b5906ff8db169f43b760daea0 Author: cowman cowman@mitake.com.tw Date: Mon Dec 18 17:58:26 2017 +0800

Posted in Git | Leave a comment

[Shelll Script] check tomcat status

!/bin/bash tomcat7=$(ps -ef | grep tomcat | wc -l) echo ${#tomcat7} if [ ${#tomcat7} -gt 0 ]; then printf “tomcat is running\n” else printf “tomcat is not running\n” fi

Posted in Linux, Shell Script, Tomcat | Leave a comment

[Git] remove local git tags that are not in remote

git fetch –prune origin “+refs/tags/:refs/tags/” source: stockoverflow: Remove local tags that are no longer on the remote repository

Posted in Git | Leave a comment

Add git branch name to bash prompt

edit ~/.bash_profile

Posted in CentOS, Git, Linux, Mac, Ubuntu | Leave a comment

[Git] List of changed files with another branch

git diff –name-only branchname

Posted in Git | Leave a comment

[Apache] Redirect 80 to 8080

enable proxy_module, proxy_http_module, rewrite_module set < Directory path > in apache config RewriteEngine on AllowOverride All edit .htaccess in your folder < IfModule mod_rewrite.c > RewriteEngine On RewriteBase / RewriteRule ^(.+)$ http://localhost:8080/jwebadm/$1 [P,L] < /IfModule > restart apache

Posted in Apache | Leave a comment