設定為 1G
interface 1/0/1
auto-negotiate
speed auto 1000 full-duplex
exit
設定為 10G
no auto-negotiate
speed 10G full-duplex
2018年9月28日 星期五
PHP Sqlite3 筆記
try {
//建立連線
$dbh = new PDO('sqlite:./test.db3');
//建表格
$dbh->exec("CREATE TABLE a(id integer,name varchar(255))");
//增加資料
$dbh->exec("INSERT INTO a values(1,'test')");
$dbh->beginTransaction();
//取得資料
$sth = $dbh->prepare('SELECT * FROM a');
$sth->execute();
//獲取結果
$result = $sth->fetchAll();
print_r($result);
}
catch (PDOException $e)
{ echo 'Connection failed: ' . $e->getMessage(); }
if(isset($dsn)) $dsn=null;
//建立連線
$dbh = new PDO('sqlite:./test.db3');
//建表格
$dbh->exec("CREATE TABLE a(id integer,name varchar(255))");
//增加資料
$dbh->exec("INSERT INTO a values(1,'test')");
$dbh->beginTransaction();
//取得資料
$sth = $dbh->prepare('SELECT * FROM a');
$sth->execute();
//獲取結果
$result = $sth->fetchAll();
print_r($result);
}
catch (PDOException $e)
{ echo 'Connection failed: ' . $e->getMessage(); }
if(isset($dsn)) $dsn=null;
2018年9月25日 星期二
Debian9 設定 Apache 2 HTTPS
載入ssl模組
cd /etc/apache2/mods-enabled
ln -s ../mods-available/ssl.load ssl.load
ln -s ../mods-available/ssl.conf ssl.conf
編輯 /etc/apache2/sites-available/default-ssl.conf
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
設定 SSL
a2ensite default-ssl
a2enmod ssl
systemctl restart apache2
cd /etc/apache2/mods-enabled
ln -s ../mods-available/ssl.load ssl.load
ln -s ../mods-available/ssl.conf ssl.conf
編輯 /etc/apache2/sites-available/default-ssl.conf
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
設定 SSL
a2ensite default-ssl
a2enmod ssl
systemctl restart apache2
2018年9月19日 星期三
LEAF shorewall NAT one to one
增加 /etc/shorewall/nat 192.168.10.42 eth0 192.168.201.1 no no 增加 /etc/shorewall/rules ACCEPT:NFLOG(4) net dmz:192.168.201.1 tcp 22 - 192.168.10.42 ACCEPT:NFLOG(4) net dmz:192.168.201.1 tcp 80 - 192.168.10.42
DNAT:NFLOG(4) net dmz:192.168.201.2 tcp 21 - 192.168.10.42 DNAT:NFLOG(4) net dmz:192.168.201.2:21 tcp 990 - 192.168.10.42 修改 /etc/shorewall/shorewall.conf ADD_IP_ALIASES=Yes
2018年9月17日 星期一
Debian9 設定PHP7 beast
busybox=/usr/local/bin/busybox
wget -q https://busybox.net/downloads/binaries/1.28.1-defconfig-multiarch/busybox-x86_64 -O ${busybox}&&chmod a+x ${busybox}||exit 1
apt-get -y install gcc make php php-dev
wget https://github.com/liexusong/php-beast/archive/master.zip
busybox unzip master.zip
cd php-beast-master
phpize
./configure
make
make install
echo extension=beast.so >>/etc/php/7.0/apache2/php.ini
echo extension=beast.so >>/etc/php/7.0/cli/php.ini
wget -q https://busybox.net/downloads/binaries/1.28.1-defconfig-multiarch/busybox-x86_64 -O ${busybox}&&chmod a+x ${busybox}||exit 1
apt-get -y install gcc make php php-dev
wget https://github.com/liexusong/php-beast/archive/master.zip
busybox unzip master.zip
cd php-beast-master
phpize
./configure
make
make install
echo extension=beast.so >>/etc/php/7.0/apache2/php.ini
echo extension=beast.so >>/etc/php/7.0/cli/php.ini
2018年9月13日 星期四
proxmox 5 移除cluster 資訊
systemctl stop pve-cluster
systemctl stop corosync
pmxcfs -l
rm /etc/pve/corosync.conf
rm /etc/corosync/*
killall pmxcfs
systemctl start pve-cluster
systemctl stop corosync
pmxcfs -l
rm /etc/pve/corosync.conf
rm /etc/corosync/*
killall pmxcfs
systemctl start pve-cluster
2018年9月6日 星期四
訂閱:
文章 (Atom)