只是个云笔记。善用Ctrl+F。

Ubuntu笔记本触控板失灵

modprobe -r psmouse

modprobe psmouse proto=imps

由于多种发型版本都有使用,我比较喜欢crontab -e,然后使用@reboot,写一个shell挂载。一法全解,比去折腾什么服务,什么update-rc强多了。

Win10 bat-UAC

@echo off
bcdedit >nul && goto main
>%temp%\getadmin.vbs echo Set UAC = CreateObject^("Shell.Application"^)
>>%temp%\getadmin.vbs echo UAC.ShellExecute "%~s0", "", "", "runas", 1
start wscript %temp%\getadmin.vbs
exit /b

Debian10阿里源

nano /etc/apt/sources.list

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb http://mirrors.aliyun.com/debian-security/ buster/updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian-security/ buster/updates main non-free contrib

Linux多线程工具

apt-get install axel -y

axel 链接

Debian 永久DNS修改

sudo vim /etc/resolv.conf

nameserver 192.168.1.1

nameserver 8.8.8.8

apt install resolvconf

cd /etc/resolvconf/resolv.conf.d/

vim original

nameserver 192.168.1.1

nameserver 8.8.8.8

vim base

全页灰度

<style>

html {

-webkit-filter: grayscale(100%);

-moz-filter: grayscale(100%);

-ms-filter: grayscale(100%);

-o-filter: grayscale(100%);

filter:progidXImageTransform.Microsoft.BasicImage(grayscale=1);

_filter:none;

}

</style>

LemonBench

curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s fast

curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s full

测试可用真实内存数

64位系统

wget http://down.xxorg.com/Tool/memtest/memtest_1M_64

chmod +x ./memtest_1M_64

./memtest_1M_64

32位系统

wget http://down.xxorg.com/Tool/memtest/memtest_1M_32

chmod +x ./memtest_1M_32

./memtest_1M_32

手动添加SWAP

创建SWAP文件

cd /opt

mkdir swap

cd swap

dd if=/dev/zero of=swapfile bs=1024 count=1000000

mkswap swapfile

挂载:swapon /opt/swap/swapfile

卸载:swapoff /opt/swap/swapfile

nano /etc/fstab

添加:/opt/swap/swapfile swap swap defaults 0 0

查看是否成功:swapon --show

Debian自动连接WiFi热点

ifconfig找出无线网卡的设备名称

编辑/etc/network/interfaces,输入以下内容:

auto wlp2s0b1

iface wlp2s0b1 inet dhcp

wpa-essid homeplus-B7

wpa-psk xxxx

注释:wlp2s0b1是ifconfig找出的无线网卡名称,wpa-essid是wifi名称,wpa-psk是wifi密码。

无限循环下载写入到NULL

while true
do
wget -O /dev/null "目标连接"
done

没有rc.local的自启动(Ubuntu和Debian适用)

#将脚本添加开机自启,先放入/etc/init.d文件夹,并给予可执行权限

mv xx.sh /etc/init.d

chmod +x /etc/init.d/xx.sh

#设置开机自启

update-rc.d xx.sh defaults

#删除开机自启

update-rc.d -f xx.sh remove

#如果你想禁止程序开机自启,比如apache2、nginx

update-rc.d -f apache2 remove

update-rc.d -f nginx remove

Mplayer后台播放

mplayer * < /dev/null > /dev/null 2>1&

ffmepg推流(复制)

ffmpeg -re -i "源地址" -f flv "推流服务器地址"

禁用iPv6

echo "net.ipv6.conf.all.disable_ipv6     = 1" >>/etc/sysctl.conf

echo "net.ipv6.conf.default.disable_ipv6 = 1" >>/etc/sysctl.conf

echo "net.ipv6.conf.lo.disable_ipv6      = 1" >>/etc/sysctl.conf

最后重启或者:sysctl -p

显示CPU温度

显示默认千分之一度。

cat /sys/class/thermal/thermal_zone0/temp

直接以度为单位显示:

echo $[$(cat /sys/class/thermal/thermal_zone0/temp)/1000]°

Watch实时观看:

watch -n 0.1 echo CPU: $[$(cat /sys/class/thermal/thermal_zone0/temp)/1000]°

Ubuntu合上笔记本盖子不关机

编辑 /etc/systemd/logind.conf

找到 HandleLidSwitch 设置,去掉行头注释#,然后改成下面这样

HandleLidSwitch=ignore

重启systemd-logind

systemctl restart systemd-logind

全盘搜索文件

find / -name  xxxxx

Debian7 没有Key:

问题:There is no public key available for the following key IDs9D6D8F6BC857C906

解决:apt-get install debian-keyring debian-archive-keyring

修改各版本DNS(可能重启失效)。

vim /etc/resolv.conf

systemctl restart network

Google OpenDNSv4: 8.8.8.8    8.8.4.4

Google OpenDNSv6: 2001:4860:4860::88882001:4860:4860::8844

没有Killall

yun install psmisc

apt-get install psmisc

ALL SS-all脚本

wget --no-check-certificate -O shadowsocks-all.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-all.sh chmod +x shadowsocks-all.sh ./shadowsocks-all.sh 2>&1 | tee shadowsocks-all.log


午夜零点的帷幕彼方,难消之恨,愿为消之。