Opencart SEO url in Nginx sample

Here is my sample URL rewriting definition for opencart SEO links that I hope to be useful on other developers running in NGINX. Notice that I have /opencart/ as the path of my opencart installation.

HTH

    location /opencart/ {
        try_files $uri @opencart;
    }

    location @opencart {
        rewrite ^/(.+)$ /opencart/index.php?_route_=$1 last;
    }

    location /opencart/admin/ {
        index index.php;
    }

    location ~* (\.(tpl|ini))$ {
    deny all;
    }

Starting a New Project in wxPython

I’m starting a new project now. This time instead of pyGtk, i’m switching to wxPython, i’m giving a go on this as i’m getting bored on doing something on pyGtk.  Here I will post the development on the project.

This is a POS project that will be based on SqlSoup, Sqlite and wxPython.  I will post a github link later.

See you then everyone. Thanks.

.NET ComboBox Value Assignment notes

Recently i’ve encountered issue on assigning a value on ComboBox.   I’ve propagated the combobox value on the collection and I was assuming that everything will work as it is.

this.cboAvailableOnlyTallyTH.Text = this_particular_string; //this one is not working

this.cboAvailableOnlyTallyTH.SelectedText = this_particular_string; //this one is also not working

this.cboAvailableOnlyTallyTH.SelectedValue = this_particular_string; //this one is also not working

So frustrating that i’m really wondering why the value wont be assigned as i’m expecting. Later i realised that there are some extra spaces on the values which the string wont match.  I’ve finally fixed the issue by using the assignment statement .

this.cboAvailableOnlyTallyTH.SelectedIndex = this.cboAvailableOnlyTallyTH.FindString(this_particular_string;

 

 

 

 

 

Error code 9009 due to Missing ResGen.exe

I have this error :
When compiling a certain Asterisk.net.dll program, the error is showing :

The command “C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\ResGen.exe” “C:\Users\jojo\Desktop\project\Asterisk.NET.1.6.3.1\Asterisk.NET.Test\fastagi-mapping.resx” fastagi-mapping.resources” exited with code 9009. Asterisk.NET.Test

I’m using MS Visual Studio 2008, and please note that the location of Resgen now is in : C:\Program Files\Microsoft SDKs\Windows\v6.0A\

So changing the “C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin\ResGen.exe”

to “@”%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bin\ResGen.exe”. fixes it.

HP Compaq PC that uses Intel 82566DM network problem in Linux

The problem of this pc is upon installation of Centos 5.7, the network is up but if you ping the other pc its just saying “Destination unreachable”.

The fix for this problem is this:

 

1) Download the  http://sourceforge.net/projects/e1000/ driver from that site. Note the e1000 not e100, this is gigabit..

2) tar xfz e1000-<x.x.x>.tar.gz

3) cd e1000-<x.x.x>/src/

4) make install

5) modprobe e1000

 

After doing the the #5, do the command service network restart in the CLI.

HTH

 

Tamir.SharpSSH, C# and some linux shell command

I’ve found some interesting .NET class for accessing the linux server via SSH tunnel on this site – http://www.tamirgal.com/blog/page/SharpSSH.aspx. I’ve almost gave my task after experimenting the WinSCP active x plugin. I’ve decided to search again another code and found this library.
There are samples there on the source code but I’ve found the code ‘SSHExeTest.cs’ helpful for me.
Here is the revise code I have :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Tamir.SharpSsh;
namespace WinSCP_Test
{
public partial class Form1 : Form
{
string _ipAddress = "192.168.0.160";
string _username = "root"; // :) dont worry i'mjust playing on virtualbox I think its better not to use root in production
string _password = "xxxxxxx";
SshExec exec;

public Form1()
{
InitializeComponent();
exec = new SshExec(_ipAddress, _username);
exec.Password = _password;
exec.Connect();
}
private bool isScriptRunning()
{

string command = "ps ax | grep -e '[t]est.py'";
string output = exec.RunCommand(command);
string[] output_arr = output.Trim().Split(' ');
return output != "";
}
private void runScript()
{

string command = "/usr/bin/python /root/test.py > /dev/null &";
exec.RunCommand(command);
//Console.WriteLine(output);

}
private void killScript()
{
string command = "ps ax | grep -e '[t]est.py'";

string output = exec.RunCommand(command);
string[] output_arr = output.Trim().Split(' ');
output = exec.RunCommand("kill -9 " + output_arr[0]);
}

 

private void button1_Click(object sender, EventArgs e)
{
if (this.isScriptRunning())
{
if (MessageBox.Show("Script is running kill it?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
this.killScript();
}
}
else
{
if (MessageBox.Show("Script is is not running,run it?", "", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
this.runScript();
}

}
}

private void button2_Click(object sender, EventArgs e)
{
this.Close();
}

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
exec.Close();
}
}
}

Fixing the “Permission denied” error on /var/lib/asterisk/agi-bin/dialparties.agi

A client calls us earlier  complaining that their  incoming calls are not going through. The call just drops  in. I’ve tried to trace also their log full the /var/log/asterisk/full confirming the issue.  Upon tracing the log file, I can see that there is entries that says “Permission denied”  during my call attempt.

 


[Aug 23 11:09:52] VERBOSE[32336] pbx.c: -- Executing [s@macro-dial:3] AGI("DAHDI/77-1", "dialparties.agi") in new stack
[Aug 23 11:09:52] VERBOSE[32336] res_agi.c: -- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
[Aug 23 11:09:52] VERBOSE[32337] app_mixmonitor.c: == Begin MixMonitor Recording DAHDI/77-1
[Aug 23 11:09:52] VERBOSE[32336] res_agi.c: dialparties.agi: Failed to execute '/var/lib/asterisk/agi-bin/dialparties.agi': Permission denied
[Aug 23 11:09:52] VERBOSE[32336] pbx.c: -- Executing [s@macro-dial:4] NoOp("DAHDI/77-1", "Returned from dialparties with no extensions to call and DIALSTATUS: ") in new stack
[Aug 23 11:09:52] VERBOSE[32336] pbx.c: -- Executing [s@macro-exten-vm:10] GotoIf("DAHDI/77-1", "0?exit,return") in new stack
[

 

The issue though is just fixed by doing the chmod on /var/lib/asterisk/agi-bin/dialparties.agi.

Just do : chmod 777 /var/lib/asterisk/agi-bin/dialparties.agi

Calling again the  dialer server  after that ‘fix’  and my call went through.