プログラミング備忘録

初級プログラマ。python、DL勉強中

pyplotメモ

import pandas  as pd

import matplotlib
import matplotlib.pyplot as plt

### pyplot setting 
plt.style.use('ggplot')
font = {'family' : 'meiryo'}
matplotlib.rc('font', **font)

plt.rcParams["figure.figsize"] = [10,10]

### pyplot initialize
#fig = plt.figure()

row1=list(range(0,5))
row2=list(range(5,10))
row3=list(range(10,15))


df=pd.DataFrame([row1,row2,row3],columns=["kokugo","sansu","rika","shakai","eigo"],index=["111","222","333"])
print(df)




### 列抽出
print("###列抽出")
print(df["sansu"])
print(df[["sansu","shakai"]])


### 行抽出
print("###行抽出")
print(df[1:3])
print(df[(df["sansu"]==1)])


### 行列 
print("###sell抽出")
print(df.at["222","sansu"])
print(df.iat[1,1])




df.plot.bar(alpha=0.6)
plt.title("bargraph")
plt.savefig("./res/bar.png")


df.plot.bar(alpha=0.6,stacked=True)
plt.title("stackgraph")
plt.savefig("./res/stack.png")


df.plot(alpha=0.6)
plt.title("plot")
plt.savefig("./res/plot.png")


df.plot(alpha=0.6,kind="hist")
plt.title("histgram")
plt.savefig("./res/histgram.png")


df.plot(alpha=0.6,kind="area")
plt.title("area")
plt.savefig("./res/area.png")


df.plot(x="kokugo",y="sansu",alpha=0.6,kind="scatter")
plt.title("scatter")
plt.savefig("./res/scatter.png")


df.hist()
plt.title("allhist")
plt.savefig("./res/allhist.png")

参考

鍵の種類のまとめ

種別

KEY

CSR

  • Certificate Signing Request
  • 公開鍵
  • KEYより作成

CRT

  • Certificate
  • 公開鍵に証明書を付加したもの
  • CSRより作成
  • 三者期間より発行

nginx設定

  • sites-available/default
server {
    # SSL configuration
    #
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;

    server_name www.example.jp;
    #ssl  on;
    ssl_certificate /wks/authkey/combined.crt ;
    ssl_password_file /wks/authkey/ssl.key/pass.txt;
    ssl_certificate_key /wks/authkey/ssl.key/server.key;
    ssl_session_timeout 2m;
    #ssl_protocols TLSv1;

    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }
}

  • conf.d/default.conf
server{
    listen 50000 ;
    listen [::]:50000 ;

    root /wks/html;

    # Add index.php to the list if you are using PHP
    #index index.html index.htm index.nginx-debian.html;

    server_name _;

    #server_name www.example.jp;
    ssl  on;
    ssl_certificate /wks/authkey/combined.crt ;
    ssl_password_file /wks/authkey/ssl.key/pass.txt;
    ssl_certificate_key /wks/authkey/ssl.key/server.key;
    ssl_session_timeout 2m;


    server_name _;

    location / {
        # First attempt to serve request as file, then
        # as directory, then fall back to displaying a 404.
        try_files $uri $uri/ =404;
    }

}

rescueモードでの起動

ubuntuとwindows10のデュアルブートマシンを開発に使用しているが windowsupdateの関係でubuntuが起動しなくなり、どえらい目にあったのでメモ。

基本は以下に従った

grub rescueと表示されるdual bootパソコンを復旧させる方法 - ShinobiMind

grub/i386-pc/normal.modがどこにあるかを探し、 prefix,rootに指定しnormalを実行する

普段ブートしているハードを選び、再インストール WM×LI: grub rescue が表示されても慌てずに.