免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
1234下一页
最近访问板块 发新帖
查看: 100802 | 回复: 31

[OpenBSD] Basic OpenBSD Setup as Desktop (OpenBSD值得研究 ^_^) [复制链接]

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
发表于 2012-06-04 14:53 |显示全部楼层
本帖最后由 ulovko 于 2013-04-06 11:09 编辑

FROM: http://blog.chinaunix.net/uid-25256412-id-3233391.html

1> 安装 OpenBSD5.1 的准备工作

下载地址:ftp://ftp.openbsd.org/pub/OpenBSD/5.1/amd64/install51.iso
官方最新FAQ:ftp://ftp.openbsd.org/pub/OpenBSD/doc/history/obsd-faq49.pdf
官方最新PF:ftp://ftp.openbsd.org/pub/OpenBSD/doc/history/pf-faq49.pdf
简体中文FAQ 4.6: obsd_FAQ46.zip (424.82 KB, 下载次数: 218)

评分

参与人数 1可用积分 +10 信誉积分 +2 收起 理由
fender0107401 + 10 + 2 非常好,感谢分享,非常有素质,对于推广Op.

查看全部评分

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
发表于 2012-06-04 14:53 |显示全部楼层
本帖最后由 ulovko 于 2012-06-09 09:31 编辑

8> 安装 Xfce4
关于Xorg配置 : http://blog.chinaunix.net/uid-25256412-id-2939430.html

  1. # pkg_add -v xfce4-session xfce-utils xfdesktop xfconf xfce4-mixer xfce4-settings xfce4-panel xfce4-terminal xfce4-places xfwm4 xfwm4-themes gamin

  2. # cat >>/etc/rc.conf.local<<EOF
  3. rc_scripts="dbus_daemon"
  4. EOF
  5. $ echo >~/.xinitrc startxfce4
  6. $ startx

  7. # echo >>/etc/rc.conf.local xdm_flags=""
  8. # exit
  9. $ echo >~/.xsession startxfce4                (如果使用xdm)
  10. # reboot

  11. OR: use gdm as login manager instead of xdm
  12. # pkg_add -v gdm
  13. # vim /etc/rc.conf.local
  14. xdm_flags=NO
  15. rc_scripts="dbus_daemon gdm"
  16. aucat_flags=""               (enable the aucat sound daemon at boot time)
  17. :wq
  18. # aucat -l
复制代码
9> 常用 APP

Chromium/Thunderbird/FileZilla/Empathy(IM Client)/Xchat(IRC Only)/Mplayer/VLC/Audacious

  1. # pkg_add -v chromium             (chrome的表哥)

  2. There are some things to do for Chromium to be a bit functional :
  3. # echo >>/etc/sysctl.conf kern.shminfo.shmall=32768
  4. # vim /etc/login.conf
  5. in the default section:
  6. add
  7. penfiles-max=400:\                (重启生效)

  8. # vim /usr/local/share/application/chromium.desktop
  9. [Desktop Entry]
  10. Version=1.0
  11. Type=Application
  12. Categories=Application;Network
  13. Name=Chromium
  14. Comment=Chromium Web browser
  15. Icon=/usr/local/chrome/product_logo_48.png
  16. Exec=chrome %u
  17. Path=
  18. Terminal=false
  19. StartupNotify=false
  20. :wq
  21. ---------------------------------
  22. 鸟儿:
  23. 一些我的小碎碎念;
  24. 浏览器这块,如果装firefox的话,要先把locale设置好,不然firefox启动异常,有进程,无界面。
  25. chromium 的话,root用户会报错,必须用下面的命令启动:
  26. chromium --user-data-dir=/yourpath
  27. 复制代码
  28. 如果你有4核或者主频高的cpu可以在/etc/rc.conf.local(没有建立一个)加入:
  29. apmd="-C" ## Or "-A"
  30. 复制代码
  31. 深度节能或者让OpenBSD自己管理。man apmd 讲的已经很好懂了。

  32. ---------------------------------
  33. # pkg_add -v mozilla-thunderbird   (Email Client)
  34. # pkg_add -v filezilla             (FTP Client)
  35. # pkg_add -v empathy               (IM Client)
  36. # pkg_add -v xchat                 (IRC Only)
  37. # pkg_add -v mplayer               (建议安装)
  38. # pkg_add -v vlc                   (VLC media player)
  39. # pkg_add -v audacious-plugins     (Audio Player)
  40. PS: To have sound output in Audacious, be sure to select “Sndio output plugin” in preferences/audio.

复制代码
Mousepad/epdfview/GIMP/Ristretto/Thunar-archive/Galculator/LibreOffice

  1. # pkg_add -v mousepad              (Text Editor)
  2. # pkg_add -v epdfview              (PDF Viewer)
  3. # pkg_add -v gimp                  (Image Processing)
  4. # pkg_add -v ristretto             (Image Displayer)
  5. # pkg_add -v thunar-archive        (Archive Manager)
  6. # pkg_add -v galculator            (Calculator)
  7. # pkg_add -v libreoffice-i18n-cn libreoffice-java     (Openoffice的表弟)
  8. Add support for .rar archives rar/unrar
  9. # cd /usr/ports/archives/unrar && make install clean  (没有binary)
复制代码
InputMethod : Scim / fcitx

  1. # pkg_add -v scim-pinyin

  2. # wget 'http://fcitx.googlecode.com/files/fcitx-4.2.3.tar.xz'
  3. # wget 'http://fcitx.googlecode.com/files/fcitx-4.2.3_dict.tar.xz'      (带词库方便没有网络连接的机器!)

  4. 由于OpenBSD默认安装比较干净,所以来安装一下xz ^_^
  5. # pkg_add -v xz
  6. xz-5.0.3p1 : ok

  7. # xz -dk fcitx-4.2.3.tar.xz
  8. # tar -xvf fcitx-4.2.3.tar
  9. OR:
  10. # xzcat fcitx-4.2.3.tar.xz |tar -xvf -
  11. # more fcitx-4.2.3/INSTALL
  12. Basic Install
  13. ...
  14. ...
  15. # vim ~/.profile
  16. export XIM_PROGRAM=fcitx
  17. export XIM=fcitx
  18. export XMODIFIERS="@im=fcitx"
  19. export QT_IM_MODULE=XIM
  20. export GTK_IM_MODULE=XIM

  21. # vim ~/.xinitrc
  22. exec fcitx &            (注意放到第一位优先执行)
  23. # reboot
复制代码
NOTE : the OpenBSD developers strongly suggest to use binary packages whenever possible.

10> TIPS

  1. # man afterboot
  2. # man intro
  3. # man 8 intro
  4. # man hier

  5. Manually update the files database so we can use the locate command to look for a file
  6. # /usr/libexec/locate.updatedb
  7. # locate <name>

  8. List installed packages
  9. # pkg_info |more

  10. Search for packages in repository (provided by PKG_PATH)
  11. # pkg_info -Q <search string>

  12. Update all packages on the system
  13. # pkg_add -v -u

  14. # vim /etc/fstab
  15. install-openbsd16.png
  16. :wq

  17. (FFS records the last time a file was accessed, meaning the last time it was executed or
  18. read by any means. These updates consume a small but measurable amount of time and disk performance.
  19. "noatime" is very useful the hard disk and the screen are the two most power-hungry devices on a laptop
  20. and if you can reduce the amount of time your laptop's hard drive spins you will extend battery life.)

  21. (Soft update, or "softdep," mounts organize and arrange disk writes so that the file system metadata
  22. on the disk remains consistent, and it comes close to giving the performance of an "async"
  23. mount with the reliability of a "sync" mount.)
复制代码
11> Systrace

  1. One of the more exciting features in OpenBSD is systrace(1), a system call access manager.
  2. With systrace, a system administrator can say which system calls can be made by which programs,
  3. and how those calls can be made.
  4. Proper use of systrace can greatly reduce the risks inherent in running poorly written
  5. or exploitable programs.
复制代码
12> Insecure Console (Single-user mode)


When you boot FreeBSD in single-user mode, you get a root command
prompt. This is fine for your laptop and works nicely for servers in your
corporate datacenter, but what about machines in untrusted facilities?

  1. # man /etc/ttys
  2. /secure
  3. secure   If on is also specified, allows users with a UID of 0 to log in
  4.          on this line.   If set for the console entry, then init(8) will
  5.          start a single-user shell without asking for the superuser password.
复制代码
To make the console require a root login when booted into single-usermode,
change the secure to insecure.

  1. # vim /etc/ttys
  2. #
  3. #      $OpenBSD:  ttys,v 1.2 2008/01/09 17:39:42 miod Exp $
  4. #
  5. # name  getty                            type    status          comments
  6. #
  7. console "/usr/libexec/getty std.9600"    vt220   off  insecure
  8. :wq
  9. # reboot
  10. >boot -s
复制代码
13> PF Basic Setup
详见 CU Blog: http://blog.chinaunix.net/uid-25256412-id-3223143.html


14> Basic FreeBSD Setup
详见 CU Blog: http://blog.chinaunix.net/uid-25256412-id-2939430.html

15> OpenBSD 下显示CPU 硬盘 主板温度 CPU风扇转速脚本
FROM: http://bbs.chinaunix.net/thread-1305553-1-1.html (wosl2001)

  1. #!/bin/sh
  2. typeset -i10 HDDCUR
  3. typeset -i10 HDDMAX
  4. typeset -i10 HDDMIN
  5. typeset -i10 CPU
  6. typeset -i10 MainBOARD
  7. typeset -i10 FAN
  8. RAWTEMP=`atactl /dev/sd0c readattr | grep Temperature | cut -f 5`
  9. HDDCUR=`echo $RAWTEMP | sed -e 's/0x.\{10\}/0x/'`
  10. HDDMAX=`echo $RAWTEMP | sed -e 's/0x.\{2\}/0x/' | sed -e 's/.\{8\}$//'`
  11. HDDMIN=`echo $RAWTEMP | sed -e 's/0x.\{6\}/0x/' | sed -e 's/.\{4\}$//'`
  12. CPU=`sysctl hw.sensors.it0.temp0 | cut -d '=' -f2 | cut -c1-2 `
  13. MainBOARD=`sysctl hw.sensors.it0.temp1 | cut -d '=' -f2 | cut -c1-2 `
  14. FAN=`sysctl hw.sensors.it0.fan0 | cut -d '=' -f2 | cut -c1-4 `
  15. echo "Current HDD Temp $HDDCUR degC (Min/Max $HDDMIN/$HDDMAX)"
  16. echo "Current CPU Temp $CPU degC"
  17. echo "Current MainBOARD Temp $MainBOARD degC"
  18. echo "Current CPU FAN $FAN rpm"
  19. CPU-Sensor.jpg
复制代码
16> Reserved for future use....

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
发表于 2012-06-04 14:54 |显示全部楼层
本帖最后由 ulovko 于 2012-06-04 15:14 编辑

编辑的时候很整齐,结果显示的时候就变了

论坛徽章:
0
发表于 2012-06-04 15:14 |显示全部楼层
呵呵 好好写吧 不行写在wiki上

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
发表于 2012-06-04 15:15 |显示全部楼层
回复 4# wosl2001


    也行!

论坛徽章:
0
发表于 2012-06-04 16:13 |显示全部楼层
真的是好详细 {:2_178:}楼主辛苦了

论坛徽章:
0
发表于 2012-06-04 20:29 |显示全部楼层
謝謝分享~~

论坛徽章:
0
发表于 2012-06-04 23:51 |显示全部楼层
这些操作楼主都一一实践过么?
fcitx不修改源代码,在OpenBSD上能直接编译通过?
将LANG设置为zh_CN.UTF-8后,perl不会给出错误提示?

论坛徽章:
0
发表于 2012-06-05 07:29 |显示全部楼层
一些我的小碎碎念;
浏览器这块,如果装firefox的话,要先把locale设置好,不然firefox启动异常,有进程,无界面
chromium 的话,root用户会报错,必须用下面的命令启动:
  1. chromium --user-data-dir=/yourpath
复制代码
如果你有4核或者主频高的cpu可以在/etc/rc.conf.local(没有建立一个)加入:
  1. apmd="-C" ## Or "-A"
复制代码
深度节能或者让OpenBSD自己管理。man apmd 讲的已经很好懂了。

论坛徽章:
0
发表于 2012-06-05 09:11 |显示全部楼层
很不错,谢谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP