CentOS Install .NET Core

.NET Tutorial – Hello World in 10 minutes

https://www.microsoft.com/net/learn/get-started-with-dotnet-tutorial

Add the dotnet product feed

Before installing .NET, you’ll need to register the Microsoft key, register the product repository, and install required dependencies. This only needs to be done once per machine.

Open a command prompt and run the following commands:

sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm

Install .NET Core SDK on Linux CentOS / Oracle

https://www.microsoft.com/net/download/linux-package-manager/centos/sdk-current

sudo yum update
sudo yum install dotnet-sdk-2.1

Install .NET Core Runtime on Linux CentOS / Oracle

https://www.microsoft.com/net/download/linux-package-manager/centos/runtime-current

sudo yum update
sudo yum install aspnetcore-runtime-2.1

Linux下查询端口占用的进程pid

 

今天在CentOS下安装学习Jexus, 装好启动失败.  发现80端口占用了,才想起已经安装了amh.

于是按照windows下”netstat -a”, 查看网络端口连接.  但是显示的列表十分长, 不好查找…

加参数 , 发现几个容易查看的参数命令.
1. 不过滤显示

netstat -lnp

2.过滤. 最方便的,只显示80

netstat -lnp | grep "80"

3.使用 lsof 查询. 没有的话先安装

#yum install lsof #[安装lsof]
lsof -i:80

知道占用端口的进程后修改,可以终止进程:kill pid. 或者修改启动端口.

 

 

CentOS 桌面 + VNC 安装脚本

CentOS下的一段脚本.  直接一起安装桌面,XWindows,VNC远程控制,和支持中文.

#!/bin/bash

yum -y groupinstall "Desktop" #[安装桌面 ]
yum -y groupinstall "X Window System" #[安装XWindows]
yum -y groupinstall "Chinese Support" #[增加中文支持]

#echo 'LANG="zh_CN.UTF-8"' >> /etc/sysconfig/i18n #[设置中文]

startx #[启动XWindows]

#echo 'id:5:initdefault' >> /etc/inittab #[开机自动运行]

yum -y install tigervnc tigervnc-server #[安装VNC远程控制]

echo 'VNCSERVERS="1:root"' >> /etc/sysconfig/vncservers #[设置服务权限]
echo 'VNCSERVERARGS[1]="-geometry 1024x768"' >> /etc/sysconfig/vncservers #[设置服务参数]

vncpasswd #[这一步将会提示你设置VNC的密码]

#service vncserver restart #[重启]
service vncserver start #[启动]
#chkconfig vncserver on #[开机启动]

 

#后的注释项, 可以自己参考是否使用.  比如是否开机自动启动VNC.

 

在 Linux、 FreeBSD、 OpenBSD 中显示所有安装的软件或包

问: 我使用的 CentOS,如何在 Linux 中显示所有已安装的软件包?
答: 您需要使用 rpm 命令来在 Linux 中显示所有已安装的软件包

Red Hat/Fedora Core/CentOS Linux

Type the following command to get list of all installed software
# rpm -qa | less

Debian Linux

Type the following command to get list of all installed software:
# dpkg --get-selections

Ubuntu Linux

Type the following command to get list of all installed software:
# sudo dpkg --get-selections

FreeBSD

Type the following command to get list of all installed software:
# pkg_info | less
# pkg_info apache

Use pkg_version command to summarizes the versions of all installed packages:
# pkg_version | less
# pkg_version | grep 'lsof'

OpenBSD

OpenBSD also use pkg_info command to display list of all installed packages or software:
# pkg_info | less
# pkg_info apache

http://www.cyberciti.biz/faq/show-display-get-installed-packages-software-list-linux-freebsd-openbsd/