突突唧之家

我的疑问 & 我的解决方案

解决办法

使用 chattr 删除 ia 参数:

chattr -ia files...

chattr 命令

chattr 命令用于改变文件属性,这些属性共有以下8种模式:

  • a 让文件或目录仅供附加用途。
  • b 不更新文件或目录的最后存取时间。
  • c 将文件或目录压缩后存放。
  • d 将文件或目录排除在倾倒操作之外。
  • i 不得任意更动文件或目录。
  • s 保密性删除文件或目录。
  • S 即时更新文件或目录。
  • u 预防意外删除。

注意:文件属性为 a 时,追加文件内容需要使用 echo 命令,不能使用 vim。 原因是 vim 会生成新的文件,echo 是在源文件上追加。

语法

chattr [ -RVf ] [ -v version ] [ -p project ] [ mode ] files...

参数

  • -R 递归处理,将指定目录下的所有文件及子目录一并处理。
  • -V 显示指令执行过程。
  • -f 忽略大多数错误信息。
  • -v version 设置文件或目录版本。
  • -p project 设置文件或目录项目编号。
  • +<mode> 开启文件或目录的该项属性。
  • -<mode> 关闭文件或目录的该项属性。
  • =<mode> 指定文件或目录的该项属性。

Start Cron Service

To start the cron service, use:

sudo /etc/init.d/cron start

OR

sudo service cron start

Stop Cron Service

To stop the cron service, use:

sudo /etc/init.d/cron stop

OR

sudo service cron stop

Restart Cron Service

To restart the cron service, use:

sudo /etc/init.d/cron restart

OR

sudo service cron restart

conda clean

Remove unused packages and caches.

Options:

usage: conda clean [-h] [-a] [-i] [-p] [-t] [-f]
[-c [TEMPFILES [TEMPFILES ...]]] [-l] [-d] [--json] [-q]
[-v] [-y]

Removal Targets

-a, --all

Remove index cache, lock files, unused cache packages, and tarballs.

-i, --index-cache

Remove index cache.

-p, --packages

Remove unused packages from writable package caches.

This does not check for packages installed using symlinks back to the package cache.

-t, --tarballs

Remove cached package tarballs.

-f, --force-pkgs-dirs

Remove all writable package caches. This option is not included with the --all flag.

This will break environments with packages installed using symlinks back to the package cache.

-c, --tempfiles

Remove temporary files that could not be deleted earlier due to being in-use. Argument is path(s) to prefix(es) where files should be found and removed.

-l, --logfiles

Remove log files.

阅读全文 »

If you use Adobe software on Windows, you may run into an issue where you get a logtransport2 error on shutdown of Windows. The issue is probably that the LogTransport2.exe can't connect to its servers to send log data. Adobe offers you a way to opt-out of a few privacy settings through your online account, and once those changes sync back into your Adobe software suite, the Logtransport2 error on shutdown should be fixed.

In an Adobe app or the Creative Cloud app you can click on your profile icon then click on Adobe Account. As of this article, you can also go directly to your Adobe Account Privacy Settings. To fix the LogTransport2.exe error, you'll need to uncheck the box under Desktop And App Usage that says

Yes, I'd like to share information on how I use Adobe desktop apps.

As a privacy best practice, it is also recommended that you uncheck the box under Machine Learning that says

Yes, allow my content to be analyzed by Adobe using machine learning techniques.

Once you make these changes, you shouldn't get the LogTransport2 error when shutting down or rebooting Windows.

When using os.rename() to try to move files between drives, you will receive this error:

OSError: [WinError 17] The system cannot move the file to a different disk drive

This is because os.rename() changes the path of the file but doesn't move its actual data on the disk. this is why you can't move (rename) it from one drive to another.

Moving between drives is actually copy it first, and then delete the source file. you can use shutil.move() method, which do it when you trying to transfer files between two drives.

import shutil

shutil.move(src, dest)

问题描述

在 Ubuntu 执行 sudo apt-get 时,出现了 dpkg: error processing package *** (--configure) 的错误。

解决方案

通过执行下面的命令可能可以解决该问题:

1
2
3
4
5
6
7
8
9
10
11
12
13
sudo mv /var/lib/dpkg/info/ /var/lib/dpkg/info_old/

sudo mkdir /var/lib/dpkg/info/

sudo apt-get update

sudo apt-get -f install

sudo mv /var/lib/dpkg/info/* /var/lib/dpkg/info_old/

sudo rm -rf /var/lib/dpkg/info

sudo mv /var/lib/dpkg/info_old/ /var/lib/dpkg/info/

Use the following command to recursively rename files matching a specific pattern (file* here).

find . -type f -name 'file*' -execdir mv {} {}_renamed ';'

卸载通过 runfile 安装的程序和驱动

Use the following command to uninstall a Toolkit runfile installation:

sudo /usr/local/cuda-X.Y/bin/cuda-uninstaller

Use the following command to uninstall a Driver runfile installation:

sudo /usr/bin/nvidia-uninstall

卸载通过包管理器安装的程序和驱动

sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get remove --purge '^libnvidia-.*'
sudo apt-get remove --purge '^cuda-.*'

Standard font size for article, report, book, and letter.

Command 10pt 11pt 12pt
\tiny 5pt 6pt 6pt
\scriptsize 7pt 8pt 8pt
\footnotesize 8pt 9pt 10pt
\small 9pt 10pt 11pt
\normalsize 10pt 11pt 12pt
\large 12pt 12pt 14pt
\Large 14pt 14pt 17pt
\LARGE 17pt 17pt 20pt
\huge 20pt 20pt 25pt
\Huge 25pt 25pt 25pt

Standard font size for beamer. The default font size for beamer is 11pt.

Command 8pt 9pt 10pt 11pt 12pt 14pt 17pt 20pt
\tiny 5pt 5pt 5pt 6pt 6pt 6pt 8pt 10pt
\scriptsize 5pt 6pt 7pt 8pt 8pt 8pt 10pt 12pt
\footnotesize 6pt 7pt 8pt 9pt 10pt 10pt 12pt 14pt
\small 7pt 8pt 9pt 10pt 11pt 12pt 14pt 17pt
\normalsize 8pt 9pt 10pt 11pt 12pt 14pt 17pt 20pt
\large 10pt 10pt 12pt 12pt 14pt 17pt 20pt 25pt
\Large 11pt 11pt 14pt 14pt 17pt 20pt 25pt 29.86pt
\LARGE 12pt 12pt 17pt 17pt 20pt 25pt 29.86pt 35.83pt
\huge 14pt 14pt 20pt 20pt 25pt 29.86pt 35.83pt 42.99pt
\Huge 17pt 17pt 25pt 25pt 25pt 35.83pt 42.99pt 51.59pt

Windows Terminal 某次更新以后,透明效果消失。在系统“颜色”设置中已经将“透明效果”设置为“开”。

观察以后,可以认为透明效果不生效。“设置”界面、开始菜单、计算器程序,都是纯色,没有毛玻璃效果。

解决方案

运行注册表编辑器 regedit,定位到:

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize

有一个值名称为 EnableTransparency,如果已经启用透明,数据应该是 1

接下来改成 0。然后关机,再开机。接着将数据值改为 1。这时候应该就能看到透明效果回来了。