2017年10月10日星期二

SL6安装postgresql

参考网址 https://wiki.postgresql.org/wiki/YUM_Installation
数据库安装
  1. 访问yum.postgresql.org,选择你要安装的postgresql安装版本,选择OS的类型复制rpm包链接。
  2. yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-sl96-9.6-3.noarch.rpm(我的系统是sl6)
  3. yum install postgresql96-server即可完成安装。
数据库初始化
数据库在运行前需初始化,有两种方法
  1. 第一种方法, 按照wiki.postgresql.org指导,使用service postgresql-9.6 initdb进行初始化工作,此参数的具体明细,可查看/etc/init.d/postgresql-9.6脚本,其中变量PGDATA为data保存位置,PGLOG为日志保存位置,可以修改脚本满足自己需要。
  2. 使用initdb参数时, 获取$LANG为字符格式, 新建了数据目录, 修改了目录访问权限与读写权限, 初始化了启动日志.
  3. 最后,执行的命令为SU -l postgres -c "initdb --pgdata='data_path' --auth='ident' $LANG".
  4. 这种方式执行的数据库启动后,是不知道postgres用户的密码,需要进入psql进行更改(切换至psotgres用户并执行psql命令不需要密码)
  5. initdb的详细参数是可参考/usr/pgsql-9.6/share/man/man1/initdb.1, 仔细查看.
  6. 第二种方法,则是根据initdb手册, 按自己的需求进行数据库初始化.同时也需修改/etc/init.d/postgresql-9.6启动脚本PGDATA参数,才能开机启动服务.
    mkdir -p /opt/pgsql/9.6/data
    chown postgres.postgres /opt/pgsql/9.6/data
    su -l postgres -c "/usr/pgsql-9.6/bin/initdb --pgdata=/opt/pgsql/9.6/data --auth=ident --locale=en_US.UTF-8 --username=postgres -W"
    执行此命令前,需自己建立好目录,并有正确权限,否则会出错
initdb常用参数简介
  1. --auth= 设置pg_hba.conf文件中host与local的验证方法
  2. --auth-host --auth-local 同上,只是分别设置host与local
  3. -D --pgdata= 数据保存path, 可以自行设置PGDATA变量, 在安装时调用
  4. -E 编码方式
  5. --locale=
  6. -U --username= superuser用户名
  7. -W 提示输入密码
设置开机启动postgresql
chkconfig --level 235 postgresql-9.6 on

设置远程可以连接postgresql
  1. 修改数据目录下的postgresql.conf中
    listen_addresses = '*' 打开所有地址的IP地址监听
  2. 修改数据目录下的pg_hba.sql,添加
  3. # IPv4 local connections:
    host    all             all             192.168.13.0/24         md5
  4. 重启服务

认证方法如下:
"trust", "reject", "md5", "password", "gss", "sspi","ident", "peer", "pam", "ldap", "radius" or "cert".  注意"password"发送明文,"md5"发送加密

2017年6月12日星期一

几个家长控制系统android软件的试用

小孩越来越离开手机,特别是假日在家,父母上班不能监控孩子的手机行为,所以家长控制系统显得非常重要,以下是几款软件的试用,
screen time
这是一款老牌的监控软件,在手机上分别安装家长端和孩子端,在家长端申请账号,然后在孩子端输入家长账号,用家长端扫描孩子端二维码,根据提示设置即可
软件的功能有

  1. 在限定孩子每天使用时间,可以星期一至五,星期六及星期日分开设置;在指定时间内可使用的软件
  2. 在星期一至日指定睡觉时间,起床时间,熄灯时间(睡觉时间可设定哪些程序可用,熄灯时间后所有程序都不能用)
  3. 指定学习开始时间,与结束时间,以及指定哪些程序受影响与否
  4. 查看使用的程序时间
  5. 生成报告,查看WEB历史,search历史
  6. 试用时间14天,以后收费,每月$3.99
不过在中国家长端与孩子端都必须翻墙后才能正常使用

secureKids
软件特性

  1. 同一软件,打开后选择家长端和客户端
  2. 孩子端注册,邮箱链接设定密码,家长端登录
  3. 查看孩子使用程序时间,占比
  4. 设置过滤或白名单方式(白名单未使用成功)
  5. 指定哪些程序可以使用
  6. 指定哪些号码不能联系
  7. 定位
  8. 指定闹钟
  9. 指定不能使用手机的多个时间
  10. 在孩子手机端设定紧急求救
  11. 孩子端请求指定权限,家长开通
mmguardian

2017年5月27日星期六

使用arduino开发esp8266的初始配置

一. 下载arduino安装包
https://downloads.arduino.cc/arduino-1.8.2-linux64.tar.xz, 下载后一定用sha512sum校验软件包是否完整, 建议用下载软件下载, 在web中下载太痛苦了.
二. 安装
将软件包解压,并拷贝至相应目录
sudo mv  arduino-1.8.2 /opt/
我的环境是mint 18.1 kde, 安装有点问题, 需要修改install.sh
将install.sh内的下列语句修改为
原:RESOURCE_NAME=cc.arduion.arduinoide
改:RESOURCE_NAME=arduion-arduinoide
运行即可生成菜单
三. 配置
打开File-Preferences, 这里可以配置代理, 修改语言等, 在板管理URL中加入下列地址, 点击OK
http://arduino.esp8266.com/stable/package_esp8266com_index.json
打开Tools-Board-Board manager, 拉至最后, 安装esp8266
四. 端口配置
检测是否发现设备
lsmod | grep usbserial, lsusb
我的环境自动安装了驱动, 比较省事, 端口是ttyUSB0
查看ttyUSB0的权限, 属于dialout, 将用户加入此组
sudo minicom -s
配置好端口与速率






2017年5月15日星期一

xenapp协议驱动程序错误

xenapp修改1494,2598端口后,出现协议驱动程序错误,在远程桌面会话主机配置中,无法修改ICA的适配器配置,解决方法,修改inetpub\wwwroot\citrix\xenapp\conf\default.ics
在[application]下增加CGPAddress=,防止将CGPIP传递到客户端,不使用2598,只使用1494则可以正常工作

重要:其实可以在web interface管理中
xenapp web站点以及xenapp services站点

  1. 在安全访问中使用已转换,在指定地址转换中只指定1494的转换
  2. 不指定2598的转换
  3. 在路由器上只做WEB,1494的端口映射
经过上述的处理,则不需要修改ics文件,即可正常使用WEB访问及receiver访问

2017年5月9日星期二

keepass2与keepassx的比较

https://superuser.com/questions/878902/whats-the-difference-between-keepass-and-keepassx
这个站点做了很好的说明

You probably already know, but both KeePass and KeePassX are open source (published under the GNU General Purpose Licence 2) secure (using AES or Twofish) data storage programs, using a single database file to store (mainly) passwords, or pretty much any data you'd like e.g. user names, passwords, urls, attachments and comments.
KeePass was started about 2003, originally for Windows only, but now uses Mono to run on anything that Mono supports, like Mac OS X, Linux, FreeBSD...
KeePassX is an "Contributed/Unofficial KeePass Port" of KeePass that was started in 2005 (if the copyright notice on the bottom of their webpages is accurate) to run KeePass on Linux. It is now available as a native program for Linux, Windows, OS X, and others.
As the KeePassX homepage says:
Originally KeePassX was called KeePass/L for Linux since it was a port of Windows password manager Keepass Password Safe. After KeePass/L became a cross platform application the name was not appropriate anymore and therefore, on 22 March 2006 it has been changed [to KeePassX].

Currently, the biggest difference between KeePass & KeePassX seems to be the appearance and "feel" of each program, especially on Linux or Mac OS X where KeePassX doesn't rely on Mono, so matches the look of other native programs closer. And, KeePassX's version 0.4.x & 2.x display issues.
Also, KeePassX doesn't support plugins (there are several plugins for KeePass), as the user Grief points out in their answer so do upvote it too.

Screenshots of KeePassX "1.x"/(0.4.x) & "2.x", and KeePass2

These are on a Linux Mint 17 XFCE (Ubuntu 14.04 based) system. See this Ubuntu package search for keepass for what version's currently in what release:

KeePassX 0.4.3 (version 1.x compatible)

This version's in Ubuntu "Trusty Tahr" 14.04 LTS, and uses the KeePass v1.x database - AES/Rijndael or Twofish KeePassX 0.4 This is basically the same font & sizes as other windows, looks great & fits in. You can customize the columns & see the preview panel. Opening an entry to view/edit opens a new window: KeePassX 0.4 view entry

KeePassX 2.0.2

In Ubuntu 16.04 LTS & 16.10, using the KeePass v2.x database - AES/Rijndael only. KeePass2 normal view It uses the new database version 2.x, but you can't use TwoFish encryption, and it removes some display features like the preview panel (the bottom/right panel with details on the selected entry) and customizing columns. Viewing/editing an entry does not open a new window, it changes the whole KeePassX window into the view/edit window.
For some reason, it wouldn't let me resize the window to any smaller than this screenshot. Hopefully they'll add back the missing display features soon, but until then I'll stick with KeePassX 0.4.x.

KeePass 2.25 using Mono

In Ubuntu 14.04 LTS, there's a slightly higher version in 16.04 LTS & newer: enter image description here Visually very similar to KeePassX 0.4.3 but the font's different & smaller, just looks out of place. The preview panel's much more compact (like reading a .CSV file) and viewing/editing an entry opens a new window. It's got a side-by-side view too: KeePass2 side-by-sideAlso can NOT do somethings that the Windows version can like Export to KeePass version 1 formats: KeePass2 Not on Windows Error And has some display issues for me, like in this next image the key transformation rounds is actually 6003, but only the 6 is visible: KeePass2 Display Problems

Formerly, the current "main" KeePassX (0.4.3) only supported "the KeePass 1.x (Classic) password database format" But as of December 7, 2015, KeePassX version 2 has finally reached a stable release:
We’re proud to announce the first stable release of the KeePassX 2 series after several years of development.
KeePassX 2.0 is using the new .kdbx (same as KeePass 2) database format.
You can import your .kdb database from 0.4 from the Database > Import KeePass 1 database.
This is a one-way process though. You can’t migrate back to the .kdb format.
New features include:
  • Multiple attachments per entry
  • Add custom key/value pairs to entries
  • Open multiple database in one window
And the page "KeePass Edition Comparison" is probably helpful to differentiate versions 1 and 2.
It compares around 50 different aspects, copying them all here would be unnecessary, so I'll just paste a few of the differences, features that KeePass 1.x do NOT have, compared to KeePass 2.x. Many of these look very Windows-centered:
Full Unicode Support, Enhanced High DPI Support, Windows User Account, One-Time Passwords (as a plugin), Enter Master Key on Secure Desktop, Custom String Fields, Internal Attachment Viewer/Editor, Entry History, Import External Icons, Group Notes, Show Entries of Sub-Groups, Recycle Bin, Entry Tags, Grouped Results, Sort Search Results, Auto-Type TCATO, Pick Characters, Export To XSL-Transformed, Import from "More than 35 formats (see Help: Import)", Open Database via URL (FTP, HTTP, WebDAV, SCP, SFTP, FTPS), Shared Database Editing (Office-style locking), Synchronization, Scripting, Trigger System.
And, KeePass 1.x supports the Rijndael & Twofish Encryption Algorithms. KeePass 2.x only uses Rijndael.
See the linked Comparison page above for more info, & some description.

2017年5月6日星期六

mint 18.1 qqlight安装

1:安装winehq
sudo dpkg --add-architecture i386
get key https://dl.winehq.org/wine-builds/Release.key
install key sudo apt-key add Release.key
添加源 sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'(mint)
sudo apt update
sudo apt install winehq-devel

2:安装cabextract
sudo apt install cabextract

3:下载winetricks
wget  https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod 755 winetricks
sudo mv winetricks /usr/bin/

4:下载qqlight.verb
https://github.com/hillwoodroc/winetricks-zh
wget https://raw.githubusercontent.com/hillwoodroc/winetricks-zh/master/verb/qqlight.verb

5:安装qqlight
winetricks qqlight.verb

6:中间会下载多个文件,如果发现文件缺失,自行下载并放到指定目录

7:修改快捷方式
右键kde,edit application, 增加item
Exec=env WINEPREFIX=/home/wangzili/.local/share/wineprefixes/qqlight wine "C:\\Program Files (x86)\\Tencent\\QQLite\\Bin\\QQScLauncher.exe"

2017年4月30日星期日

安装wine


  1. sudo dpkg --add-architecture i386
  2. get key https://dl.winehq.org/wine-builds/Release.key
  3. install key sudo apt-key add Release.key
  4. 添加 sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'(mint)
  5. sudo apt update
  6. sudo apt install --install-recommends winehq-devel