Pages

Showing posts with label solved. Show all posts
Showing posts with label solved. Show all posts

Friday, January 4, 2019

xorg.conf ModeLine for VGA connected ViewSonic monitors

Even with latest Linux distributions you can face the problem of Xorg not detecting your monitor.

My monitor is ViewSonic VG2030wm and it is capable of working at 1680x1050 resolution but Xorg can't detect that and highest resolution that I can use is 1024x768.

You need to add ModeLine so the Xorg can recognize it. Here is my Monitor section from xorg.conf:

Section "Monitor"
        Identifier   "ViewSonic"
        VendorName   "ViewSonic"
        ModelName    "VG2030wm"
        HorizSync    24.0 - 92.0
        VertRefresh  50.0 - 85.0
        Option       "DPMS"
        ModeLine "1680x1050" 170.00 1680 1784 1960 2240 1050 1053 1059 1089 +hsync +vsync
EndSection

Probably you will need just the ModeLine row but I am publishing the whole Monitor section.

You can find more ModeLine for certain monitors here: https://www.mythtv.org/wiki/Modeline_Database

Monday, April 28, 2014

MRTG error on Debian Squeeze

The error:
rogue:~# mrtg /etc/mrtg.cfg
2014-04-28 16:32:17: WARNING: Can not determine ifNumber for public@127.0.0.1:     ref: 'Name'     key: 'eth0'
2014-04-28 16:32:17: WARNING: Can not determine ifNumber for public@127.0.0.1:     ref: 'Name'     key: 'eth1'
2014-04-28 16:32:17: ERROR: Target[127.0.0.1_eth0][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
2014-04-28 16:32:17: ERROR: Target[127.0.0.1_eth0][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data
2014-04-28 16:32:17: ERROR: Target[127.0.0.1_eth1][_IN_] ' $target->[1]{$mode} ' did not eval into defined data
2014-04-28 16:32:17: ERROR: Target[127.0.0.1_eth1][_OUT_] ' $target->[1]{$mode} ' did not eval into defined data
How to fix it:

# cd /var/lib/mrtg
# mv _etc_mrtg.cfg _etc_mrtg.cfg.old

Now run again mrtg /etc/mrtg.cfg - the error is gone.

Wednesday, January 9, 2013

Joomla FTP Layer - permissions and solution

When using commercial hosting with CPanel interface with Joomla you can be stuck by problem with file permissions. Errors like these are common:
Warning: Failed to move file!
The problem occurs  when uploading and installing modules/templates in Joomla admin interface. There are a lot of advises out there that suggest you to do "chmod 777 somedir" to resolve this problem. This is BAD solution and should never be used. Here is explanation why is this happening and how can you fix it without changing permissions.

When you buy hosting you get username/password for CPanel and ftp account which are identical. Installing Joomla on such hosting is not a problem but when trying to install template/module in Joomla admin panel you can see the above error message.

When uploading and installing files from Joomla admin panel, uploaded file is set to different owner than your username for the hosting. Uploaded file is owned by user started the apache web server. On most linux distributions it is www, www-data, http and so on. So when uploaded with different user the file can't even be deleted by your account and you need to contact hosting administrator to delete it for you. What you need to do is to make Joomla upload file with your hosting username/password. This is done by enabling FTP layer in Joomla global configuration tab and filling it with the right data (user/pass/ftp root). This can be done on installation process of Joomla but it is disabled by default. If you don't do this the final process of writing configuration.php will fail and you need to save and upload it manually.

How to enable it manually. Lets assume that your Joomla installation at address http://yousite.com/joomla. If you login in CPanel you will see that your home directory is something like "/home/username/". Document root of the web server is /home/username/public_html and Joomla is installed in /home/username/public_html/joomla. Here is configuration.php for ftp layer:

public $ftp_host = '127.0.0.1'; // change ftp ip address here
public $ftp_port = '21';
public $ftp_user = 'username';
public $ftp_pass = 'password';
public $ftp_root = 'public_html/joomla/';
public $ftp_enable = '1';

This should solve the problem with user mismatch when uploading modules/templates.
Other is hosting provider to support suPHP which is better solution to this problem.

Monday, December 3, 2012

Lotus Notes 8.5.3 on Debian Unstable problems and solution.

Lotus Notes 8.5.3 on Debian Unstable problems and solution
(based on link from ibm site with Ubuntu 11.10 solution).

Get debian packages of Lotus Notes 8.5.3 and install them.
List of available packages for Debian :

ibm-lotus-activities-8.5.3.i586.deb
ibm-lotus-cae-8.5.3.i586.deb
ibm-lotus-feedreader-8.5.3.i586.deb
ibm-lotus-notes-8.5.3.i586.deb
ibm-lotus-sametime-8.5.3.i586.deb
ibm-lotus-symphony-8.5.3.i586.deb

Install what you need with 'dpkg -i'. Here are dependencies for Lotus Notes packages so you can install whatever is needed.

$ apt-cache show ibm-lotus-notes
Package: ibm-lotus-notes
Status: install ok installed
Priority: extra
Section: IBM
Installed-Size: 681204
Maintainer: IBM Lotus Product <sw_support@us.ibm.com>
Architecture: i386
Version: 8.5.3-20110916.0921
Replaces: ibm-lotus-notes-fixpack
Depends: gdb, coreutils, unzip, bash, procps, grep, sed, libart-2.0-2, libasound2, libatk1.0-0, libbonobo2-0, libbonoboui2-0, libc6, libcupsys2, libfontconfig1, libfreetype6, libgcc1, libgconf2-4, libgtk2.0-0, libglib2.0-0, libgnome2-0, libgnomecanvas2-0, libgnome-desktop-2 | libgnome-desktop-2-7 | libgnome-desktop-2-11 | libgnome-desktop-2-17, libgnomeui-0, libgnomevfs2-0, libglib2.0-0, libice6, libjpeg62, liborbit2, libpam0g, libpango1.0-0, libpng12-0, libpopt0, libsm6, libstdc++6, libx11-6, libxcursor1, libxext6, libxft2, libxi6, libxkbfile1, libxml2, libxp6, libxrender1, libxss1, libxt6, libxtst6, libz1
Pre-Depends: libgnomeprint2.2-0, libgnomeprintui2.2-0
Recommends: ttf-xfree86-nonfree
Conflicts: ibm-lotus-notes-hotfix, ibm-lotus-notes-fixpack (<< 8.5.3)
You need extra fonts which are in non-free repository of Debian Unstable so you need to enable this if you want your Notes client to look like win32 one.

$ apt-get install ttf-xfree86-nonfree t1-xfree86-nonfree
We also need to get some additional libs which are specific to this release and to place them in /opt/ibm/lotus/notes directory.
 # wget http://www.benkevan.com/upload/lotus_notes/libgdk-x11-2.0.so.0
 # wget http://www.benkevan.com/upload/lotus_notes/libgdk_pixbuf-2.0.so.0
 # wget http://www.benkevan.com/upload/lotus_notes/libgdk_pixbuf_xlib-2.0.so.0
 # wget http://www.benkevan.com/upload/lotus_notes/libgtk-x11-2.0.so.0
 # mv *.so.0  /opt/ibm/lotus/notes
Start your Notes now and everything should be ok. If you have Notes installation on Windows you can transfer file desktop8.ndk (found somewhere in local user Notes directory) and place it in ~/lotus/notes/data/. When you start your Notes select Open -> Application -> Workspace.

Lotus Sametime chat client also works fine for me.

Monday, September 10, 2012

Kernel Message: INFO: task program:pid blocked for more than 120 seconds. [solved]

От известно време на една production машина взе да излизат подобни errors като този: 

[71521.708522] INFO: task apache2:12319 blocked for more than 120 seconds.
[71521.708567] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[71521.708612] apache2       D c10c5be2     0 12319   1564 0x00000000
[71521.708616]  f686f700 00200082 d2227c38 c10c5be2 d0684354 00000008 00000000 f6997019
[71521.708622]  010f9a20 c142ee80 f686f8bc c142a354 c10be7f4 f686f700 f686f8bc c142ee80
[71521.708628]  d726feac 00000000 00000000 00000000 f5636114 f686f700 f5636118 00000002
[71521.708633] Call Trace:
[71521.708640]  [<c10c5be2>] ? __d_lookup+0xa0/0xd4
[71521.708645]  [<c10be7f4>] ? do_lookup+0x49/0x112
[71521.708650]  [<c12738ee>] ? __mutex_lock_common+0xe7/0x138
[71521.708653]  [<c127394e>] ? __mutex_lock_slowpath+0xf/0x11
[71521.708656]  [<c12737a1>] ? mutex_lock+0x10/0x1d
[71521.708659]  [<c12737a1>] ? mutex_lock+0x10/0x1d
[71521.708663]  [<c10c1080>] ? do_filp_open+0x1da/0x7e3
[71521.708667]  [<c10aa3fc>] ? free_pages_and_swap_cache+0x43/0x50
[71521.708672]  [<c10c8515>] ? alloc_fd+0x4f/0xb1
[71521.708675]  [<c10b6804>] ? do_sys_open+0x49/0xdd
[71521.708678]  [<c10b68dc>] ? sys_open+0x1e/0x23
[71521.708682]  [<c10080db>] ? sysenter_do_call+0x12/0x28
[71521.708687]  [<c127007b>] ? native_cpu_up+0x1ea/0x594
[71521.708692] INFO: task php:14290 blocked for more than 120 seconds.
[71521.708735] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[71521.708780] php           D c10c5be2     0 14290  14289 0x00000000
[71521.708783]  f5a4d500 00000086 d2227c38 c10c5be2 d0604354 00000008 00000000 f6a43019
[71521.708789]  010fada7 c142ee80 f5a4d6bc c142a354 c10be7f4 f5a4d500 f5a4d6bc c142ee80
[71521.708795]  da11feac 00000000 00000000 00000000 f5636114 f5a4d500 f5636118 00000002
[71521.708800] Call Trace:
[71521.708803]  [<c10c5be2>] ? __d_lookup+0xa0/0xd4
[71521.708806]  [<c10be7f4>] ? do_lookup+0x49/0x112
[71521.708809]  [<c12738ee>] ? __mutex_lock_common+0xe7/0x138
[71521.708813]  [<c127394e>] ? __mutex_lock_slowpath+0xf/0x11
[71521.708816]  [<c12737a1>] ? mutex_lock+0x10/0x1d
[71521.708818]  [<c12737a1>] ? mutex_lock+0x10/0x1d
[71521.708822]  [<c10c1080>] ? do_filp_open+0x1da/0x7e3
[71521.708826]  [<c10c8515>] ? alloc_fd+0x4f/0xb1
[71521.708829]  [<c10b6804>] ? do_sys_open+0x49/0xdd
[71521.708832]  [<c1275ed6>] ? do_page_fault+0x2e7/0x2fd
[71521.708835]  [<c10b68dc>] ? sys_open+0x1e/0x23
[71521.708838]  [<c10080db>] ? sysenter_do_call+0x12/0x28

Машината буквално "увисва" за няколко минути. Оказа се че в crontab-a е сложен нов скрипт който изтрива някакви cache файлове.

Какво се оказа. Линукс ядрото кешира всичките дискови операции в паметта като когато се достигне определен процент от заетата RAM, дисковите операции се форсират да се запишат на хард диска. По подразниране в линукс ядрото при 40% от заетата рам се форсира записването им на хард диска, като записа става синхронно тоест всички останали процеси са блокирани за достъп към твърдия диск. От тук идва и проблема, машината е с 16 гигабайта RAM и 40% от 16gb не са никак малко. При достигането на 40% от паметта, форсираното записване продължава повече от 120 секунди (което е някакъв лимит за колко време може да отнеме тази операция) понеже диска не е толкова бърз за да запише всичко се изплюва тази грешка и като резултат машината е недостъпна известно време.

Процентното съотношение на може да се контролира през /etc/sysctl.conf:

vm.dirty_ratio = 7

или с команда:

sysctl vm.dirty_ratio=7

Това указва на ядрото кешираните IO операции да са не повече от 7% от общата RAM.


Saturday, October 15, 2011

Webkit-gtk on NetBSD 5.1/macppc additional notes (solved)

I've got response from bug report on webkit-gtk (pkg/45429) and here is solution for fixing compiling process on NetBSD/macppc. Create a file named hacks.mk in pkgsrc/www/webkit-gtk. Copy/paste the following and then do make clean; make.

# $NetBSD: hacks.mk,v 1.4 2010/11/02 07:54:31 wiz Exp $

.include "../../mk/compiler.mk"

### [Sun Nov 14 02:35:50 EST 2004 : jlam]
### On PowerPC, building with optimisation with GCC causes an "attempt
### to free unreference scalar".  Remove optimisation flags as a
### workaround until GCC is fixed.
###
.if !empty(CC_VERSION:Mgcc*) && !empty(MACHINE_PLATFORM:MNetBSD-*-powerpc)
PKG_HACKS+=             powerpc-codegen
BUILDLINK_TRANSFORM+=   rename:-O2:-O0
.endif