Debian是我日常使用的桌面系统,这里记录了我在使用Debian和其他Linux时所有的问题和解决办法,以及一些其他的心得体会。
向Debian致敬!
找回桌面系统关机按钮
在/etc/polkit-1/localauthority/50-local.d/新建文件50-admin.pkla,写入如下内
容:
[disable suspend]
Identity=unix-user:*
Action=org.freedesktop.upower.suspend
ResultAny=no
ResultInactive=no
ResultActive=no
[disable hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultAny=no
ResultInactive=no
ResultActive=no
无线不能使用的解决方法
安装rfkill工具
#apt-get install rfkill
then:
#rfkill list all
查看网卡设备的状态如下
0: dell-wlan: Wireless LAN
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
根据软件或者硬件的状态解锁
wireshark普通用户权限
$ sudo groupadd wireshark
$ sudo usermod -a -G wireshark YOUR_USER_NAME
$ sudo chgrp wireshark /usr/bin/dumpcap
$ sudo chmod 750 /usr/bin/dumpcap
$ sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/dumpcap
$ sudo getcap /usr/bin/dumpcap
Adobe flash player的正确安装姿势
首先下载flash player,保存为flash.tar.gz
then:
tar -zxvf flash.tar.gz
mv usr/* /usr/
mv libflashplayer.so /usr/lib/mozilla/plugins/
重启浏览器即可
解决Debian8 pptp不能连接的问题
报错内容:(/var/log/syslog)
Sep 15 14:58:21 debian NetworkManager[13550]: ** Message: pppd started with pid 14188
Sep 15 14:58:21 debian pppd[14188]: Plugin /usr/lib/pppd/2.4.6/nm-pptp-pppd-plugin.so loaded.
Sep 15 14:58:21 debian NetworkManager[13550]: Plugin /usr/lib/pppd/2.4.6/nm-pptp-pppd-plugin.so loaded.
Sep 15 14:58:21 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (plugin_init): initializing
Sep 15 14:58:21 debian pppd[14188]: pppd 2.4.6 started by root, uid 0
Sep 15 14:58:21 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 3 / phase 'serial connection'
Sep 15 14:58:21 debian pppd[14188]: Using interface ppp0
Sep 15 14:58:21 debian pppd[14188]: Connect: ppp0 <--> /dev/pts/0
Sep 15 14:58:21 debian NetworkManager[13550]: Using interface ppp0
Sep 15 14:58:21 debian NetworkManager[13550]: Connect: ppp0 <--> /dev/pts/0
Sep 15 14:58:21 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
Sep 15 14:58:21 debian NetworkManager[13550]: (ppp0): new Generic device (driver: 'unknown' ifindex: 57)
Sep 15 14:58:21 debian NetworkManager[13550]: (ppp0): exported as /org/freedesktop/NetworkManager/Devices/15
Sep 15 14:58:21 debian NetworkManager[13550]: devices added (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Sep 15 14:58:21 debian NetworkManager[13550]: device added (path: /sys/devices/virtual/net/ppp0, iface: ppp0): no ifupdown configuration found.
Sep 15 14:58:52 debian pppd[14188]: LCP: timeout sending Config-Requests
Sep 15 14:58:52 debian pppd[14188]: Connection terminated.
Sep 15 14:58:52 debian avahi-daemon[588]: Withdrawing workstation service for ppp0.
Sep 15 14:58:52 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 11 / phase 'disconnect'
Sep 15 14:58:52 debian NetworkManager[13550]: devices removed (path: /sys/devices/virtual/net/ppp0, iface: ppp0)
Sep 15 14:58:52 debian pptp[14193]: nm-pptp-service-14185 warn[decaps_hdlc:pptp_gre.c:216]: pppd may have shutdown, see pppd log
Sep 15 14:58:52 debian pppd[14188]: Modem hangup
Sep 15 14:58:52 debian pppd[14188]: Exit.
Sep 15 14:58:52 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_phasechange): status 1 / phase 'dead'
Sep 15 14:58:52 debian NetworkManager[13550]: ** Message: nm-pptp-ppp-plugin: (nm_exit_notify): cleaning up
Sep 15 14:58:52 debian NetworkManager[13550]: ** (nm-pptp-service:14185): WARNING **: pppd exited with error code 16
依次输入如下命令:
modprobe nf_nat_pptp
modprobe nf_conntrack_pptp
modprobe nf_conntrack_proto_gre
下次启动还会失效,所以要编辑/etc/modules-load.d/modules.conf文件,添加如下三行:
nf_nat_pptp
nf_conntrack_pptp
nf_conntrack_proto_gre
正确安装ruby RVM的方法
curl -sSL https://get.rvm.io | bash -s stable
减少开机等待时间
- 减少grub等待时间:
修改/etc/default/grub,将
GRUB_TIMEOUT=5
改为 (grub等待超时改成1秒):
GRUB_TIMEOUT=1
然后
# update-grup
- 减少开关机超时
修改/etc/systemd/system.conf,修改开关机超时时间为5s:
DefaultTimeoutStartSec=5s
DefaultTimeoutStopSec=5s
重启
使用随机MAC地址
出于隐私需求,不想暴露真实mac地址,把下面这个脚本的内容加入/etc/init.d,就可以在每次开机的时候为网卡随机设置一个mac地址。
#!/bin/bash
#Chorder
#2016/12/08
mhash=`date +%s|md5sum`
ifconfig eth0 down
ifconfig eth0 hw ether `echo ${mhash:$((RANDOM % 13)):2}:\
${mhash:$((RANDOM % 13)):2}:${mhash:$((RANDOM % 13)):2}:\
${mhash:$((RANDOM % 15)):2}:${mhash:$((RANDOM % 15)):2}:\
${mhash:$((RANDOM % 15)):2} `
ifconfig eth0 up
ifconfig wlan0 down
ifconfig wlan0 hw ether `echo ${mhash:$((RANDOM % 13)):2}:\
${mhash:$((RANDOM % 13)):2}:${mhash:$((RANDOM % 13)):2}:\
${mhash:$((RANDOM % 15)):2}:${mhash:$((RANDOM % 15)):2}:\
${mhash:$((RANDOM % 15)):2} `
ifconfig wlan0 up
gnome删除多余菜单文件夹
gsettings set org.gnome.desktop.app-folders folder-children ['']
CentOS删除旧内核
for k in `rpm -qa | grep kernel |grep -v \`uname -r\``;do yum remove $k;done
鼠标滚轮方向调整
~/.Xmodmap
如果想要鼠标逆序滚动,就将其中的内容改为
pointer = 1 2 3 4 5 6 7 8 9 10 11 12
否则,就将内容改为:
pointer = 1 2 3 5 4 6 7 8 9 10 11 12
4和5代表的是鼠标滚轮方向的映射。
Debian9 GNOME 允许root登录
修改三个文件:
- /etc/gdm3/daemon.conf
在Security节,加入
AllowRoot=true
- /etc/pam.d/gdm-password
注释掉
auth required pam_succeed_if.so_user != root quiet_success
- /etc/pam.d/gdm-autollgoin
注释掉
auth required pam_succeed_if.so_user != root quiet_success
重启。