find ~/.config/netease-cloud-music -exec sudo chown $USER:$USER {} +
find ~/.config/netease-cloud-music -exec sudo chmod 755 {} +
find ~/.cache/netease-cloud-music -exec sudo chown $USER:$USER {} +
find ~/.cache/netease-cloud-music -exec sudo chmod 755 {} +
5/26/2020
5/24/2020
Ubuntu 18.04 fix mouse and fix wifi
If the bluetooth mouse doesn't work properly:
sudo add-apt-repository ppa:bluetooth/bluez
sudo apt install bluez
To fix it temporarily:
#!/bin/bash
sudo service bluetooth restart
If the WIFI adapter is lost after resume or hibernation:
#! /bin/bash
# Little sleep for safety (??)
sleep 5;
# Remove all of the wifi modules from the kernel
sudo modprobe -r mwifiex_pcie;
sudo modprobe -r mwifiex;
sudo modprobe -r cfg80211;
# Re-add all of the wifi modules
sudo modprobe -i cfg80211;
sudo modprobe -i mwifiex;
sudo modprobe -i mwifiex_pcie;
# Restart netmanager
sudo service NetworkManager restart;
sudo add-apt-repository ppa:bluetooth/bluez
sudo apt install bluez
To fix it temporarily:
#!/bin/bash
sudo service bluetooth restart
If the WIFI adapter is lost after resume or hibernation:
#! /bin/bash
# Little sleep for safety (??)
sleep 5;
# Remove all of the wifi modules from the kernel
sudo modprobe -r mwifiex_pcie;
sudo modprobe -r mwifiex;
sudo modprobe -r cfg80211;
# Re-add all of the wifi modules
sudo modprobe -i cfg80211;
sudo modprobe -i mwifiex;
sudo modprobe -i mwifiex_pcie;
# Restart netmanager
sudo service NetworkManager restart;
5/11/2020
Enable Ubuntu 18.04/22.04/24.04 hibernate
To make things easy: create a swap drive instead of using a swap file.
In the BIOS settings: disable secure boot FIRST.
For 24.04:
Follow: https://ubuntuhandbook.org/index.php/2021/08/enable-hibernate-ubuntu-21-10/
- First, run command to create a config file:
sudo nano /etc/polkit-1/rules.d/10-enable-hibernate.rules
- When file opens, paste the lines below and press Ctrl+S to save, finally press Ctrl+X to exit.
polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.login1.hibernate" || action.id == "org.freedesktop.login1.hibernate-multiple-sessions" || action.id == "org.freedesktop.upower.hibernate" || action.id == "org.freedesktop.login1.handle-hibernate-key" || action.id == "org.freedesktop.login1.hibernate-ignore-inhibit") { return polkit.Result.YES; } });
For 22.04
Then follow: https://www.geeksforgeeks.org/how-to-enable-hibernate-in-ubuntu-22-04-lts/
Edit the file /etc/systemd/sleep.conf with the following configuration:
[Sleep]
HibernateMode=shutdown
Enable the hibernation menu:
sudo gedit /etc/polkit-1/localauthority/50-local.d/com.ubuntu.desktop.pkla[Enable hibernate in upower]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
[Enable hibernate in logind]
Identity=unix-user:*
Action=org.freedesktop.login1.hibernate;org.freedesktop.login1.handle-hibernate-key;org.freedesktop.login1;org.freedesktop.login1.hibernate-multiple-sessions;org.freedesktop.login1.hibernate-ignore-inhibit
ResultActive=yes
4/22/2020
给python shell安装readline以及后续几个坑
在用pyenv开启的virtualenv虚拟环境中,python3的shell交互界面方向键不能使用,出现^[[C^[[D这样的符号,原因是在虚拟环境中安装的Python3没有安装readline,需要自己安装,然后重新编译Python。至于为什么按方向键会出现^[[C^[[D,知乎有解释的很清楚的,链接:https://www.zhihu.com/question/21518507
我在安装readline时出现了问题,然后安装完使用方向键退出交互界面时又出现了问题。。。心塞,不过一步步总算解决了,过程如下:
用easy_install安装readline,在这一步出错,提示信息:
解决方法是需要安装ncurses开发包:
方法来自:https://serverfault.com/questions/440085/ipython-easy-install-pip-error
然后安装完成readline,还需要重新编译Python,或者重新安装一遍。因为我是用pyenv安装的Python3.6.0的版本,就直接再用pyenv安装一遍了:
如果是要重新编译Python,那么:
一定要注意:
如果使用pyenv安装了多套开发环境,要清楚的知道自己重新编译或者重装的是哪一套的环境下的Python,不要搞混了
现在可以在交互模式下使用方向键了,,但是在退出交互模式时
这是因为缺少libtcmalloc-minimal4库,解决方法:
方法来自:https://blog.csdn.net/songyu0120/article/details/77718724
然后再进入交互模式,用左右方向键试下没问题,再退出,还是又报错了:src/tcmalloc.cc:278] Attempt to free invalid pointer
仔细看报错信息,有一行是:WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
安装提示没有被编译的bz2扩展:
再重新编译一次Python
终于没有再报错了,,完美~
我在安装readline时出现了问题,然后安装完使用方向键退出交互界面时又出现了问题。。。心塞,不过一步步总算解决了,过程如下:
|
error: command 'gcc' failed with exit status 1解决方法是需要安装ncurses开发包:
|
然后安装完成readline,还需要重新编译Python,或者重新安装一遍。因为我是用pyenv安装的Python3.6.0的版本,就直接再用pyenv安装一遍了:
|
|
一定要注意:
如果使用pyenv安装了多套开发环境,要清楚的知道自己重新编译或者重装的是哪一套的环境下的Python,不要搞混了
现在可以在交互模式下使用方向键了,,但是在退出交互模式时
exit(),又报错了:Error in `python’: free(): invalid pointer: 0x00007f550490f570 这是因为缺少libtcmalloc-minimal4库,解决方法:
|
方法来自:https://blog.csdn.net/songyu0120/article/details/77718724
然后再进入交互模式,用左右方向键试下没问题,再退出,还是又报错了:src/tcmalloc.cc:278] Attempt to free invalid pointer
仔细看报错信息,有一行是:WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
安装提示没有被编译的bz2扩展:
|
再重新编译一次Python
终于没有再报错了,,完美~
4/15/2020
Best Android Apps
- AMdroid: a clock app to remind calendar events and add quite clock reminders
- The calendar sync keywords (Case sensitive): Alarm;;test;;sync;;Sync;;Liang;;Weekly;;interview;;DeepMap;;Review;;China;;Discussion;;Interview
- Gallery: an application to view images
- CX File Manager: a file manager
- Scrcpy: to wirelessly connect to the phone and view/control the phone screen
- JStock: an application to view/track stocks
- DroidCam Wireless Webcam: if your computer camera doesn't work, use your phone as a webcam
- ACurrency: Foreign exchange rate
- Quick Video Recorder
How to create a shortcut icon on Ubuntu desktop
Eclipse Shortcut for Ubuntu Unity: https://gist.github.com/kui/2922285
4/14/2020
Ubuntu alternative for Logitech options of Windows and Mac mouse/keyboard
sudo add-apt-repository ppa:solaar-unifying/ppa sudo apt-get updatesudo apt install solaar
Subscribe to:
Posts (Atom)