Fedora

Add custom icon launcher in Gnome Desktop Application menu

12 Jul , 2013  

I use Fedora 19 at this example. To add custom icon launcher in Gnome Menu, simply by creating a new file “*.desktop” inside “/usr/share/applications”.

We can try with adding SublimeText 2 into Gnome Menu by:

1
sudo vim /usr/share/applications/sublime-text-2.desktop

And now we can put the contents:

1
2
3
4
5
6
7
8
9
[Desktop Entry]
Name=Sublime Text 2
Comment=Edit text files
Exec=/your-path/SublimeText2/sublime_text
Icon=/your-path/SublimeText2/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;

,

Fedora

PhpMyadmin Virtualhost on NGINX Fedora 19

11 Jul , 2013  

Here is quick step to set http://localhost/phpmyadmin in Fedora 19 with NGINX. First, make sure we’re already have PhpMyadmin and NGINX installed. Then, we just need to append “/phpmyadmin” configuration inside our localhost.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
server {
        ....

        location /phpmyadmin/ {
            index index.php index.html index.htm;

            location ~ .php$ {
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index   index.php;
                fastcgi_param   SCRIPT_FILENAME /usr/share/nginx/html/$uri;
                include     fastcgi_params;
            }
        }
...
}

Then for correcting PhpMyadmin path:

1
sudo ln -s /usr/share/phpMyAdmin /usr/share/nginx/html/phpmyadmin

Voila! That’s it!

,

Fedora

Fedora 19 Installation

8 Jul , 2013  

Here is how to full installation step to setup and configure Fedora 19 for development. FYI, I use macbook pro on this installation.

1. Fix Fedora 19 Broadcom Wireless
We need to download rpmfusion and install klmod to make wireless working on Fedora 19.

1
su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'

After installing rpmfusion, now we’re ready to install wireless driver

1
sudo yum install kmod-wl-`uname -r`

You need to reboot to make your wireless working.

2. Setup development environment
Here is list software that needed to build development environment in Fedora 19.

1
sudo yum install make automake gcc gcc-c++ libxslt libxslt-devel libxml2 libxml2-devel libffi libffi-devel libcurl libcurl-devel openssl-devel sqlite-devel libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686 libxslt-devel nmap ImageMagick git yakuake shutter vlc libreoffice k3b kdepim mysql mysql-server mysql-devel nginx php php-fpm php-common phpmyadmin httpd fuse-exfat gimp inkscape alacarte wget vim lsb kernel-devel libpng-devel libXtst-devel

More…

,

Fedora

Configure Phpmyadmin in NGINX to combine with NODEJS or another non-php applications

21 Sep , 2012  

Configuring Phpmyadmin to be able working with another non-PHP applications is a little bit tricky. For instance, you have NODEJS application running in NGINX with root (“/”). When you’re opening http://yourdomain.com, then it will running NODEJS applications. Then, you want to make this domain have “/phpmyadmin” which it will running phpmyadmin. At this steps, you should handle this path from NGINX and pass it into PHP-FASTCGI.

This is example NGINX Configuration:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
server {
    listen 80;
    server_name yourdomain.com;

    location ~ ^/(js/|stylesheets/|images/|img) {
        root /mypath/public;
        access_log off;
        expires max;
    }

    location / {
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
       
        # proxy_http_version 1.1;
        proxy_pass http://127.0.0.1:3000;
    }
}

More…

Fedora

Solving Alacarte can’t open gi._glib.GError: Error opening file: No such file or director in Fedora

19 Sep , 2012  

I see a lot of people have problem with alacarte but seems nobody know how to fix it quickly.
When you run “alacarte” from your command line, you will see :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Traceback (most recent call last):
  File "/usr/bin/alacarte", line 36, in <module>
    main()
  File "/usr/bin/alacarte", line 33, in main
    app.run()
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 64, in run
    self.loadMenus()
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 203, in loadMenus
    self.on_menu_tree_cursor_changed(menu_tree)
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 354, in on_menu_tree_cursor_changed
    self.loadItems(self.menu_store[menu_path][2], menu_path)
  File "/usr/lib/python2.7/site-packages/Alacarte/MainWindow.py", line 218, in loadItems
    icon = util.getIcon(item)
  File "/usr/lib/python2.7/site-packages/Alacarte/util.py", line 151, in getIcon
    pixbuf = info.load_icon()
  File "/usr/lib64/python2.7/site-packages/gi/types.py", line 43, in function
    return info.invoke(*args, **kwargs)
gi._glib.GError: Error opening file: No such file or directory

When, this problem occured because “ONE of your desktop application can’t find icon that has been referenced before”. Why this happen? Seems you’re deleting your applications and Alacarte won’t start because it’s can’t find your applications.

How to fix it? It’s simple! all of your Alacarte app-made located in

1
~/.local/share/applications

You will see alacarte desktop like:

1
2
3
alacarte-made-1.desktop
alacarte-made-2.desktop
alacarte-made-3.desktop

Just open this files and see which one that have applications deleted / inaccessible / wrong path.
You can remove them or edit into correct path.

Soon after you fix it, then you can start your “alacarte” again 🙂

,

Fedora

Install Fedora 17 in Mac OSX with Macbook Pro

25 Aug , 2012  

1. Setup Wireless Driver Broadcom
By default, Fedora will not detect your Wireless. You need to install broadcom-wl from rpmfusion by :

1
2
3
su -c 'rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'
sudo yum update
sudo yum install broadcom-wl

For manual download because you don’t have internet access :
http://download1.rpmfusion.org/nonfree/fedora/releases/17/Everything/

2. Install Development Packages

1
2
3
sudo yum install make automake gcc gcc-c++ libxslt libxslt-devel libxml2 libxml2-devel libffi libffi-devel libcurl libcurl-devel openssl-devel sqlite-devel libXv.i686 libXScrnSaver.i686 qt.i686 qt-x11.i686 libxslt-devel
sudo yum install postgresql-server postgresql-develnmap ImageMagick git
sudo yum install yakuake shutter vlc libreoffice

3. Setup LAMPP

1
sudo yum install mysql mysql-server mysql-devel nginx php php-fpm php-common phpmyadmin apache

run “sudo mysql_secure_installation” if you don’t want root with blank password.

1
2
3
4
sudo systemctl start httpd.service
sudo systemctl enable httpd.service
sudo systemctl start mysqld.service
sudo systemctl enable mysqld.service

For PhpMyadmin configuration is located in : “/etc/phpMyAdmin/config.inc.php”.
To make Phpmyadmin work without password, change this line :

1
$cfg['Servers'][$i]['AllowRoot']     = TRUE;        // whether to allow root login

And don’t forget to reload your webserver.

4. Skype 2.2
I love to use old Skype. You can download from http://repo.fedora.md/3rdparty/.

5. NodeJS and Redis
NodeJS and Redis is a must in software development, so we can install this both great software by :

1
2
3
4
5
sudo yum localinstall --nogpgcheck http://nodejs.tchol.org/repocfg/fedora/nodejs-stable-release.noarch.rpm
sudo yum install nodejs-compat-symlinks npm
sudo yum install redis
sudo systemctl start redis.service
sudo systemctl enable redis.service

More…

,

Fedora

Enable / Disable MySQL, Apache, Redis and other services at startup in Fedora 17

23 Aug , 2012  

To enable MySQL, Apache, Redis or other services running at boot startup, you can use this simple command :

1
2
sudo systemctl enable redis.service
sudo systemctl enable httpd.service

To disable :

1
2
sudo systemctl disable redis.service
sudo systemctl disable httpd.service

, ,

Fedora

Setup Synergy Server and Client Multiple Screen in Fedora Core 17

23 Aug , 2012  

Working with 2 laptops and have to connected between each other is important in my daily activities. I have two Fedora laptop here (Macbook Pro + Dell) and get connected seamlessly with synergy. Here are to setup :

1. Install synergy
In both computer, please install synergy by :

1
sudo yum install synergy

2. Hostname
Make sure both computer have difference hostname. To change hostname in Fedora :

1
sudo vim /etc/sysconfig/network

Edit HOSTNAME into different value and don’t forget to restart the network service by:

1
sudo service network restart

3. Setup Server
In server which have hostname “trip” and client hostname “fedora”, I create configuration in “/etc/synergy.conf”:

1
2
3
4
5
6
7
8
9
10
11
section: screens
    trip:
    fedora:
end

section: links
    trip:
       left = fedora  
    fedora:
       right = trip
end

Run this server by :

1
synergys -f --config /etc/synergy.conf

4. Client
We need to add server hostname into our client “/etc/hosts”. For example, server IP is 192.168.1.3 :

1
192.168.1.2 trip

Then we can connect to server by :

1
synergyc -f trip

Now you ready to working with different laptop and different OS if you want 🙂

,

Fedora

Downgrade from Sun Java 7 into Java 6 in Fedora Core 17

22 Aug , 2012  

Sometimes we have some software that buggy in Sun Java JRE / JDK 7. Then it comes to us to downgrade into 6 Version. Well, isn’t difficult. All you need to do is following this step.

1. Download Oracle Sun Java JRE / JDK 6
Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html and download RPM BIN version.

2. Uninstall existing JDK / JRE 7

1
sudo yum remove jdk jre

3. Install
Execute download files by “./” and you can install extracted RPM by :

1
sudo rpm -Uvh jre-6u34-linux-amd64.rpm

4. Register your Java 6 and set as primary

1
2
3
sudo alternatives --config java
sudo alternatives --install /usr/bin/java java /usr/java/jre1.6.0_34/bin/java 2
sudo alternatives --config java

Now you can use Java 6 for your development in Fedora 🙂

,