Aario's blog about life and technology

Latest

Move a magento server – Why my magento server redirects me to localhost?

In my case I installed a magento on my localhost on /var/www/magento to be accessible trough 127.0.0.1/magento.

After a while I just decided to access my site from another computer on my local network. So this time I entered 192.168.1.4/magento (IP of my first computer with magento installed locally). It quickly redirected me to localhost/magento!

To fix that I entered the database on my first computer and entered:

update core_config_data set value=’http://192.168.1.4/magento/’ where value=’http://localhost/magento/’;

Remember two things:

  1. The new address must end with a slash character ‘/’ or you gonna see an ugly white theme on your site!
  2. If you are moving your magento to a new server with completely different configuration, you need to open your <magento installation path>/app/etc/local.xml file and edit the <connection> tag to modify database connection settings (i.e. username, password).

Hope it helps!

Solved Debian Wheezy wlan “deauthenticating by local choice” error

Living in Iran with an Islamic regime who follows former soviet union strategies in almost all sort of policies, access to ADSL internet is a rare and time consuming process and in some regions of the country is almost impossible! It’s one year since I moved to my new apartment an I still don’t have ADSL access. Last week decided to sue the manager of local public communication bureau of not letting people of the republic have access to ADSL internet! But in the last minute, they said we have one ADSL coupon freed today. Do you want to use it to subscribe for your home Internet?!

They’re supposed to connect my internet within a week but meanwhile I decided to clean-up my ADSL modem after a year and to connect my laptop WLAN to it and I faced:

[ 1005.872116] wlan0: no IPv6 routers present

And after a while:

[ 1049.628263] wlan0: deauthenticating from 54:e6:fc:a5:74:49 by local choice (reason=3)

The kde network manager icon shows “Setting network address…” for a while and then it just disconnects. Searched trough internet using my expensive and slow 3G mobile network for a while. Skipped all weblog posts which are globally censored by the government, and in here found that the solution is to:

open /etc/default/grub as root and in an editor. i.e. in KDE:

Press Alt+F2
Run kdesu kate /etc/default/grub

in opened text file replace below:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet”

With below:

GRUB_CMDLINE_LINUX_DEFAULT=”ipv6.disable=1 quiet”

Then run in command line:

sudo update-grub

And then reboot your system. It will update the grub boot loader with a new option to disable ipv6 on boot. As far as I investigated, there’s a bug inside software bundled with debian wheezy which makes dhcp client slow on wifi when ipv6 is not present on modem/router. So dhcp connection times out and wifi disconnects by “local choice”. You can increase this time limit or simply disable ipv6 as I described above and it should solve the problem.

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.

Going to space without a rocket

Whenever I hear the word “space”, the first thing I imagine is a dark sky with lots of stars, the second thing is a huge rocket! But this is not the only vision of space.
Rockets are not the only mean to go to space. They are actually very expensive and dangerous. Previously we used to use rockets mostly because of lake of technology to invent and use alternative ways. But nowadays we have lots of proposals for alternative ways of launching spacecrafts up to sky. From space elevators[1] lifting payloads to 100km altitude using carbon nanotube tethers to space guns [2] shooting objects. From magnetic trains to speed up spacecrafts up to 11km/s speed called star-tram [3], to magnetic loops suspended right in the sky [4].
The last two are 100% feasible with current technology. Their very first benefits compared to rocketry are the chipper price of launch and safer design. While minimum prices to launch a payload to space using current rocket technology is around 4000USD per kilogram [5], cost of electrical energy that a star-tram uses to do the same is estimated as low as 1 USD [6].
The reason behind the fact that we are still on this rocky planet is that current ticket price to go to space is so much expensive. The first step to move our society into the border less world of outer space is to lower this price. But the reason that we still don’t have such alternative systems like space elevator is that while its considerably chipper to launch space crafts using them, they need huge amounts of investment to construct. An investor will surely ask while one can achieve a good interest by investing in IT services like social networks, why one would put all his eggs in basket of such a risky industry of space? What is the benefit out there?
This is the billion dollar question of the century: If we build a star-tram or any of inexpensive launch systems, and thus move a huge facility out to space, what can we do up there to cover all expenditures in between and make a huge benefit impossible with current businesses?
Space Frontier’s New Space annual conference [7] got a “Business plan Competition” [8] where they give tens of thousands of dollars to a winning sound business plan. Think about it.
References:

[1] The Space Elevator Reference

http://spaceelevator.com/

[2] Quicklaunch Inc – Affordable Space Exploration

http://quicklaunchinc.com/

[3] The Startram Project

http://www.startram.com/

[4] Magnetic Suspended AB-Structures and Motionless Space Stations

http://cedb.asce.org/cgi/WWWdisplay.cgi?273293

[5] Space Transportation Costs: Trends in Price Per Pound to Orbit 1990-2000

http://www.futron.com/upload/wysiwyg/Resources/Whitepapers/Space_Transportation_Costs_Trends_0902.pdf

[6] StarTram: The Key to a Robust, Low Cost Earth/Lunar Transport System

http://www.spaceagepub.com/pdfs/Powell_2.pdf

[7] NewSpace 2012 Space Conference

http://newspace.spacefrontier.org/

[8] NewSpace Business Plan Competition

http://newspacebpc.com/

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! :D 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! :D
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:)

Follow

Get every new post delivered to your Inbox.