Aario's blog about life and technology

Uncategorized

How did I solve problem with headphone jack in debian?

I’m having an Eee PC 1015PX laptop which served me for 5 years now and I love it. Last time I reallised that headphone jack is not working in debian jessie.
As my headphone jack is dual purpose (headphone/microphone), pushing all volumes up in playback screen of alsa, purging pulseaudio, installing backports kernel none worked. Instead of playback screen of alsamixer I went to CAPTURE screen of alsamixer and there I selected internal microphone instead of headphone microphone! This release headphone jack as an output and fixed the problem!

Hope it helps πŸ˜‰


Is soviet union still around?

Soviet union a complex of communist member states consisting of most of North Asian and Eastern European countries collapsed on 1991. After that its member states including Russia and smaller eastern European and Asian countries called satellites exist as independent countries. For a lot of people whom suffered of inequalities, oppression, concentration camps, sever torture and inhuman imprisonment, etc. the idea of a totalitarian communist government was an catastrophe. In my opinion, it was a malfunction of civilization. An infectious disease of government part of a nation that can catch other nations by either forced occupation of those countries (Like occupation of eastern Europe countries by Russian red army), or by deceiving people or government of other countries about communist dream. In spite of the fact that its more than a decade of its collapse, symptoms of such disease still exists.

Infection
The idea starts by a revolution. People angry of inequalities shutdown their previous government (Kingdom, Dictatorship, etc) and demand a new rule. The leader of the revolution offer a new government with a communistic program. Because communism looks opposite to inequality. In order to establish communism, a huge government is needed to hold all nation asset from oil fields to the armchair you’re sitting on right now! The government then is supposed to divide these among people in an equal and efficient way. But the billion dollar question arises months after the revolution: What if supreme leader of the revolution and its government decide to betray people and to hold all this huge capital for themselves?

Symptoms and Side effects
Once the revolution dreams comes to reality people see themselves in dark days with depressed society and repressed economy. Where you cannot obtain anything and having any kind of income without previous permissions from the government. People close to government have the right to decide about destiny of other people. Working and earning money is much easier for them because they are exempted of lots of time consuming permit processes. Government is very powerful compared to poor people and thus will quickly execute every single dissident or at best, sends him to prison. Poor people under harsh psychological situation and with no or few access to different sources of news gradually believe in government ideas and notions. They will soon gather to watch executions in public and celebrate mass murders. They can become happy very simple and cheaply by just having the chance of buying one loaf of bread out of a long queue on dashboard of a government permitted bread distributing center!

Reaction
Considering themselves completely immobilized against the government that blocked all independent sources of news, have all the ways of income it its hands with a well equipped army and with nuclear weapons, people will start to flee the country. Who wants to waste his life in a poor country with a long list of anti-capitalist slogans? Soon government will start to pull a long wall around its boarders to prevent people exiting it. They will arrest and even execute people tried to exit the state. The socialism paradise!

Therapy
Any government or organization which try to involve in the situation must be ready for a nuclear response. Cost of trying to free slaved people is too much. Without modern means of delivering news to people from sources other than the communist government itself, its also impossible to shutdown the government by its own citizens considering that people are mostly hungry and have to spend 16 or more hours a day filling stomachs of themselves and their children. The only possible therapy looks waiting for the government to became poor enough because of inefficient complex communistic economic system and to consider collapse. This was what happened in union soviets.

Mutation
Even above treatment is not a permanent one. Soviet union still exists. The infection improved itself and fixed two of its most important flaws: Inefficient economy and Complex decision making system
Soviet is not a union anymore. But exists. It is mostly consisted of Russian Federation, Islamic Republic of Iran, North Korea and China. Of the named states Iran was not a member of former soviet union, but in the new mutated system, It is!
The communistic economy is replaced by oligarchic capitalism. Means government members and their family are free to have their private holdings while people does not. People in best situation can work for one of these holdings. Since there are private part in new soviet system, western governments will start dealing with them and even the country can became a member of world trade organization. But considering the fact that such firms can only be owned by a minority of permitted and trusted entities, people usually have no benefit of such economic growth. They stay poor and impoverished. Having kept oil wells and nuclear weapons, the government is safe and can rule almost infinitely.

And what about a wall around the state to prevent people escaping it? Like the wall of Berlin?
Leaving people to freely exit the country can first cause swarms of crowd escaping to western boarders like what was witnessed after fall of Berlin Wall. But soon western government will see such movement a threat to their economic and job making policies. They will establish harder and harder conditions to their visiting and working visas in order to avoid letting slaves of the new soviet system to escape the hell and to enter the west. I myself whenever tried to find a legal mean of migration faced prohibitive conditions like:
A amount balance in a local bank account in local currency equivallent to 10k to 20k US Dollar kept for at least three months: It is almost impossible for a citizen of a member state of the new soviet system (Iran in my case) with a highly unstable economy with very low salaries and high inflation rate to save and keep such amount of money in bank account. It takes decades for you to save such money that may look very easy to American citizen. One your saving reaches the required limit, inflation causes your currency to fall down and thus you need more money to gather and put in the bank account. It can also look ridiculous for a holder of a western passport like USA that such a condition even exists. But try to see embassy websites of first world countries in capital of soviet member states: for example search for “Australian Embassy in Tehran” to see what conditions an Iranian citizen must fulfill to have a chance of entering Australia. Not for a work and holiday visa (It doesn’t exists anymore at least for Iranians), but just a tourist visa to enter and maybe search for a job offer without work permission or even claim for asylum!
A work evidence letter with insurance paid and relevant to your field of study is also needed. Considering harsh labor market where your must change your job several times a year and you have to work in fields irrelevant to your qualification in order to survive, this one also looks impossible.
There are several other conditions as well. The main reason behind all of them is one thing: to avoid poor people bringing poverty with them! Just like if poverty is a virus or visiting soviet citizens can cause western countries to become soviet as well! But there are still ways for a young man like me to escape the corruption and inequality: Investment visas of poor eastern European countries struggling to became European Union member like Georgia and Hungary. Since these countries are in dire need of foreign investment, the will give you a work visa if you invest small amounts of money around 3000USD. Four weeks after I went to Georgia to apply for such visa, Iran government attempted to place bomb in front of Israel embassy in order to kill Israelis but failed. Such attempt caused the government of Georgia with now close relations to west to close its doors to Iran and to reject applications of citizens like me!
The next step was Bulgaria but the same thing happened there. Again bombing! Again rejection of visa requests. I also researched about Malaysia and Czech Republic but they don’t even let Iranians to open a bank account thus preventing them to establish a startup. Looks like the new wall is turned inside out! Instead of seldom issuing passports to soviet citizens, creating a situation that no single country will issue a visa to them.
Every human being some day opens his eyes and knows where he is from and what can be his destiny. And someone like me sees himself stuck in a dark world with no future. Currently I’m writing and posting this blog post on a 1Mbps frequently disconnecting Internet line while my ISP blocked access to WordPress and I’m using illegal anti-censorship software to bypass that!

See more:
http://en.wikipedia.org/wiki/Berlin_Wall
http://en.wikipedia.org/wiki/Soviet_Union
http://www.nytimes.com/2012/02/14/world/middleeast/israeli-embassy-officials-attacked-in-india-and-georgia.html?pagewanted=all&_r=0
http://en.wikipedia.org/wiki/Iran%E2%80%93Russia_relations


How to fix indexing issue of Magento

After solving previous problem of 404 error, the new error was indexing. The new products were not anywhere although I checked below check list I get here:

  • The products must be Visible in Catalog.
  • The products must be Enabled.
  • Product must have a stock Quantity.
  • The product must be set to In Stock.
  • If the product is set not to track stock, it still has to have a stock Quantity and be set to In Stock.
  • The product must be assigned to the target Category.
  • If using multi-website mode (or if you imported the products through Data Flow), the products must be assigned to the target Website.
  • You must refresh your Cache / Indices, just to make sure.

And whenever I went to Manage Indexing page I see all indexes are ongoing forever. The problem was my /tmp partition was full and so indexing failed. I emptied the full partition that cause the problem and to retrive indexing did:
cd <magento path>
rm /var/locks/*
cd shell
php -f indexer.php reindex all
It reindexed everything in a few seconds! Items will be on site map. If you want them to be on home page, then you need to add a code snippet to your home page which you can find here.


How to fix 404 errors of Magento?

I tried installing Magento on Debian Wheezy. After installing LAMP on debian, extracting magento to /var/www/magento subfolder (The main cause of problem I thing), chmod -R 777 this subfolder, installing magento from command line (Web based installation wizard didn’t work due to time-out error), accessing the admin module trough http://localhost/index.php/admin, all was set except all links on home page. They were all pointing to a 404 Not found page!
As I told my magento was installed in a sub-folder. Maybe the problem was because of that. I search everywhere and notices some people saying things about mod-rewirte. I also saw this page saying that they had two solutions to choose between and one of them was to enable mod-rewrite on the server! So here cuase me to ask myself: Did I forget to install something on my computer?
That brought me to here.
And from there I found the solution:
sudo a2enmod rewrite
Then:
sudo vi /etc/apache2/sites-available/default
Replaced every occurrence of “AllowOverride None” with “AllowOverride all”. Then:
sudo service apache2 restart
And it fixed the problem. Simply there were no mod_rewrite thingy on my computer so that Magento pages for any reason couldn’t be accessed from a subfolder installation.


Offline installation of Oxygen-Transparent widget engine on Kubuntu 11.10

Just installed the 11.10 version of Kubuntu and wondered to install the fancy Oxygen-Transparent widget engine on it in order to enable fully transparent windows there.

The project home page is here but does not contain much information. So:
I downloaded it’s Perl installer script from here.
I installed below packages as necessary dependencies:

  • git
  • build-essential
  • libxrender-dev
  • libphonon-dev
  • kdelibs5-dev
  • kde-workspace-dev

I was ready to install it by running it’s installer script in command line, but as I found that git is very slow and it takes ages to download all necessary files, I decided to find a way to install it offline.

Thus I downloaded the whole git archive as a .tar.gz file from here.

I extracted it using below command:

mkdir ~/Temp
cd ~/Temp
tar -xvzf /PATH/ TO/DOWNLOADED/FILE/oxygen-transparent-somerubishtext.tar.gz

Then I opened the downloaded perl script and searched below line in it to change it to:

Β Β Β  ###########################################
if( !$opt_no_git )
{

print( “— checking out source code\n” );
my $repository=”/data/aario-kubuntu-11.10-home/Temp/oxt/git“;

As you can see, the value in front of $repository is a path in my hard drive. It is where I extracted the downloaded .tar.gz file. So that this time, the git program which is used by the downloaded Perl script uses those extracted files instead of download site to get source code files. It is much faster!

Then all I did was to run below comands:

./oxygen-setup.pl
cd build
sudo make install

This was insallation. I wen to System settings and Application appearance and set oxygen transparent as my widget style. Clicked on Configure button and moved slider a bit to the left to adjust transparency. Also I set oxygen transparent as my window decoration in Workspace appearance. Now, here is my new fancy desktop:

Oxygen Transparent Widget engine on Kubuntu 11.10

Hope you enjoyed. Don’t forget to leave your comments;)

————————————————————————————————————

It’s the project homepage:
https://projects.kde.org/projects/playground/artwork/oxygen-transparent
It’s the project repository:
https://projects.kde.org/projects/playground/artwork/oxygen-transparent/repository
And if you click on the HTTP button in the repository site it will give you this DOWNLOAD link:
http://anongit.kde.org/oxygen-transparent/oxygen-transparent-latest.tar.gz


How to fix ubuntu 11.10 touch pad drag and drop issue

Well, this may bothered you as well. Upgraded to 11.10, and drag and drop using touch pad is not working any more!

The solution is to simply copy and paste below commands in your terminal:

synclient SingleTapTimeout=360
synclient FastTaps=1

Good luck! πŸ™‚


Internet Connection Sharing on Kubuntu 11.04

Guys, This is the easiest how to:

I have one DSL modem and some computers connected together trough a HUB Switch. One of the computers with some some IP address connects to Internet trough DSL modem. For some reasons it uses pppoeconf for configuring and using DSL connection. It’s connected to HUB Switch using eth0 as ethernet card and with some static IP address.

By the way, I downloaded a package called ipmasq which had been removed from Ubuntu 11.04 synaptic repositories from here. After installing it using GDebi and by double clicking on it and entering my password, I ran these commands:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward

apt-get install dnsmasq

/etc/init.d/dnsmasq restart

dpkg-reconfigure ipmasq

Here I selected default answer for all questions, except that in the last question told it to bring it up after all network services started. Then:

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
nano /etc/sysctl.conf

It opened some editor in terminal, and there I found a line like:

#net.ipv4.ip_forward=1

And removed the “#” sign at beginning of it to uncomment it. Saved the file with Ctrl+O and exited using Ctrl+X. Then simply rebooted my PC. After that, whenever this computer is connected to internet, others can connect as well using its IP as their DNS and Gateway address. Any question?

PS: And here is my desktop with Kubuntu 11.04


Eclipse SQl Explorer, Oracle 11g and Kubuntu 11.04

Hi Guys,
This is my long story about how I managed to connect my Kubuntu 11.04 to Oracle SQL to work with those tables in Oracle Database Server in our office. For accessing tables in the database and working with SQL queries, first I searched appdb.winehq.org to see whether TOAD is working on wine or not (As you may know, TOAD is a Tool for Oracle Advanced Database and Wine is a compatibility layer which enables Linux users run Windows applications). But I figured out that TOAD is not fully compatible with wine because all the scores there was gold or silver. Not platinium.
Then I decided to run Tora. An open-source alternative to TOAD. Tora for Kubuntu 11.04 won’t support Oracle. It’s only for mysql (And God knows how many hours I spend to try all ways of getting it to work with oracle but no success!).
Then I headed for SQL Explorer. But it needs several dependencies to run. As it needs oracle to connect to SQL databases, I downloaded these three packages:

  • oracle-instantclient11.2-basiclite-11.2.0.1.0-1.i386.rpm
  • oracle-instantclient11.2-devel-11.2.0.1.0-1.i386.rpm
  • oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.i386.rpm

For links, I searched the first name in google, and it took me to Oracle Client download page. In the opened page I searched names and I found links to download them. But downloading them was another story!
Oracle site asked me for accepting the term mentioned above of the download links page to be able to click on links themselves! Then it requested me a user name and password. Scince I do not have it, I tried to create one. It lead me to a form with several fields from my first name and last name to what my coligoues use to call me during launch in office! πŸ˜€ Unfurtunately some of combo lists in that form wasn’t compatible with linux. I mean in Firefox and Chromium I wan’t able to open them to select from. Thus I aksed the good guys in http://www.bugmenot.com to provide me a user name and password to download from http://www.oracle.com. Their first password worked just like a charm! πŸ˜€
After I went back to the oracle site I mentioned above and downloaded those three packages, I put them all in one folder (You say oracleclient), opened a terminal window and went to the folder and typed:

sudo su
apt-get install alien
alien -i oracle-instantclient11.2-*.rpm

It took a while for it to install them all. Then I ran:

apt-get install sun-java6-jre

Remember that the default-jre package which install open-source jre has problems with combo-boxes in SQLExplorer windows and that the program crashed several times with it for me. I prefered to install the sun proprietary version.
I downloaded SQL Explorer v3.6.1 from here. Then I extracted the downloaded the .tgz file to /opt/SQLExplorer. The folder which I created myself (You need to know how to create and extract into a system folder with root permissions).
The I just clicked and ran the sqlexplorer file in the extraction folder. And it started working.


For cunnecting to the database I clicked on Create new connection profil button on top left corner of work-space and it opened a new window.

In opened window I entered a name for the new connection. The combo-box there didn’t contain the work Oracle in it’s list. So to add the Oracle as a driver for this multi-purpose SQL software, I clicked on Add/Edit Drivers button. It opened a new window.
In the new window, on left column, I double clicked SQL Explorer and then JDBC Drivers under in. It opened a long list on right. For the first time, the work Oracle Thin Driver was with a x sign beffore it. So it was disabled. The only enabled option was JDBC ODBC Bridge. So I selected theΒ Oracle Thin Driver and clicked on Edit button. It opened a new window.
In the new window, I went to Extra Class Path tab. Clicked on Add Jars and from the opened dialoge I searched the path “/usr/lib/oracle/11.2/client/lib” for “ojdbc6.jar” file and opened it. Then clicked on List Drivers and after many seconds it filled the Drvier Class Name edit box automatically with “oracle.jdbc.OracleDriver” (Actually I don’t think you can enter this text by hand. You must find the driver files installed by the rpm packages I told you about and then it will automatically fill that box for you). Then I clicked on Ok. On the window opened in background the Item Oracle Thin Driver was now with a tick before it just like in screen shot. So I selected it and clicked Ok. Back in the first window, I selected the Oracle Thin Driver from the Driver combo-box and it filled the URL edit box automatically with:

jdbc:oracle:thin:@<server>:1521:<database_name>

I entered IP address of our Oracle Database server in office as <server>. I held the port to 1521. I entered the TNS Name for <database_name>. Selected Auto Login and Entered my user name and password. And Finally I clicked Ok.
In the Connections List on left column I could see my created connection. So I Opened it and after a while it connected to the database. Hiewwwwwwwwwwh!;)
That wasn’t as easy as this. Actually I tried several ways to get it work for many hours! here I’m just told you the final solution.

Have a nice day and don’t hesitate to tell me about your opinions and questions in comments:)


Problems contributing to the Linux

I’m an Electronic engineer. I did several embedded projects with hardware and software interworking. So, I am somehow experienced in programming. I also had several projects in Windows in Delphi language. As I became familiar with Linux, it was always one of my wishes to contribute in this huge project. I even wrote some open source projects myself. Which are stored in Sourceforge.net site (autoppp, blackwar and jalaliapplet).
Actually I have some problems contributing to already started projects. To describe you my problems, I bring here Blur effect in KDE as an example and If you know answers of my questions, please do not hesitate to leave me a comment how to solve my problems.
Recently I installed Kubuntu 11.04 with KDE 4.6 on my laptop. Blur effect is enabled on Panel as is working there without any problem. But the problem is that transparent windows are not blurred. The scenario is always like this:

  • I searched Internet forums to find a solution for this problem. No joy.
  • I searched bug reports to find a solution for this problem. No joy.
  • I now want to go to KDE website to find out how can I contribute to this project because I want to solve this problem myself. Regardless of long texts about how to pay donations or introducing KDE to friends(!), It’s a little hard to find how to start developing the code.

I want to know:

  1. Which source codes I must download to solve my problem with blue effect as I described above. How can I find which source file or which group of source files I must work on?
  2. Which packages I need to download and Install to be able to compile the sources I downloaded?
  3. After compiling the source code how can I installed the compiled code on my system?
  4. How can I uninstall it to bring my system back to the previously installed KED?
  5. What is SVN?

Thanks a lot people:)


How to install ATI Catalyst Driver 11.6 on Ubuntu Linux 11.04 Natty Narwal

Finally I installed ati catalyst 11.6 on my Ubuntu 11.04. I just want to tell you how to install this thingy. Because it’s very tricky!
First of all, spend several days to download it! Because every time I tried the link seemed to be broken and suddenly it worked and I was able to download it with my firefox browser.

They I copied it into my root home folder /root.After that, I used commands below to install it:

sudo su
cd ~
apt-get install debhelper devscripts execstack dh-modaliases
chmod +x ./ati-driver-installer-11-6-x86.x86_64.run
./ati-driver-installer-11-6-x86.x86_64.run
…………………………………………………….
Do you agree with the license? [Y/n] Y
Please enter the installation path [/] (Just hit enter here)
Option: ‘RedHat Packages’ ? [Y/n] n
Option: ‘SuSE Packages’ ? [N/y] N
Option: ‘Build package for detected OS: Ubuntu/natty’ ? [N/y] y

dpkg -i *.deb

That was all. Remember that I spend several minutes running the installer, answering questions, seeing it’s error message, reading it’s log file, understanding that some command is not found, finding related package, installing it using apt-get, and running the installer again and again! What can I say to AMD developers? :-w