鍍金池/ 問答/ Linux問答
莓森 回答

幫你把sh下下來了,你存下來試試看,我就估計(jì)你git clone的時(shí)候也會(huì)卡住。哈哈,到時(shí)候再找我吧。

main() {
  # Use colors, but only if connected to a terminal, and that terminal
  # supports them.
  if which tput >/dev/null 2>&1; then
      ncolors=$(tput colors)
  fi
  if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
    RED="$(tput setaf 1)"
    GREEN="$(tput setaf 2)"
    YELLOW="$(tput setaf 3)"
    BLUE="$(tput setaf 4)"
    BOLD="$(tput bold)"
    NORMAL="$(tput sgr0)"
  else
    RED=""
    GREEN=""
    YELLOW=""
    BLUE=""
    BOLD=""
    NORMAL=""
  fi

  # Only enable exit-on-error after the non-critical colorization stuff,
  # which may fail on systems lacking tput or terminfo
  set -e

  CHECK_ZSH_INSTALLED=$(grep /zsh$ /etc/shells | wc -l)
  if [ ! $CHECK_ZSH_INSTALLED -ge 1 ]; then
    printf "${YELLOW}Zsh is not installed!${NORMAL} Please install zsh first!\n"
    exit
  fi
  unset CHECK_ZSH_INSTALLED

  if [ ! -n "$ZSH" ]; then
    ZSH=~/.oh-my-zsh
  fi

  if [ -d "$ZSH" ]; then
    printf "${YELLOW}You already have Oh My Zsh installed.${NORMAL}\n"
    printf "You'll need to remove $ZSH if you want to re-install.\n"
    exit
  fi

  # Prevent the cloned repository from having insecure permissions. Failing to do
  # so causes compinit() calls to fail with "command not found: compdef" errors
  # for users with insecure umasks (e.g., "002", allowing group writability). Note
  # that this will be ignored under Cygwin by default, as Windows ACLs take
  # precedence over umasks except for filesystems mounted with option "noacl".
  umask g-w,o-w

  printf "${BLUE}Cloning Oh My Zsh...${NORMAL}\n"
  hash git >/dev/null 2>&1 || {
    echo "Error: git is not installed"
    exit 1
  }
  # The Windows (MSYS) Git is not compatible with normal use on cygwin
  if [ "$OSTYPE" = cygwin ]; then
    if git --version | grep msysgit > /dev/null; then
      echo "Error: Windows/MSYS Git is not supported on Cygwin"
      echo "Error: Make sure the Cygwin git package is installed and is first on the path"
      exit 1
    fi
  fi
  env git clone --depth=1 https://github.com/robbyrussell/oh-my-zsh.git $ZSH || {
    printf "Error: git clone of oh-my-zsh repo failed\n"
    exit 1
  }


  printf "${BLUE}Looking for an existing zsh config...${NORMAL}\n"
  if [ -f ~/.zshrc ] || [ -h ~/.zshrc ]; then
    printf "${YELLOW}Found ~/.zshrc.${NORMAL} ${GREEN}Backing up to ~/.zshrc.pre-oh-my-zsh${NORMAL}\n";
    mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh;
  fi

  printf "${BLUE}Using the Oh My Zsh template file and adding it to ~/.zshrc${NORMAL}\n"
  cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
  sed "/^export ZSH=/ c\\
  export ZSH=$ZSH
  " ~/.zshrc > ~/.zshrc-omztemp
  mv -f ~/.zshrc-omztemp ~/.zshrc

  # If this user's login shell is not already "zsh", attempt to switch.
  TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
  if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then
    # If this platform provides a "chsh" command (not Cygwin), do it, man!
    if hash chsh >/dev/null 2>&1; then
      printf "${BLUE}Time to change your default shell to zsh!${NORMAL}\n"
      chsh -s $(grep /zsh$ /etc/shells | tail -1)
    # Else, suggest the user do so manually.
    else
      printf "I can't change your shell automatically because this system does not have chsh.\n"
      printf "${BLUE}Please manually change your default shell to zsh!${NORMAL}\n"
    fi
  fi

  printf "${GREEN}"
  echo '         __                                     __   '
  echo '  ____  / /_     ____ ___  __  __   ____  _____/ /_  '
  echo ' / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \ '
  echo '/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / / '
  echo '\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/  '
  echo '                        /____/                       ....is now installed!'
  echo ''
  echo ''
  echo 'Please look over the ~/.zshrc file to select plugins, themes, and options.'
  echo ''
  echo 'p.s. Follow us at https://twitter.com/ohmyzsh.'
  echo ''
  echo 'p.p.s. Get stickers and t-shirts at https://shop.planetargon.com.'
  echo ''
  printf "${NORMAL}"
  env zsh
}

main
爆扎 回答

三元運(yùn)算嵌套一下就可以了啊,干嘛要computed
{{(item.state==0?'辦理中':(item.state==1?:'已結(jié)辦':'已中止'))}}

茍活 回答

你是說那個(gè)logo沒有生效嗎

不歸路 回答

ftp得寫上用戶名密碼吧,比如你用戶名是test,密碼是6666667,那么應(yīng)該是:

<img src="ftp://test:6666667@127.0.0.1/image/a3e5d211-42d4-466a-940d-040e496f9faf.jpg" class="img-thumbnail">

另外不建議用匿名,那個(gè)拼寫起來比具名的還長……

祈歡 回答

“一般不要定義為Static變量”,這是為了防止不安全的SimpleDateFormat實(shí)例被意外泄漏導(dǎo)致線程安全性問題。但是泄漏實(shí)例或者共享實(shí)例的方式有很多,不管是否使用static修飾,只要可變實(shí)例被多線程共享即不安全。不要定義為static變量只是一種良好的規(guī)范,但并不能阻止實(shí)例被多線程共享。

鐧簞噯 回答

路徑不一樣,一個(gè)是類路徑 。在項(xiàng)目路徑 下創(chuàng)建lib文件夾
通常是在這里加載的。

使用try_files $uri $uri/ /;

    location / {
        proxy_pass http://localhost:6666;
        proxy_set_header  Host $host:$server_port;
        proxy_set_header  X-Real-IP  $remote_addr;
        client_max_body_size  10m;
        try_files $uri $uri/ /;
    }
好難瘦 回答

可以去看看Nginx的匹配優(yōu)先級:Nginx Location匹配規(guī)則

舊酒館 回答
  1. 確定是不是綁到 0.0.0.0

  2. 防火墻是否允許流量通過

墨沫 回答

Compare & Set,或是 Compare & Swap,一個(gè)意思。

孤慣 回答

如果是云服務(wù)器,問問客服有快照么。如果是本地機(jī),估計(jì)平時(shí)也不會(huì)弄快照,重裝系統(tǒng)吧

不討囍 回答
// index.js
console.log(process.argv);

package.json

"build": "node index.js"
npm run build -- --name hello

打印的結(jié)果是

[ '/usr/local/bin/node',
  '/Users/ltaoo/Documents/nodejs/args/index.js',
  '--name',
  'hello' ]

參考

幼梔 回答

可以看看 github page官方文檔,挺詳細(xì)的

大致意思就是你 添加一條CNAME記錄,到你的 domain

# 栗子:
blog.flxxyz.com  3592    IN      CNAME   flxxyz.github.io.

希望能幫到你(?????????)?

執(zhí)念 回答

結(jié)案了,原因是因?yàn)槲以诒镜豴roxy配置用的是api/xxxx,導(dǎo)致我認(rèn)為后臺(tái)代碼沒有一點(diǎn)問題,結(jié)果這里是apis

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  132.232.22.140:8000;
        root         /usr/share/nginx/html;
#       root          /home/myftp/dist

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location ^~ /api/ {
            proxy_pass http://127.0.0.1:8889;
        }
        location /{
                proxy_pass   http://127.0.0.1:8000;
        }
        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

前端8000端口,后臺(tái)8889端口,跨域成功

忠妾 回答

把curl寫在單獨(dú)的一個(gè)php里,做代理。前端每次包好數(shù)據(jù)、用ajax去發(fā)請求給這個(gè)php,在php里拿到數(shù)據(jù),重新打包發(fā)給真正的地址,返回的內(nèi)容再reture給前端頁面就可以了。這樣前端不會(huì)有跨域問題(因?yàn)檎嬲恼埱笫呛蠖税l(fā)的),另外還可以隱藏實(shí)際的接口地址(比如如果是部署在阿里云平臺(tái)的話,接口域名就可以用云平臺(tái)的內(nèi)網(wǎng)地址代替)。

伐木累 回答

圖片描述

我的是這樣 通過mysql命令行或者管理工具可以連接,但是通過啟動(dòng)java項(xiàng)目就連接報(bào)錯(cuò)(如圖) 額,什么 鬼呢?
圖片描述

尤禮 回答

這個(gè)不是github的問題,而是git的問題。git在commit信息中會(huì)顯示提交人和郵箱地址,github這個(gè)界面只不過以圖形化展示了git commit的內(nèi)容。

你可能會(huì)想到這個(gè)可以被偽造,所以git還有簽名的功能,確認(rèn)提交人有效,只不過實(shí)際使用的人卻不多。https://git-scm.com/book/id/v...

維她命 回答

你的用戶是什么權(quán)限?需要授予你的用戶有root的權(quán)限才行

毀了心 回答

如果你問的是環(huán)境變量的話,建議各個(gè)系統(tǒng)各自增加環(huán)境變量,名稱一致,比如ENV=test等.js的編譯本身是可以帶環(huán)境參數(shù)的,比如

project_path=$(cd `dirname $0`; pwd)

export NODE_ENV=$ENV

./node_modules/.bin/webpack --config webpack.dll.config -p
./node_modules/.bin/webpack --config webpack.config -p

這里可以將環(huán)境變量直接導(dǎo)出到j(luò)s編譯環(huán)境。
然后就可以在程序愉快的進(jìn)行判斷了


module.exports = {
    API_URL:process.env.NODE_ENV == "production" ? "http://XXXX/api/":"http://AAAA/api/",
    IMAGE_URL:process.env.NODE_ENV == "production" ?  "http://XXXXX": "http://AAAA"
}