升級esxi至6.7U1

在維護模式下,以ssh進入主機後.
使用下列指令,進行升級.

esxcli software profile update --depot=/vmfs/volumes/[datastore]/update-from-esxi6.7-6.7_update01.zip -p ESXi-6.7.0-20181002001-standard

之後重開機既可.

發表於 os | 已標籤

使用helm部署nfs-client

之前都用yaml部署nfs-client.
但缺點是每次kubernets跟nfs-client版本更換之後,
就可能會發生部署有問題,像是權限…等

剛剛在kubernetes 1.12上面用之前1.10所用的nfs-client之yaml檔案.
結果又出問題了.
後來發現helm有提供nfs-client部署方式.
二話不說,立刻改用helm部署.
語法如下:

helm install stable/nfs-client-provisioner \
  --name nfs-client \
  --set nfs.server=xxx.xxx.xxx.xxx \
  --set nfs.path=/path \
  --set storageClass.name=managed-nfs-storage

使用Javascript產生細胞廣播告警聲響

NCC規範

使用Javascript Code:

<script>
  function play(music,time){
    //參考http://www.csie.ntnu.edu.tw/~u91029/Audio.html
    var sampleRate   = 10000;
    var sampleNumber = music[0].length*10000*time;
    var ctx    = new AudioContext();
    var buffer = ctx.createBuffer(2, sampleNumber, sampleRate);


    //製作聲音資料
    var data0   = buffer.getChannelData(0); //第1聲道
    var data1   = buffer.getChannelData(1); //第2聲道
    for (var i = 0; i < sampleNumber; ++i){
      var index=Math.floor(i/(sampleRate*time));
      data0[i] = Math.sin((Math.PI * 2) * i * music[0][index] / sampleRate);
      data1[i] = Math.sin((Math.PI * 2) * i * music[1][index] / sampleRate);
    }

    // 製作節點、串連節點、播放聲音
    var node    = ctx.createBufferSource();
    node.buffer = buffer;
    node.connect(ctx.destination);
    node.start(0);
  }

  var __=0;
  var S960=960;
  var S853=853;
  var music=[[ 
    S960,S960,S960,S960,  //2秒
    __,                   //停頓0.5sec
    S960,S960,            //1秒
    __,                   //停頓0.5秒
    S960,S960,            //1秒
    __,                   //停頓0.5秒
    S960,S960,S960,S960,  //2秒
    __,                   //停頓0.5sec
    S960,S960,            //1秒
    __,                   //停頓0.5秒
    S960,S960             //1秒
  ],[                     
    S853,S853,S853,S853,  
    __,                   
    S853,S853,            
    __,                   
    S853,S853,            
    __,                   
    S853,S853,S853,S853,  
    __,                   
    S853,S853,            
    __,                   
    S853,S853             
  ]]; 
  play(music,0.5);/**/
</script>

Latent Semantic Analysis (LSA) 測試

參考下列幾個網址寫出來的code (for Matlab)
http://lsa.colorado.edu/papers/dp1.LSAintro.pdf
https://blog.csdn.net/pipisorry/article/details/42560331
https://read01.com/zh-tw/0zeKRM.html#.W7C8PhMzbKZ

C=[ [ 0,0,1,1,0,0,0,0,0 ];
    [ 0,0,0,0,0,1,0,0,1 ];
    [ 0,1,0,0,0,0,0,1,0 ];
    [ 0,0,0,0,0,0,1,0,1 ];
    [ 1,0,0,0,0,1,0,0,0 ];
    [ 1,1,1,1,1,1,1,1,1 ];
    [ 1,0,1,0,0,0,0,0,0 ];
    [ 0,0,0,0,0,0,1,0,1 ];
    [ 0,0,0,0,0,2,0,0,1 ];
    [ 1,0,1,0,0,0,0,1,0 ];
    [ 0,0,0,1,1,0,0,0,0 ]; ];

[w,s,p]=svd(C);

plot(-p(:,2),-p(:,3),'.')
hold on
plot(-w(:,2),-w(:,3),'.')


Label_1={'book';'dads';'dummies';'estate';'guide';'investing';'market';'real';'rich';'stock';'value'};
text(-w(:,2),-w(:,3),Label_1,'Color','red','FontSize',14);

Label_2={'T1';'T2';'T3';'T4';'T5';'T6';'T7';'T8';'T9';};
text(-p(:,2),-p(:,3),Label_2,'Color','blue','FontSize',14);
hold off

結果呈現如下:

raspberry pi 關閉7寸觸控螢幕的方法

關閉:

sudo sh -c 'echo 1 > /sys/class/backlight/rpi_backlight/bl_power'

開啟:

sudo sh -c 'echo 0 > /sys/class/backlight/rpi_backlight/bl_power'

切換:

if [ "$(cat /sys/class/backlight/rpi_backlight/bl_power)" -eq "0" ]; then \
  sudo sh -c "echo 1 > /sys/class/backlight/rpi_backlight/bl_power"; \
else \
  sudo sh -c "echo 0 > /sys/class/backlight/rpi_backlight/bl_power"; fi