Category: Hacking

Computer, technical and life hacks!

PCMCIA Fedora Core 2 problem fixed!

PCMCIA Fedora Core 2 problem fixed!

(this article has moved here)

Yesterday I upgraded the Fedora on the notebook (Acer TM 202). The new linux kernel was 2.6.6. Surpsingly, after the reboot PCMCIA networking stopped. There was an error about eth0 not being present (because PCMCIA was loaded after the networking), and that’s it – it was not getting online after loadig of the PCMCIA.

Before (in Core 1) the behavior was the same, but after PCMCIA loading it was somehow working – it seems it was detecting/raising the eth0! Now it was refusing to do so. And I had to look for another solution.

I checked the Google – nothing special :(. Similar problems, lots of results (more than 5000), but no straight solution for my problem (logically: Fedora Core 2 was only 5 days old).

I started to solve the problem manually, and after:

rmmod 3c509_cs
rmmod ds
/etc/init.d/pcmcia restart

it went fine! HELL! It seemed that the eth0 failure (when PCMCIA driver was not yet present) was locking something, which ruined the success of any future network driver loading.

I decided to ask LUG-Bulgaria. After one hour maximum I received a valuable answer from Peter Georgiev, who told me to switch the PCMCIA loading priority from 24 (current) to 9 (higher than the networking). His precise instructions were:

  1. Open /etc/init.d/pcmcia
  2. Change the line
    # chkconfig: 2345 24 96

    to

    # chkconfig: 2345 09 96

    Yes, it’s in a comment, but it seems it has meaning to the chkconfig command (see below).

  3. Execute
    chkconfig --level 2345 pcmcia reset

After these changes, PCMCIA executes before my network, and all works.

I am still wondering if that solution is correct. Maybe we just killed the resulting symptom, not the real problem, but it works for now. I do not hear the standart “beep beep” when my PCMCIA gets up, and I do not hear it when I remove/insert a card. But I can live with that.

Please, if someone reads this, and if this someone has another explanation of my problem – I will be really curious to hear it. It seems that the problem is somewhere in the newer kernel modules, but… I am yet too lame to find and resolve it. I miss the old way, but the newer kernel is more important than it.

Which file to which RPM belongs…

Which file to which RPM belongs…

Today Alexander Shopov was giving me some help because of a very severe problem I had here. The problem (already solved by magic – we did not noticed what exactly solved it) was that

rpm -qi kernel

was showing two kernel packages installed, but when I try to remove the older one, it was reporting that the package was not (?) installed. However, as I said – the problem was solved magically – after many tries, the last “rpm -e” command strangeously why succeeded.
However, this article is not about this. It’s about some nice rpm query commands that I want to remember. And the best way to remember them is to store them here :).
The first command to remember is:

rpm -qi <package name>

This command gives you valuable information about all installed package’s versions. If this this information is too much for you, and if you need the real package(s) names, in the way they should be given in probable “rpm -e” command, then you should use the second command to remember:

rpm -qa <package name>

This command enlists all packages with thie name (and their different versions). You may use the output as source of the “rpm -e” command later.
And during Alexander’s help, I learned the third command (mini-script) to remember:

for i in*; do echo -n "$i :: " && rpm -qf $i; done

If you run this mini script in given directory, it will list each file from that directory and the rpm, to which this file eventually belongs to. If the file does not belong to any rpm – you will have the corresponding message about it. Very useful thing indeed!
I would like to thank again to Alexander for all his time! I learned valuable things, and he also helped me (though I did not understood how finally it worked) to overcome my problem!

Running scheduled tasks

Running scheduled tasks

This article should continue my Linux lame articles, which I post here. I am starting to think to rename the “Hacking” category to “Lamer” :). Maybe later…

Today I had another Linux-newbie problem to solve. It’s simple, it’s newbie, and although I’m Linux user since 1994, I never had need to sove similar problems, or I never wrote my experience about such. So now I decided to write it here, and when I need it again after 5 years, I will just consult my blog ;).

The problem: I had to force SIM to erase some history files regularly. Usually, people just redirect the needed history file(s) to /dev/null, but strangeously why, my SIM-ICQ 0.9.3 was not able to accept such solution (**really** weird things started to happen with all accounts, which had their history files as links to /dev/null, so I quit trying that solution).
I had to create a script, and make it run each day on the morning. I wanted even more – I wanted cron to force all scripts, placed in given directory, to run at given time.
The really **big problem** was the fact that I was lazy to read! I wanted to solution right now in my hands, so I had to ask Veselin Kolev, one of the Linux gurus, for help. I know it’s a shame to waste experienced people time like that, but again, I was lazy to read, and Veso was online :).
He told me in few lines the solution. And here it is:

  1. First, I had to create the folder in my home directory. I chosed the name “.cron”, because it was looking nice to me, and it’s a hidden folder – it would not bother me when browsing my home with Konqueror;
  2. Now it was turn to make the script. So I did, I placed the script in that folder.
  3. Now it was time for root access. I modified /etc/crontab – I added the following line to it:
    # `doncho` scripts
    00 6 * * * doncho run-parts /home/doncho/.cron >> /dev/null 2>&1
  4. Now, all the scripts from directory “/home/doncho/.cron” will run each day at 6:00 AM.

During our conversation, Veso explained me how to use the “at” command for tasks, which I need to run once at given scheduled time. His brief explanations were:

  1. You create a script, and place it somewhere. Example – the following script (named ~/download), which downloads some site at some dir:
    #!/bin/bash
    wget --directory-prefix=/home/doncho/dobwload http://nana_download_server
  2. Now we must schedule the execution using the “at” command:
    at -f ~/download 23:00 05182004
  3. This script will run on May 18th 2004 at 23:00
  4. If the computer was switched off at that time, the script will run as soon as the computer gets up later, i.e. it would not be forgotten if the computer was offline when that time comes.

That’s all for today :). I hope you did not get too bored :).

How to create shared space on a Linux machine (for idiots)

How to create shared space on a Linux machine (for idiots)

My system: Fedora Core 2
A few days ago I was infront of a trivial problem, which I never solved before. I had to create some shared space (without quotas or other fancy stuff) on my Linux partition. I needed any user, who belongs to given group, to be able to have full control to that space.
I started with creating group ‘users’ and adding the needed users to it. After that (as root) I created the folder ‘/home/SHARED’, and I

chown -R root:users /home/shared

After that I logged on with another user (who belongs to ‘users’) and – whoops – it was not working. Permission denied. I double-checked the permissions, but all seemed correct.
I got mad. I though I *knew* these things – it should not happen like that. Maybe my madness stopped me from finding the solution of the problem right now, but I tried tons of stuff/experiments – and nothing! The other user could not write to that shared place! I got completely mad! If you would like to know how mad I was, just have in mind that I had crazy thoughts digging through the source of chown or chmod commands in order to understand how the permissions work :(. Fortunately, I did not started with that – I just went to bed. Before that I switched off the machine.
This morning – suprisingly, it worked! I still do not uderstand how and why (the hell) it needed that restart – maybe you could help me? But I was lucky – my friend Nikola Antonov was online, and I asked him that question. He supposed that the yesterday’s user should be logged off/logged on in order new permissions to be taken into account? I still do not believe that.
The fact is that now the shared space works fine. There was just one small problem, which Nikola showed me how to remove (and that’s why I decided to share in English my experience with you). The problem was that though it was shared space, if user A creates a folder, user B (both A and B are in ‘users’ group) cannot delete that folder if it’s not empty. If it’s empty – all works. That was because when creating the folder by A, the newly created object gets owner A:A, and not A:users. Invoking the command

chmod -R g+s

solved that problem too – now when whoever creates an object there, this object has as owner :users, which makes it fully accessible by all others.

Excellent Filesystems’ Benchmark

Excellent Filesystems’ Benchmark

Today Nikolai I. has sent to me this excellent article, which covers complete Linux filesystems’ benchmark.
I post it here for two main reasons:
1) To have it stored for the future (I decided to post all such useful material here)
2) To all my friends, who take care reading my blog aware of it.
The general quote, which this article leads to, is: do not use ext3 filesystem. Ouch, this is my filesystem at home :(. It seems I must change it soon!

Installing Rhythmbox on my Fedora

Installing Rhythmbox on my Fedora

Today, enspied by a posting in Peio’s blog (in Bulgarian) I decided to install Rhythmbox on my Fedora.
I want to mention here the problems, which I’ve gone through. Just

yum install rhythmbox

does not solve the case. I got really mad when having no MP3 files support. Actually, I became mad because I unable to understand for a long time that this was my problem when trying to open any MP3 file. I was getting this crazy message:

failed to create mad element; check your installation

when trying to open an MP3. I suspected the MP3 problem when I saw that my OGG files ran fine.
So, after some Google search, I found this great article, which showed me the exit of the tunnel.
In brief – if you want Rhythmbox and MP3 support, you should do:

yum install gstreamer-plugins-mp3 rhythmbox

Have fun!

Софт-новината на месеца?

Софт-новината на месеца?

Днес с голямо учудване разбрах, че Microsoft пускат за безплатно сваляне и използване (не като свободни, а само като безплатни!) своите основни продукти за С++ разработка. Тази ми посочи Ники И., още след като влязох сутринта в стаята.
Още не е минал и час, откакто научих това. Тепърва ще мисля дали това е добре за света или не :). Но засега мнението ми е (както винаги) противоречиво:

  • (+) : най-накрая истинските средства за разработка стават достъпни до всеки програмист, без да има нужда да купува продукт за $500. Това определено още повече ще задвижи създаването на добри програми за Windows. И на свободни такива също!
  • (+) : с този ход Microsoft показва нещо, което винаги съм защитавал. А то е – основните среди за разработка под всяка ОС трябва да са свободни. Е, засега Visual C++ Toolkint е само безплатен, но и това е нещо.
  • (-) : чисто идеологически, не ми харесва фактът че продуктът е само безплатен. Мисля, че Microsoft само щяха да спечелят, ако наистина го бяха пуснали под някой свободен лиценз! Но… мисленето бавно се променя. (+) обаче е, че все пак се променя!
  • (?) : още не сме прегледали EULA-то. Дано да е читаво. Засега обаче ще повярвам на следните Q/A: “Are there any restrictions on how I use the Visual C++ Toolkit?
    In general, no. You may use the Toolkit to build C++ -based applications, and you may redistribute those applications. Please read the End User License Agreement (EULA), included with the Toolkit, for complete details. “

Бъдещето е пред нас. За мен, като човек вадещ си хлябът от писане на софтуер, тази новина е добра. Може би е добра и за всички поддръжници на качественият софтуер. Както и за Open Source обществата. Дано да съм прав…

Търся си CMS…

Търся си CMS…

Дончо.Нет вече остаря!
И като технология (plain HTML), и като неща, които има вътре. Там нищо не се случва! Поради това реших да си сменя сайтът и да сложа някакъв CMS – да ми е лесно да пиша нещица и да го допълвам. Да, ама това се оказва нелесна работа – повечето CMS-и изискват специален достъп до хостинга, а аз не искам да тормозя Никола и за това!
Засега съм се спрял на TikiWiki. Инсталира се и работи без “специалните” изисквания. Да, ама и с него имам ЯД! Понякога в Mozillа или Firebird не показва страницата както трябва – омазани са стиловете нещо. Имам ОГРОМНА лява колона и съдържанието се изгубва някъде вдясно :(. Ще трябва да търся начин да оправям това, но пък тогава остава проблемът, че не съм особено добър в тези неща!
Друг проблем е, че искам да имам и английски, и български вариан на някои материали. И сега трябва да ги правя като отделни материали – няма как да ги свържа. Но това е по-малкият проблем – по-големият са стиловете…
Ако на някой му се експериментира – може да пробва тук. Но имайте впредвид, че още ръчкам! Засега само преработвам някой и друг материал – крайният вид е още далече!

Почивни дни

Почивни дни

Днес, след много, много седмици със “задачи”, видящи ми в органайзерът, най-накрая видях 3 почивни дни без нито една задачка! Ама нито една. Ей на това аз му викам късмет.
Тези дни ще се чудя какво да правя – така ми липсваше това състояние! Може би ще си изпека още няколко цикъла на “Приятели” (сега констатирах, че от небрежно носене в чантата 2 от дисковете имат грешки, което е голяма гадост – ще ги презаписвам), може би ще си инсталирам някоя нова игра на Бозата, ще си играем с Ангел, ще се опитам да угаждам нещо на жената, ще се видя с приятели от Пловдив на кафе и бира (99.9% ще си говорим за работа, ама нейсе) – абе, почивни дни в истинският смисъл!
Липсват задачи! Така липсват, че чак започвам да се притеснявам! Параноята ли ме мъчи!? Сигурно, щом липсват, ще се случи нещо лошо? Нещо, което ще ми запълни всичките 3 мои си почивни дни? Сигурно Бозата ще се скапе – и без това е на повече от година и се клати като на 80-годишна баба зъбите 🙁 ! И като се скапе – ще се скараме с жената, защото аз смятам да слагам Федора (до тук с угаждането). Ангел сигурно (пак) ще извади някой клавиш на ноутбука, и отиде 1 час да го нагласям обратно? Дали приятелите ще имат време за мен!? Аууу, здрава параноя.
Я да натискам Publish и да лягам обратно!!

Инциативата “Шльокавица”

Инциативата “Шльокавица”

Искам да обявя за всички вас, които не четат редовно блогът на Йовко, че се присъединявам и аз към поетата от него Инициатива “Шльокавица”. Крайно време е нещо да се направи по въпросът за шльокавицата, от която ми е дошло не до гуша, ами до… айде да не казвам!
Присъединете се и вие. Очакваме скоро повече информация!

Theme: Overlay by Kaira Extra Text