Posts in category “Linux”

转换 gbk txt文件为 utf-8 编码

这都是为了看《非正常人类异闻录》

iconv -c -f gbk -t utf-8 待转文件名 > target.txt

-c 的意思是在输出文本中忽略非法的字符序列

Reference

然而都弄好了,即没有认真看那本书。不喜欢那种风格,没办法

设置mysql用户密码时小心 # 字符

我喜欢用 .my.cnf 配置 mysql 的登录信息,这样我执行一些命令的时候就不用在命令行上提供密码。但今天我被自己设置的”高强度密码“坑到了

简而言之,如果你的密码里有#字符,请用双引号把整个密码括起来,要知道没有被引号括起来的 #字符,标识后面的都是注释。哈

Debian/Ubuntu/PopOS! package managemant related TIPS

package name for common used Linux util in Debian/Ubuntu

ps

apt install -y procps

ping

apt install -y iputils-ping

telnet

apt install -y telnet

general solution for apt get/apt upgrade similiar issues

first,

sudo dpkg --configure -a

followed by:

sudo apt --fix-broken install

Using dconf-editor to setup extra hot keys for the Gnome 3 desktop

The keyboard shortcuts setting in the Settings app can only support 4 workspaces. However, I want to use 8 workspaces to implement the goal of "everything in its right place". Solution:

sudo apt install dconf-editor
dconf-editor

org/gnome/desktop/wm/keybindings
# Then you can do what you want to do there

Reference

By the way, my final configuration is shown below:

Ctrl + 1-8 Switch to workspace 1-8
Ctrl+Alt+1-8 Move current window to workspace 1-8 and jump to that workspace

  • Workspace 1: Chrome
  • Workspace 2: Gnome-terminal
  • Workspace 3: Rider
  • Workspace 4: WebStorm
  • Workspace 5: Ebook reader (Evince and others)
  • Workspace 6: File Manager, BitTorrent downloader,
  • Workspace 7: VMs
  • Workspace 8: Settings, Telegram, music player, misc.

Linux TIPS collect (神奇的知识集合)

  1. http_proxy environment in sudo command: http_proxy=xxx:xxx sudo yourcommand doesn't work, you should sudo http_proxy=xxx:yyy yourcommand instead.
  2. ssh running local script: ssh username@hostname 'bash -s' < your.local.script.sh
  3. ssh running local script with paraemters: ssh username@hostname < your.local.script.sh 'bash -s' yourparam1 yourparam2 doesn't work, you should runssh username@hostname < your.local.script.sh 'bash -s' -- yourparam1 yourparam2
  4. make your fonts configuration work without a reboot: sudo fc-cache -fv