Press "Enter" to skip to content

月与灯依旧 Posts

配置Xmanager连接Ubuntu 14.04远程桌面

Xmanager默认使用XDMCP协议连接远程桌面, 因此这里我们需要启用XDMCP协议.

$ sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
[SeatDefaults]
user-session=mate     #将其改为mate, 并添加如下几行
allow-guest=false
greeter-show-manual-login=true
greeter-hide-users=true

[XDMCPServer]
enabled=true


$ sudo service lightdm restart

$ netstat -anp  |grep :177     #确保UDP的177端口启动成功(XDMCP使用UDP 177端口)
udp        0      0 0.0.0.0:177             0.0.0.0:*                           -               
udp6       0      0 :::177                  :::* 

接下来是安装mate桌面

$ sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
$ sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
$ sudo apt-get update

mate官方WIKI针对Ubuntu 14.04给出了三种安装方式

$ sudo apt-get install mate-desktop-environment-core   #安装一个最小化的mate桌面
$ sudo apt-get install mate-desktop-environment        #安装一个完整的mate桌面
$ sudo apt-get install mate-desktop-environment-extras #安装一个完整的mate桌面(包含推荐的软件包)

本文这里使用了第一种方式安装.

然后就可以在Xmanager里输入IP地址, 方法选择”XDMCP Query”即可连接.

2 Comments

Linux系统安装obfuscated-openssh

1,安装obfuscated-openssh server

obfuscated-openssh可以代替系统的OpenSSH服务,如果在安装过程中不指定–prefix选项,它将替换系统openssh-server的二进制程序和配置文件. 本文指定了安装目录,并不会与系统自带的openssh服务冲突.

yum install zlib openssl                     #适用Redhat/CentOS系统
sudo apt-get install zlib1g-dev libssl-dev   #适用Ubuntu系统

wget -O ofcssh.tar.gz https://github.com/brl/obfuscated-openssh/tarball/master

tar zxvf ofcssh.tar.gz

cd brl-obfuscated-openssh-ca93a2c/

./configure --prefix=/usr/local/obfus  #如果遇到错误请参考下文处理方法
make
make install

sed -i "s/Port /#Port /g" /usr/local/obfus/etc/sshd_config      #22端口被正常的SSH服务使用,这里不需要
sed -i "s/UsePAM /#UsePAM /g" /usr/local/obfus/etc/sshd_config  #obfuscated-openssh不支持UsePAM选项
echo "ObfuscatedPort 32" >> /usr/local/obfus/etc/sshd_config              #指定监听端口
echo "ObfuscateKeyword fuckthegfw" >>  /usr/local/obfus/etc/sshd_config   #指定混淆密钥

运行:
/usr/local/obfus/sbin/sshd -f /usr/local/obfus/etc/sshd_config &


设置开机自启(写入/etc/rc.local)
echo 'nohup /usr/local/obfus/sbin/sshd -f /usr/local/obfus/etc/sshd_config >> /var/log/obfus.log 2>&1 &' >> /etc/rc.local
Leave a Comment

获取China大陆IP段的范围

这里有几个网站提供了大陆的IP段范围。别问我要这个列表干什么,我也不知道。

http://www.ip2location.com/blockvisitorsbycountry.aspx
老牌网站,国内很多人应该都知道,可以选择任意一个国家的IP段,然后可以输出多种格式。

https://www.countryipblocks.net/country_selection.php
跟上面的那个一样,多一个备份。

http://www.ipdeny.com/ipblocks/
一样是列出了所有国家的IP段文件,提供下载。

1 Comment

删除文件以后,XFS分区的可用容量并未增加?

今天接到一同事报告,在分区里删除了一些大体积文件以后,使用df -hT看到该分区的Avail容量并未增加。我的第一反应就是肯定是XFS文件搞的鬼!经过谷歌以后证明了确实是XFS文件系统的问题。

XFS is designed to support highly parallel operation and massive dynamically expanding file system sizes. Both are supported by dynamic allocation of inodes.

XFS被设计为支持高度并行运算和海量动态扩展文件系统大小。两者都是由inode的动态分配支持。

XFS dynamically allocates space for inodes as they are created, this is different from many other filesystems where inode space is statically allocated at mkfs time. While inode space is dynamically allocated, it is never freed – up until now that is.

When ikeep is specified, XFS does not delete empty inode clusters and keeps them around on disk. When noikeep is specified, empty inode clusters are returned to the free space pool.

Leave a Comment

为Linux发行版安装开源字体软件

除了Ubuntu以外,大多数Linux发行版在字体渲染方面一直都不好,尤其是安装了中文字体以后,看起来模糊、发虚,简直无法直视。本文介绍了在Arch/Fedora/OpenSUSE/Debian系统下安装Infinality开源字体软件的方法。

1,为Arch Linux安装Infinality

$ sudo vim  /etc/pacman.conf:

[infinality-bundle]
Server = http://bohoomil.com/repo/$arch

[infinality-bundle-multilib]
Server = http://bohoomil.com/repo/multilib/$arch

[infinality-bundle-fonts]
Server = http://bohoomil.com/repo/fonts

$ sudo pacman -Syu

$ sudo pacman -S infinality-bundle infinality-bundle-multilib ibfonts-meta-extended  #64位系统
$ sudo pacman -S infinality-bundle ibfonts-meta-extended     #32位系统

然后重启系统即可。

Leave a Comment

Windows10无法访问Samba服务器的方法

Windows10无法访问Samba服务器的方法。这里有以下两种情况。

1,Windows10(作为客户端)无法访问其它服务器上共享出来的目录

1,打开注册表编辑器(运行regedit并回车);
2,展开HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters,右击Parameters,选择“新建”-“DWORD (32位)值”,名称为AllowInsecureGuestAuth,并且将该值设置为1,保持默认的16进制不变。
参考文档

2,Windows10(作为服务端)的共享目录,在其它服务器上无法访问

1,打开控制面板\网络和 Internet\网络和共享中心\高级共享设置;
2,找到“所有网络”下面的“密码保护的共享”,选择“关闭密码保护共享”。
参考文档

4 Comments

Gnome3修改字体

获得系统已安装的字体列表

$ fc-list
$ fc-list :lang=zh
$ fc-list :lang=zh |  cut -d : -f 2 | cut -d, -f1 | sort | uniq -c

修改Gnome Shell字体

$ sudo vim /usr/share/gnome-shell/theme/gnome-shell.css  #修改如下内容

……
font-family: cantarell, sans-serif;
……

经过以上修改,重启后就会发现Gnome Shell字体变了。但是,(欢迎)登陆界面,字体仍未被修改,原因未知

修改系统字体

$ sudo apt-get install gnome-tweak-tool   #适用ubuntu/debian

$ yum install gnome-tweak-tool      #适用fedora

然后在应用程序列表里找到“优化工具”即可设置。

Leave a Comment