posts - 15, comments - 0, trackbacks - 0, articles - 5
  12bet12bet怎么样 :: 主页 :: 新漫笔 :: 联络 :: 聚合  :: 办理

2018年10月21日

     摘要: 下载 pure-ftpd-1.0.47.tar.gz,解压后目录结构如下:目录,每个目录中均包括一个Makefile.am gui   m4   Man   Pam   Puredb...  阅览全文

posted @ 2018-10-21 19:37 eamon| 修正 保藏

2018年3月11日

一、体系装置

现在centos官方只要32位的版别,64位还没有推出,下载地址:

http://mirror.centos.org/altarch/7/isos/armhfp/

 

最新版别为CentOS Linux release 7.4.1708 (Core)。挑选Pi3的版别,压缩包格局为XZ,下载后运用7-Zip解压。解压后为一个3GB 的img格局的映像文件,运用USB Image Tool软件,将文件写入TF卡中,至少为4GB。

翻开软件后点击Restore,挑选映像文件。

用tf卡发动机器,默许的root暗码为centos。

二、体系装备

履行#/usr/bin/rootfs-expand,运用体系能够运用整个卡的空间。

封闭防火墙和selinux:

#systemctl disable firewalld

#vi /etc/selinux/config

SELINUX=disabled

修正主机名:

#vi /etc/hostname

 

创立缺失文件,使network服务正常发动:

#touch /etc/sysconfig/network

装备网卡地址,有线和无线网卡:

#cat ifcfg-eth0

TYPE=Ethernet

PROXY_METHOD=none

BROWSER_ONLY=no

DEFROUTE=yes

IPV4_FAILURE_FATAL=no

NAME=eth0

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=static

IPADDR=192.168.4.2

GATEWAY=192.168.4.1

NETMASK=255.255.255.0

 

#vi ifcfg-wlan0

DEVICE=wlan0

NAME=wlan0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=no

BOOTPROTO=static

IPADDR=192.168.5.1

NETMASK=255.255.255.0

 

装备DNS服务器地址:

[root@rpi3 etc]# cat  resolv.conf

# Generated by NetworkManager

nameserver 192.168.4.1

 

设置区域和时区,时刻同步:

[root@rpi3 etc]#localectl set-locale LANG=zh_CN.UTF-8

[root@rpi3 etc]#ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

 

systemctl disable NetworkManager

systemctl disable kdump   当时内核不支撑

#yum update

#reboot

三、装备网络打印机

装置cups软件,同享打印机:

#yum install cups

发现https无法拜访,则需求装置openssl。

#yum install openssl

 

修正装备文件:

vi /etc/cups/cupsd.conf

#Listen localhost:631

Port 631

 

在/,/admin和/admin/conf下增加:

Allow From 192.168.4.0/24

Allow all

 

用阅览器翻开进行装备:https://192.168.4.2:631/admin

选中同享打印机和Internet打印。

 


输入root用户名和暗码,

持续,

持续,因为只是经过网络进行打印,Make挑选Raw,客户端需求自行装置打印机的驱动程序。

点击“Add Printer”,下一页会供给默许选项,这个不需设置:

打印机装备文件,存放在/etc/cups/printers.conf 中,可备份。

 

能够在Windows客户端运用

http://192.168.4.2:631/printers/EPSON_L310_Series

增加网络打印机。

四、装备随身WIFI:

#yum install hostapd-2.5-5.fc25.armv7hl.rpm

#yum install dnsmasq

 

然后在/etc/dnsmasq.conf末参加(自己修正IP和网段,这个文件是已存在的,很具体的装备文件,可是一切行都参加了#号注释掉)

interface=wlan0

dhcp-range=192.168.5.50,192.168.5.150,12h

 

修正hostapd装备:

#cd /etc/hostapd

#mv hostapd.conf hostapd.conf.bak

#cp /usr/share/doc/hostapd/hostapd.conf ./

 

#vi hostapd.conf

 

driver=nl80211

ssid=rpi3-ap

channel=11

auth_algs=1

wpa=2

wpa_passphrase=wifi_mimaXXXX

wpa_key_mgmt=WPA-PSK

rsn_pairwise=CCMP

 

 

敞开IP包转发:

#cat /proc/sys/net/ipv4/ip_forward

#echo "net.ipv4.ip_forward = 1" >>/usr/lib/sysctl.d/50-default.conf

# sysctl -p            ###如不收效重启一下OS

 

敞开内核防火墙转发:

yum install iptables-services

systemctl enable iptables

 

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT

iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

 

iptables-save > /etc/sysconfig/iptables

 

systemctl start iptables

iptables --list

 

 

 

敞开服务:

systemctl enable hostapd

systemctl enable dnsmasq

reboot

五、装备ftp,samba

#yum install samba

 

vi /etc/security/limits.conf

增加行:  *   -   nofile 16384

 

cd /etc/samba

cp -a smb.conf smb.conf.bak

cat smb.conf.example | grep -v '^#' | grep -v '^$' > smb.conf

 

vi smb.conf

printcap name = /etc/printcap

虚拟用户装备:

 

在大局下写入username map = /etc/samba/usermap这条参数

echo 'root = administrator  admin' >> usermap

 

[share]

        comment = Share Directories

        path = /mnt/share

        public = no

        writable = yes

        valid users = root

 

# smbpasswd -a root  设置暗码即可从windows拜访同享。

 

 

装备vs-ftp

yum install vsftpd

 

创立虚拟用户:

[root@rpi3 vsftpd]# cat v_ftpuser.txt

ftpuser

123456

#db_load -T -t hash -f /etc/vsftpd/v_ftpuser.txt v_ftpuser.db

chmod 700 v_ftpuser.db

 

装备PAM认证文件,/etc/pam.d/vsftpd行首参加如下两行(注释其他行)

auth      required        pam_userdb.so  db=/etc/vsftpd/v_ftpuser

account  required        pam_userdb.so  db=/etc/vsftpd/v_ftpuser

 

创立虚拟用户的权限和根目录:

#mkdir v_user_conf

#cd v_user_conf

[root@rpi3 v_user_conf]# cat ftpuser

local_root=/mnt/share

write_enable=YES

anon_world_readable_only=YES

anon_upload_enable=YES

anon_mkdir_write_enable=YES

anon_other_write_enable=YES

 

修正vsftp装备文件:

[root@rpi3 vsftpd]# cat vsftpd.conf | grep -v '#'

anonymous_enable=NO

local_enable=YES

write_enable=YES

local_umask=022

dirmessage_enable=YES

xferlog_enable=YES

connect_from_port_20=YES

xferlog_std_format=YES

ftpd_banner=Welcome to blah FTP service.

chroot_local_user=YES

allow_writeable_chroot=YES

 

listen=YES

listen_ipv6=NO

 

pam_service_name=vsftpd

userlist_enable=NO

userlist_file=/etc/vsftpd/user_list

tcp_wrappers=YES

guest_enable=YES

guest_username=root

user_config_dir=/etc/vsftpd/v_user_conf

virtual_use_local_privs=YES

 

pasv_enable=YES

pasv_min_port=60000

pasv_max_port=60100

其他文件:

[root@rpi3 vsftpd]# cat ftpusers

# Users that are not allowed to login via ftp

#root

bin

daemon

adm

lp

sync

shutdown

halt

mail

news

uucp

operator

games

nobody

 

[root@rpi3 vsftpd]# cat user_list

# vsftpd userlist

# If userlist_deny=NO, only allow users in this file

# If userlist_deny=YES (default), never allow users in this file, and

# do not even prompt for a password.

# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers

# for users that are denied.

root

#bin

#daemon

#adm

#lp

#sync

#shutdown

#halt

#mail

#news

#uucp

#operator

#games

#nobody

六、装备Nginx和PHP

装置nginx:

#yum install nginx-1.10.1-1.fc25.armv7hl.rpm nginx-filesystem-1.10.1-1.fc25.noarch.rpm nginx-mimetypes-2.1.47-1.fc25.noarch.rpm

#systemctl enable nginx

#systemctl start nginx

 

#cd /etc/nginx

#cp -a nginx.conf nginx.conf.bak

#vi nginx.conf

location ~ \.php$ {

        root           /usr/share/nginx/html;

        fastcgi_pass   127.0.0.1:9000;

        fastcgi_index  index.php;

        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

        include        fastcgi_params;

    }

装置PHP插件:

yum install php-fpm php php-mbstring

systemctl start php-fpm

systemctl enable php-fpm

装置MYSQL插件:

运用MySQL Native Driver,代替 MySQL (Original) — Original MySQL API

yum  remove php-mysql

yum   install  php-mysqlnd

 

默许的WEB网站目录:

/usr/share/nginx/html

 

php-fpm 默许选用tcp的协议,关于负载较小的网站,也能够选用unix socket方法,需求修正/etc/php-fpm.d/www.conf,

将listen = 127.0.0.1:9000改为

listen = /var/run/php-fpm.sock

一起,nginx.conf也要讲将

fastcgi_pass   127.0.0.1:9000;  改为:

fastcgi_pass unix:/var/run/php-fpm.sock;

七、装备MariaDB数据库

#yum install mariadb mariadb-server

#systemctl enable mariadb

#systemctl start mariadb

MariaDB的相关简略装备

#mysql_secure_installation

首先是设置暗码,会提示先输入暗码

Enter current password for root (enter for none):<–初度运转直接回车

设置暗码

Set root password? [Y/n] <– 是否设置root用户暗码,输入y并回车或直接回车
New password: <– 设置root用户的暗码
Re-enter new password: <– 再输入一次你设置的暗码

其他装备回车即可。

#mysql -u root -p 测验。

 

直接创立用户并授权的指令

mysql>grant all privileges on *.* to username@localhost indentified by 'password';

 

颁发外网登陆权限 

mysql>grant all privileges on *.* to username@'%' identified by 'password';

 

颁发权限而且能够授权

mysql>grant all privileges on *.* to username@'hostname' identified by 'password' with grant option;

 

create user 'test'@'%' identified by '123456';

 

mysql -u root -p 登陆root帐号:

create user dbuser@localhost identified by 'db123';

create user dbuser@%  identified by 'db123';

 

grant all privileges on *.* to dbuser@'%' identified by 'db123';

grant all privileges on *.* to dbuser@localhost identified by 'db123';

show grants for 'dbuser'@'%';

create database mydb;

create table person(id int not null,    name varchar(30),    constraint pk__person primary key(id));

insert into person values(2,'coco');

 

测验PHP拜访数据库:

运用mysqli有面向进程和面向对象两种方法。

[root@rpi3 test]# cat mysqli.php

<?php

$db_host = 'localhost';

$db_name = 'mydb';

$db_user = 'dbuser';

$db_pwd = 'db123';

 

//use object style

$mysqli = new mysqli($db_host, $db_user, $db_pwd, $db_name);

if ($mysqli->connect_errno) {

    echo "Sorry, this website is experiencing problems.";

    echo "Error: Failed to make a MySQL connection, here is why: \n";

    echo "Errno: " . $mysqli->connect_errno . "\n";

    echo "Error: " . $mysqli->connect_error . "\n";   

    exit;

}

$mysqli->set_charset("utf8");

//或许 $mysqli->query("set names 'utf8'")

// Perform an SQL query

$sql = "SELECT *  FROM person";

if (!$result = $mysqli->query($sql)) {

    echo "Sorry, the website is experiencing problems.";   

    echo "Query: " . $sql . "\n";

    echo "Errno: " . $mysqli->errno . "\n";

    echo "Error: " . $mysqli->error . "\n";

    exit;

}

if ($result->num_rows === 0) {

    echo "We could not find a result ";

}

$actor = $result->fetch_assoc();

echo "Sometimes I see " . $actor['id'] . " " . $actor['name'] . " .";

// Now, let's fetch five random actors and output their names to a list.

$sql = "SELECT id, name FROM person ORDER BY rand() LIMIT 5";

if (!$result = $mysqli->query($sql)) {

    echo "Sorry, the website is experiencing problems.";

    exit;

}

 

// Print our 5 random actors in a list, and link to each actor

echo "<ul>\n";

while ($actor = $result->fetch_assoc()) {

    echo "<li><a href='" . $_SERVER['SCRIPT_FILENAME'] . "?aid=" . $actor['id'] . "'>\n";

    echo $actor['name'] ;

    echo "</a></li>\n";

}

echo "</ul>\n";

// The script will automatically free the result and close the MySQL

// connection when it exits, but let's just do it anyways

$result->free();

$mysqli->close();

 

//The old style:

$mysqli = mysqli_connect($db_host, $db_user, $db_pwd, $db_name);

if(!$mysqli ){

    echo mysqli_connect_error();

    exit;

}

echo "Connect Database Success! \n";

mysqli_close($mysqli);

?>

参阅:

https://segmentfault.com/a/1190000003841357

 

 

端口触发,即外网计算机WAN1想拜访内网某台机器LAN1的各种服务(端口规模),需求内网LAN1服务器先拜访外网WAN1机器的触发端口供给的服务。之后,外网的WAN1就能够拜访内网LAN1上的服务了。

posted @ www.188bet.com eamon 阅览(1624) | 谈论 (0)修正 保藏

2018年3月3日

     摘要: Redhat Linux 6.4下Oracle 10g装置装备手册   1、装置预备 1.1        RedHat Linux Server 6.4装置DVD (32位), 装置时挑选“桌面”。 1.2      &nbs...  阅览全文

posted @ 2018-03-03 05:59 eamon 阅览(164) | 谈论 (0)修正 保藏

1.yum install gcc gcc-12bet gdb cmake <br/>
2.下载QT.
http://download.qt.io/official_releases/qt/5.10/5.10.1/ 挑选: qt-opensource-linux-x64-5.10.1.run
或许用镜像下载:
https://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/5.10/5.10.1/qt-opensource-linux-x64-5.10.1.run chmod u+x qt-opensource-linux-x64-5.10.1.run

3.双击qt-opensource-linux-x64-5.10.1.run开端装置。

posted @ 2018-03-03 05:56 eamon 阅览(268) | 谈论 (0)修正 保藏

2018年3月1日

1. 最小号装置centos 7.2
2. 装置X window体系
yum groupinstall "X Window System"
yum groupinfo "X Window System"
组:X 窗口体系
组编号:x11
描绘:X 窗口体系支撑。
必要的软件包:
+glx-utils
+initial-setup-gui
+mesa-dri-drivers
+plymouth-system-theme
+spice-vdagent
+xorg-x11-drivers
+xorg-x11-server-Xorg
+xorg-x11-utils
+xorg-x11-xauth
+xorg-x11-xinit
+xvattr
可选的软件包:
tigervnc-server
xorg-x11-drv-keyboard
xorg-x11-drv-libinput
xorg-x11-drv-mouse
xorg-x11-drv-openchrome

or 
yum install glx-utils    initial-setup-gui    mesa-dri-drivers    plymouth-system-theme     spice-vdagent   xorg-x11-drivers   xorg-x11-server-Xorg   xorg-x11-utils   xorg-x11-xauth   xorg-x11-xinit   xvattr
3. yum install gnome-classic-session
4. systemctl get-default
systemctl set-default graphical.target
5. reboot
6.装置中文字体 yum install wqy* 7.常用软件 yum install firefox gnome-terminal 参阅:
https://www.centos.org/forums/viewtopic.php?f=47&t=47088
http://mirrors.zju.edu.cn/centos/7/isos/x86_64/


fedora 28 


dnf.conf:
keepcache=true
fastestmirror=true
/dev/yum.repo.d/dvd/repo:
[dvd]
name=dvd
baseurl=file:///mnt/dvd
enable=1
gpgcheck=0
------------------------------------------
yum install langpacks-en langpacks-zh_CN
yum install gnome-shell  mesa-dri-drivers  xorg-x11-drivers gdm gedit nautilus firefox gcc gcc-12bet gnome-terminal
yum install gnu-free-*
yum install adobe-source-han-*cn-fonts adobe-source-han-*tw-fonts
yum install google-noto-sans-sc-fonts  google-noto-serif-sc-fonts google-noto-sans-cjk-sc-fonts google-noto-serif-cjk-sc-fonts google-noto-sans-mono-cjk-sc-fonts
yum install  gnome-system-monitor 
dnf install automake autoconf codeblocks 
dnf install make gdb ibus-pinyin
systemctl enable gdm
systemctl set-default graphical.target
localectl status
locale
localectl list-locales 
localectl set-locale LANG=zh_CN.UTF-8

posted @ 2018-03-01 22:29 eamon 阅览(199) | 谈论 (0)修正 保藏

2011年8月20日

void CTestBrowseDlg::OnBrowse() 
{
    CString str;
    BROWSEINFO bi;
    char name[MAX_PATH];
    ZeroMemory(&bi,sizeof(BROWSEINFO));
    bi.hwndOwner=GetSafeHwnd();
    bi.pszDisplayName=name;
    bi.lpszTitle="Select folder";
    bi.ulFlags=BIF_USENEWUI;
    LPITEMIDLIST idl=SHBrowseForFolder(&bi);
    if(idl==NULL)
        return;
    SHGetPathFromIDList(idl,str.GetBuffer(MAX_PATH));
    str.ReleaseBuffer();
    m_Path=str;
    if(str.GetAt(str.GetLength()-1)!=''\\'')
        m_Path+="\\";
    UpdateData(FALSE);
}

posted @ 2011-08-20 13:24 eamon 阅览(147) | 谈论 (0)修正 保藏

要想下载前史版别 Chrome,必须先确认要下载的版别号,然后取版别号第二个小数点后的数字。
http://dl.google.com/chrome/install/[版别号后两位]/chrome_installer.exe
比方15.0.854.0的下载地址便是:
http://dl.google.com/chrome/install/854.0/chrome_installer.exe
注:Chromium, 非官方离线版别和前史版别 Chrome 都不能主动更新。

posted @ 2011-08-20 13:20 eamon 阅览(403) | 谈论 (0)修正 保藏

 POSITION   pos;   
  CString   strFilename;   
  CFileDialog     FileDlg(TRUE,"txt",NULL,OFN_HIDEREADONLY|OFN_FILEMUSTEXIST|OFN_EXPLORER|OFN_ALLOWMULTISELECT,   "Text   Files(*.txt)|*.txt|All   Files(*.*)|*.*|");   
  FileDlg.m_ofn.nMaxFile   =   100   *   MAX_PATH;    //100   Files   
  FileDlg.m_ofn.lpstrFile   =   new   TCHAR[FileDlg.m_ofn.nMaxFile];   
  ZeroMemory(FileDlg.m_ofn.lpstrFile,   sizeof(TCHAR)   *   FileDlg.m_ofn.nMaxFile);   
  if(FileDlg.DoModal()   ==   IDOK)   
  {   
          pos   =   FileDlg.GetStartPosition();   
          while(pos)   
          {   
                  strFilename   =   FileDlg.GetNextPathName(pos);   
                  AfxMessageBox(strFilename);   
          }   
  }

posted @ 2011-08-20 12:27 eamon 阅览(330) | 谈论 (0)修正 保藏

在xp中装置db2后的设置:
1。db2 7.2装置后,把db2的bin目录加到用户的path途径中。
2。修正装置途径下 \java\java12\jdk\jre\lib下的font.properties.zh,把simsun.ttf改为simsun.ttc
3。晋级db2的jdbc驱动到2.0:
   履行 db2_home\java12\usejdbc2.bat

posted @ 2011-08-20 12:19 eamon 阅览(213) | 谈论 (0)修正 保藏

1、点击“开端”挑选“运转”,键入“gpedit.msc”,并运转,翻开“组战略”窗口;  
2、在左栏的“本地计算机战略”下,翻开“计算机装备_办理模板_体系”,
然后在右栏的“设置”标题下,双击“封闭主动播放”;
3、挑选“设置”选项卡,勾取“已启用”复选钮,然后在“封闭主动播放”框中挑选“一切驱动器”,
单击“确认”按钮,退出“组战略”窗口。
4、在“用户装备_办理模板_体系”中于实施计算机装备相同的装备。

posted @ 2011-08-20 12:18 eamon 阅览(165) | 谈论 (0)修正 保藏