https://www.gravatar.com/avatar/ecd1e184bdf4016f24c818bde9e65b3d?s=240&d=mp
记录点滴、留住时光

彩色的梦想

彩色的梦想

多多 多妈


我有一个梦想,

书法家的梦想。

汉字在我的笔尖,

快乐地跳舞,

我喜欢。


我有一个梦想,

围棋大师的梦想。

黑白分明,

落子无悔,

我喜欢。


我有一个梦想,

魔方高手的梦想,

ubuntu18.04报错libssl.so.1.0.0未找到

ubuntu18.04报错libssl.so.1.0.0未找到

  • 报错信息
1
error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
  • 解决办法

    先卸载,再安装,如下

1
2
sudo apt-get remove libssl1.0.0
sudo apt-get install libssl1.0.0:amd64  

Lua简单命令行框架

源码test_nmod.lua

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local module = {}

function module.main()
    print("module.main called")
end

function module.noparam()
    print("module.noparam called")
end

function module.oneparam(a)
    print("module.oneparams called " .. a)
end

function module.multiparams(a, b)
    print("module.multiparams called " .. a .." " ..b)
end



if pcall(getfenv, 4) then

else
    if #arg == 0 then
        print(module.main())
    elseif #arg == 1 then
        print(module[arg[1]]())
    else
        print(module[arg[1]](unpack(arg, 2)))
    end
end

return module

测试程序test_nmod.lua

1
2
local nmod = require("test.nmod")
nmod.oneparam("hello")

调用执行结果

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
root@OLYM-SW:/usr/lib/lua/test# lua test_nmod.lua 
module.oneparams called hello

root@OLYM-SW:/usr/lib/lua/test# lua nmod.lua 
module.main called

root@OLYM-SW:/usr/lib/lua/test# lua nmod.lua noparam
module.noparam called

root@OLYM-SW:/usr/lib/lua/test# lua nmod.lua oneparam a
module.oneparams called a

root@OLYM-SW:/usr/lib/lua/test# lua nmod.lua multiparams 1 2
module.multiparams called 1 2