2016-10-24

Software List (Enhanced Version) Create DB View


/******************************************************************************/

USE [Info]
GO

/****** Object:  View [dbo].[ASMA]    Script Date: 10/24/2016 10:29:40 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[ASMA]'))
DROP VIEW [dbo].[ASMA]
GO

/****** Object:  View [dbo].[ASMA]    Script Date: 10/24/2016 10:29:40 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

Software List (Enhanced Version) Create DB Table

USE [Info]
GO

/****** Object:  Table [dbo].[ARPTable]    Script Date: 10/24/2016 10:28:29 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ARPTable]') AND type in (N'U'))
DROP TABLE [dbo].[ARPTable]
GO

/****** Object:  Table [dbo].[ARPTable]    Script Date: 10/24/2016 10:28:29 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ARPTable](
[Serial] [int] IDENTITY(1,1) NOT NULL,
[DateTime] [datetime] NOT NULL,
[HostName] [nvarchar](max) NOT NULL,
[IPAddress] [nvarchar](15) NOT NULL,
[MACAddress] [nvarchar](17) NOT NULL,
[Checked] [int] NOT NULL CONSTRAINT [DF_ARPTable_Checked]  DEFAULT ((0)),
 CONSTRAINT [PK_ARPTable] PRIMARY KEY CLUSTERED
(
[Serial] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO

Software List (Enhanced Version) Load into DB

'On Error Resume Next

SourcePath = "D:\Info\Data"

GapString = "=====Gap====="
InfoString = "=====Info====="

DebugMode = 0

SQLServer="127.0.0.1"
SQLUser="Info"
SQLPassword="password"
SQLDB="Info"
SQLConnectionTimeout = 600

DonnotKeepOSLastBootUpTime = 1

Software List (Enhanced Version)


' ----- 參數設定開始 -----

ADDomain = "Contoso"
TargetFilePath = "\\FileServer\Info$\Data\*.dbd"
GapString = "=====Gap====="
InfoString = "=====Info====="

' 除厝模式: (派送用戶端執行應設為 0)
' 0: 不顯示訊息
' 1: 顯示錯誤訊息
DebugMode = 0

' 資料取得方式 (此參數會在 DB Record 中註記):
' 1: Local - Client Push 檔案給 Server 讀取
' 2: Remote - Server 主動連線取得資料產生檔案
InfoDataType = 1

' 如果資料取得方式是 2: Server 主動連線取得資料產生檔案
' 此處給予客戶端有可能使用的管理員帳號密碼
AuthUserNameString = ""
AuthPasswordString = ""

' ----- 參數設定結束 -----

2016-10-20

ubuntu 安裝並啟動 RDP Service / SSH Service 的方法

To make Remote Desktop Connection from Windows to ubuntu
--------------------------------------------------------------------------------------------------------------
http://www.tweaking4all.com/software/linux-software/use-xrdp-remote-access-ubuntu-14-04/
sudo apt-get update
sudo apt-get install xrdp
sudo apt-get install xfce4
-----------------------------------------------------
# Option Install XFCE4 terminal (way better than xterm)
sudo apt-get install xfce4-terminal
# Option Install icon sets
sudo apt-get install gnome-icon-theme-full tango-icon-theme
-----------------------------------------------------
echo xfce4-session >~/.xsession
sudo nano /etc/xrdp/startwm.sh
-----------------------------------------------------
#!/bin/sh

if [ -r /etc/default/locale ]; then
  . /etc/default/locale
  export LANG LANGUAGE
fi

startxfce4
-----------------------------------------------------
sudo service xrdp restart
--------------------------------------------------------------------------------------------------------------

安裝 SSH Service

apt-get install ssh
apt-get install openssh-server

設定檔路徑
vim /etc/ssh/sshd_config

可改比如:

Port 22
PasswordAuthentication yes
PermitRootLogin yes -> 開放 root 登入 (一般不會開)

重啟服務
/etc/init.d/ssh restart