6 Aug

Ibus not work in LXDE-Fedora

search result talks about an “input method selector” in preference menu which was not found on my system.
solution:
sudo dnf install imsettings-lxde

then you can find “input method selector” in preference menu.

14 Jul

Fedora network icon disappeared

I created a fedora VM on Lubuntu host this afternoon. When I reopen it tonight, I found the network icon on the top-right disappeared and the network function failed too. I tried some solutions on the forum but nothing helped. Therefore I stopped to do something else. When I came back to VMplayer and tried to open the VM file again, I found that there was my “Fedora” folder along with an empty “fedora” folder under the same path, so I think it maybe the duplicated file name which played the trick. I deleted the empty file and opened the VM again, Now the problem is gone.

28 Dec

lubuntu’s panel keeps in top of all windows

I want the panel to stay in the back of other windows instead of hiding. There is such an option in the panel settings but seems not to be working.
I managed to do that by editing /home/me/.config/openbox/lubuntu-rc.xml
Add these lines just before the last line:

<application name="panel">
<skip_taskbar>yes</skip_taskbar>
<layer>above</layer>
</application>
<application name="panel" type="dock">
<layer>below</layer>
</application>
</applications>

Then restart lubuntu

27 Dec

Ubuntu: incorrect Chinese display

Ubuntu 16.04:Chinese characters display improperly. Old methods don’t work. We need some new methods.
For the system:
sudo vim /var/lib/locales/supported.d/zh-hans
add:
zh_CN.UTF-8 UTF-8
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN GB2312
zh_HK.UTF-8 UTF-8
zh_HK BIG5-HKSCS
zh_SG.UTF-8 UTF-8
zh_SG.GBK GBK
zh_SG GB2312
zh_TW.UTF-8 UTF-8
zh_TW.EUC-TW EUC-TW
zh_TW BIG5

to the file
(those lines were copied from /usr/share/i18n/SUPPORTED)

excecute:
sudo locale-gen

next: config vim:
sudo vi /etc/vim/vimrc
add:
let &termencoding=&encoding
set fileencodings=utf-8,gb18030,gbk,gb2312,big5

next: config gedit:
dconf-editor
in the tree, find:org/gnome/gedit/preferences/encodings
edit the value of candidate-encodings as [‘UTF-8’, ‘GB18030’, ‘GB2312’, ‘GBK’, ‘BIG5’, ‘CURRENT’, ‘UTF-16’]

14 Dec

Some problems about configuring pydev console in eclipse.

I’m planning to do some java coding now. So I installed eclipse which allows me to work with both python and java. However I was really annoyed at configuring the pydev console.
Firstly, I found I can not interact with the console if I run the script with “run” button. I must activate an interactive console to do some further interaction. But the pydev’s console behaves in an odd manner, at least, that’s how it seems to me.
The interactive console can not import modules right there in the same directory with the current working script. The solution is to add the project’s directory to pydev’s PYTHONPATH: right click project name –>PyDev–>set as source folder (add to PYTHONPATH).
Then comes the next problem. I have two similar projects. Both of them rely on a ui.py script of its own. To run these projects, I have to add their directory to Python path as described above. Then I ran project1, everything is fine. Then I ran project2, some error occured. It turns out that project2 called ui.py(1) insteat of its own ui.py. Obviously, the pythonpath configuration does not work in my situation. I have to try another solution, that is to add the projects’s directry to their external lib.
But I still can’t get my project to run correctly. This time, the console failed to find a xls file which was supposed to be read. I typed import os; print(os.getcwd()) to see the current working directory. It turns out that the interactive console was working under eclipse’s default working path rather than the project’s path. So, I have to edit the initial command of interactive console to force the console to change it’s working directory at start up. Go to Windows–>preferences–>Pydev–>interactive console–>initial command, change the initial interpreter commands to:

import sys; print('%s %s' % (sys.executable or sys.platform, sys.version))
import os
import inspect

__old_runfile = runfile

def runfile(file):
curpath = os.path.dirname(os.path.abspath(file))
os.chdir(curpath)
__old_runfile(file)

Now I can properly run my project. I have solved all the problems though, I think I will not use eclipse a lot on python coding. I’d still like to use spyder which is far more cute than eclipse especially in virtual environment. It really saved you a lot of time from configuring all these paths and resourses

13 Dec

Ubuntu booted into emergency mode

I booted my system this morning and found it was forced into an emergency mode like this:

img_20161214_082619

I found an answer on askubuntu.com which talked about unmounting some device. This remind me of what I did last night. I configured my /etc/fstab file last night to add windows partitions’ infomations there, as well as a Seagate portable disk. But now I am in my office without that Seagate disk. Could it be the missing device that caused the booting problem?

So I booted into a live USB to comment out the Seagate device information in fstab file and reboot the computer again. Now I can boot into my system without any problem!

5 Nov

500 internal server error on visiting encrypted path

I use .htaccess to encrypt “www.actinia.me/test”

the .htaccess file is:

AuthUserFile /home/.htpasswd
AuthName “ceshiyonghu”
AuthType Basic
Require user ceshiyonghu

but when I visited the url, I got a 500 internal server error. I checked the error log (/var/log/apache2/error.log) and find the “AuthUserFile not allowed here” record.

To solve this, I added this:

<Directory /var/www/test/>
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo Indexes Authconfig
</Directory>

to apache config file (/etc/apache2/apache2.conf),

and executed:

sudo a2enmod rewrite

sudo service apache2 restart

Now I can visit my test folder!

13 Oct

VMware: completely hide tool bar in full-screen mode

Go to: C:\Users\your_user_name\AppData\Roaming\VMware\preferences.ini
Add this line: pref.vmplayer.fullscreen.nobar = "TRUE"
save.

Now you will not see the blue edge of the tool bar in full-screen mode.
To return to normal mode, press “ctrl+alt” to release the control, then press “ctrl+alt+Enter” to regain normal mode.

Ps: I also read someone said that the above line doesn’t work for him, he had to use:
pref.vmplayer.fullscreen.nobar = 1.
However, the “True” version works just fine to me. So I don’t have to bother it at least for now.

26 Apr

“Firefox is already running”

Can’t start firefox, it reports:”Firefox is already running, but is not responding.”.

I tried to uninstall, purge uninsiall, wipe mozilla and firefox folds, but it didn’t help.

In the end, I found that starting firefox with a completely new profile helped:

firefox -p