Tikejhya: Ashish Nepal

Knowledgebase

Month: September 2012

Asterisk g729 support

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

How to install right codec (e.g. g729 support)
identify

cat /proc/cpuinfo/
cat /etc/redhat-release

check your cpu and release download required code.so.

asterisk -rx “module load codec_g729.so”
1017 asterisk -rvvvvvv
1018 asterisk -rx “core show translations” | grep -i g729
1019 asterisk -rx “core show translation” | grep -i g729

[root@server ashish.nepal]# asterisk -rx “core show translation” | grep -i g729
g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex ilbc g726 g722 siren7 siren14 slin16 g719 speex16 testlaw
g729 – 2000 1001 1001 3000 1001 1000 2000 – – 7999 2999 2000 – – 3000 – – 1001

ref: http://asterisk.hosting.lv/

(network.c.722) SSL: Private key does not match the certificate public key

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Starting lighttpd: Enter PEM pass phrase:
2012-09-12 04:09:51: (network.c.722) SSL: Private key does not match the certificate public key, reason: error:0906406D:PEM routines:PEM_def_callback:problems getting password /ssl/ashishnepal.com.pem
[FAILED]

Solution: Pem was not created with right file, it has to be combination of crt and nopass key file.

rabbitmq permision issue

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

/usr/sbin/rabbitmqctl add_user username password
/usr/sbin/rabbitmqctl set_permissions username ‘.*’ ‘.*’ ‘.*’

301 rewriterule

how to write 301 rewrite rule with wordpress website.

i.e. i have a website called tikejhya.com and i want to redirect specific pages to ashishnepal.com/specific directories ..

RewriteCond %{HTTP_HOST} ^www.ashishnepal.com$
RewriteRule ^deal/(.*)$ “http://www.ashishnepal.com/deal/$1” [R=301,L]
RewriteRule ^page/(.*)$ “http://www.ashishnepal.com/page/$1” [R=301,L]
RewriteRule ^deal/view/(.*)$ “http://www.ashishnepal.com/deal/view/$1” [R=301,L]

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

CREATE TABLE statement

Shows the CREATE TABLE statement that creates the given table.

show create table database.tableG

How to shut eth0:1 without stoping eth0 or range

How to shut eth0:1 without stoping eth0 or range

ifconfig eth0:1 down
ifup eth0:range0

Note: if you shut, with regular command ifdown eth0:1 it will take entire range down.

Thunderbird Autoconfiguration

How to make Thunderbird know your configuration ports?
Thunderbird smtp/pop/imap auto setup.

The goal is to setup thunderbird by any non-tech with only 2 available information, i.e. username/email and password.

There is two ways of achieving this.
1) Provide mail server infrmation to mozilla database this could take forever and wait until they verify and update there database.
2) create a autoconfig and point (dns) somewhere.
probably the easiest.

How to achieve this. Its simple.

Create a xml called: config-v1.1.xml
Setup xml accordingly, (as your port is) and point autoconfig.domain.com into particular server. 🙂

 

 

<clientConfig version="1.1">
<emailProvider id="mail.ashishnepal.com">
<domain>mail.ashishnepal.com</domain>
<displayName>Ashish Nepal Mail</displayName>
<displayShortName>AshishMail</displayShortName>
<incomingServer type="imap">
<hostname>mail.Ashishnepal.com</hostname>
<port>993</port>
<socketType>SSL</socketType>
<authentication>password-encrypted</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
<identity>
"Organization: Verizon"
</identity>
<outgoingServer type="smtp">
<hostname>mail.ashishnepal.com</hostname>
<port>465</port>
<socketType>SSL</socketType>
<authentication>password-encrypted</authentication>
<username>%EMAILADDRESS%</username>
</outgoingServer>
</emailProvider>
</clientConfig>

Lighttpd Configuration:

vi lighttpd.conf

server.document-root    = "/www/mail.ashishnepal.com/"
server.modules          = (
                                "mod_access",
                                "mod_accesslog",
                                "mod_fastcgi",
                                "mod_rewrite",
                                "mod_auth",
                                "mod_compress",
                                "mod_setenv",
                                "mod_cgi",
                                "mod_redirect"
)

server.indexfiles           = ( "index.php", "index.html",
                                "index.htm", "index.rb")

mimetype.assign = (
  ".html" => "text/html",
  ".txt" => "text/plain",
  ".css" => "text/css",
  ".jpg" => "image/jpeg",
  ".png" => "image/png",
  ".xml" => "text/xml"
)


accesslog.filename      = "/logs/www/mail.ashishnepal.com/access_log"
server.errorlog         = "/logs/www/mail.ashishnepal.com/error_log"

ssl.engine              = "enable"
ssl.pemfile             = "/etc/lighttpd/ashishnepal.com.pem"

fastcgi.server = ( ".php" => ((
                     "bin-path" => "/usr/local/bin/php-cgi",
                     "socket" => "/tmp/php.socket"
                 )))



static-file.etags = "enable"
etag.use-mtime = "enable"
$HTTP["url"] =~ "^/roundcubemail/(plugins|skins|program)" {
setenv.add-response-header  = ( "Cache-Control" => "public, max-age=2592000")
}
compress.cache-dir   = "/var/cache/compress"
compress.filetype = (
                        "text/plain",
                        "text/html",
                        "text/javascript",
                        "text/css",
                        "text/xml",
                        "image/gif",
                        "image/png")

cgi.assign = (
                "/webmail/webadmin" => "",
                "/webmail/webmail" => ""
             )

$SERVER["socket"] == ":80" {
  $HTTP["host"] =~ "mail.ashishnepal.com" {
    url.redirect = ( "^/(.*)" => "https://mail.ashishnepal.com/$1" )
  }
}


# autoconfig.ashishnepal.com

$HTTP["host"] =~ "autoconfig.ashishnepal.com" {

        server.document-root= "/www/autoconfig.ashishnepal.com/"
        accesslog.filename = "/logs/www/autoconfig.ashishnepal.com/ssl_access_log"


}

Powered by WordPress & Theme by Anders Norén