Category Archives: 伺服器 網站服務

[Docker] time sync with host

docker run -v /etc/localtime:/etc/localtime:ro -i -t mattdm/fedora /bin/bash 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) <VirtualHost pr.site.org:80> ServerName pr.site.org ServerAdmin webmaster@localhost DocumentRoot /var/www/pr.site.org # !– add this section <Directory /var/www/pr.site.org> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> # !– ErrorLog ${APACHE_LOG_DIR}/pr_error.log CustomLog ${APACHE_LOG_DIR}/pr_access.log combined </VirtualHost> … Continue reading

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 remove file.java</code>

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 if [ -f $(xcode-select -p)/usr/share/git-core/git-completion.bash ]; then . $(xcode-select -p)/usr/share/git-core/git-completion.bash . $(xcode-select -p)/usr/share/git-core/git-prompt.sh fi #enables color in the terminal bash shell export CLICOLOR=1 #sets up the color scheme for list export LSCOLORS=ExFxCxDxBxegedabagacad #sets up the prompt color (currently … Continue reading

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