Pages

Your Ad Here

This Blog is not to read or go through

because, I have never been such a mess


Search the blog instead

Friday, July 30, 2010

Google Chrome - Your Profile could not be opened correctly ...

You might have encountered this issue.  Well I did too. Here is a solution I found and posted to the Google Discussion Thread on this same issue.
http://www.google.com/support/forum/p/Chrome/thread?tid=08e9aa36ad5159cb&start=40

So, here is what happened in my case.


I have been using Ubuntu Hardy 8.04 and Google Chrome 5.0.375.70
...

After facing similar problem, I tried as said above in the discussions and also at the Ubuntu Forums page mentioned here.

However, I could not make it solved, and the message saying 'Your profile could not be opened correctly' popped every time I restarted my browser.
....

So, I checked each single file, in the following order inside the directory ~/.config/google-chrome/Default
1) databases (dir)
2) Local Storage (file)
3) Web Data(file)

and on my third trial, I just found it working without the pop up.

Hence, according to my findings, its the 'Web Data' file which when removed I got the problem solved.
......................

Further,
I could not find my saved passwords restored still.

Any suggestions will be highly appreciated.

Friday, July 16, 2010

VIM Editor - Search and Replace

  • /searchkey - search something
  • :[range]s/search/replace/ - replace something within range
  • :8,10 s/search/replace/g  - replace something within range
  • :%s/search/replace/g - replace something full document
  • :%s/search/replace/gc.  - prompt

Wednesday, July 14, 2010

PHP Jabber Web Chat

Searched a LOT And LOT and finally found one.


PHP/Ajax based Jabber Web Chat Client.


http://blog.jwchat.org/jwchat/

Tuesday, July 6, 2010

Recovering Grub

Uhu, Grub thing again.,

Now i must find the easiest solution, as simple as 1, 2 3.


  1. Boot from Live CD. Install grub with the following command
    $ apt-get install grub
    sudo grub
  2. Find the partition in which Grub is to be installed. May be the '/' partition of your hard drive, or the '/boot' partition of your hard drive. Then execute the following. Make sure you are in the grub shell with grub> prompt
    grub> root (hd0, 0) - Assuming 1st paritition of your first hard drive is the boot partition
  3. Setup the grub and reboot.
    grub> setup
    grub> quit
    $ reboot

Wednesday, June 23, 2010

Kannel restart script | Attempting to Kill a process in linux until it gets killed

Restarting kannel wasn't simpler, as the bearerbox was not exiting on single stop command for Kannel. So needed to do some tricks on killing the bearerbox first. See the code

#!/bin/bash
while [ true ]
do
 echo "quering bearerbox"
 sleep 1
 count=$(ps -C "bearerbox" | wc -l)
 echo $count
 if [ $count -eq 2 ]
 then
  echo "attempting to kill bearerbox"
  killall bearerbox
 else
  sleep 1
  echo "======= bearerbox killed ========"
  break
 fi
done
sleep 1
bearerbox /etc/kannel/kannel.conf
smsfox /etc/kannel/kannel.conf

Altering system default timezone in linux

Reference:
http://www.cyberciti.biz/faq/howto-linux-unix-change-setup-timezone-tz-variable/


Change Linux timezone

Select the method as per your Linux distribution:

If you are using Fedora / RHEL / Cent OS Linux

Type the redhat-config-date command at the command line to start the time and date properties tool.
# redhat-config-date
OR type setup and select time zone configuration (good for remote ssh text based Linux server sessiob)
# setup
Select timezone configuration
Fig.01: Redhat / CentOS Server Setting Up Timezone
Fig.01: Redhat / CentOS Server Setting Up Timezone
Now, just follow on screen instructions to change timezone.

Set timezone using /etc/localtime configuration file [any Linux distro]

Often /etc/localtime is a symlink to the file localtime or to the correct time zone file in the system time zone directory.

Generic procedure to change timezone

Change directory to /etc
# cd /etc
Create a symlink to file localtime:
# ln -sf /usr/share/zoneinfo/EST localtime
OR some distro use /usr/share/zoneinfo/dirname/zonefile format (Red hat and friends)
# ln -sf /usr/share/zoneinfo/EST localtime
OR if you want to set up it to IST (Asia/Calcutta):
# ln -sf /usr/share/zoneinfo/Asia/Calcutta localtime
Please mote that in above example you need to use directory structure i.e. if you want to set the timezone to Calcutta (India) which is located in the Asia directory you will then have to setup using as above.
Use date command to verify that your timezone is changed:
$ date
Output:
Tue Aug 27 14:46:08 EST 2006

Use of environment variable

You can use TZ environment variable to display date and time according to your timezone:
$ export TZ=America/Los_Angeles
$ date

Sample Output:
Thu Aug 27 11:10:08 PST 2006

Monday, June 21, 2010

Forgot your Google Apps Admin Password

If you forget Google apps admin password, sometimes it might be quite boring not to find the exact link to reset the password, since Google apps says contact administrator to support your login.

If you are yourself admin then ?


hmm, no need to think more.

Just Visit this link

Eg.
https://www.google.com/a/cpanel/appsdomain.com/ForgotAdminAccountInfo
Replace appsdomain.com with your own apps domain

Wednesday, June 9, 2010

download manger in linux - alternate to wget

its been a long time using wget and being fond of.

However, I was just willing to download a large file with multiple concurrent connections on a single path, as many download mangers with GUI provide so.

Not sure, whether wget provides this, but just found a good one.

aria2c

however, its name was so confusing and odd one, I just did a quick ln -s  and made it more familiar.

and here is what I did.

# aria2c -s 5 -c http://the-download-url
where -s 5 is for 5 concurrent connections
-c is for continuing what I downloaded using wget.

and for more easier name of the command.
# sudo ln -s /usr/bin/aria2c /usr/bin/download

so its now the following

# download -s 5 -c http://link-to-download-from-web

and this is the general output format for aria2c



WOW

Tuesday, May 11, 2010

PHP DOMElement innerHTML

Not seeing innerHTML or any similary function, variable for a DOMElement object in PHP might be frustrating to get the inner content.


Just a quick tip.

Use
DOMElement-Object->nodeValue;

Wednesday, May 5, 2010

Nested Quotes problem in HTML PHP

<?php

function sanitize_quotes($string){
    return htmlspecialchars($string, ENT_QUOTES);
}

$url = "Chateau d'Ouchy";
$surl = sanitize_quotes($url);
echo "<a title='<a href=\"{$surl}\" >{$surl}</a>'>Anchor Text</a>";
?>

Tags: PHP, HTML, Web, Internet, Tips and Tricks, Troubleshooting, Howto

Sunday, May 2, 2010

Understanding CSS Font Stacks

See the presentation on what CSS Font Stack is
http://www.maxdesign.com.au/articles/font-stacks/

And, this is the actual FontStack Builder on Web
http://www.codestyle.org/servlets/FontStack

Tuesday, April 20, 2010

bash shell quick tips

some quick tips on bash shell programming

a) Variable set/access
varname='some text'
echo $varname
b) store command output to a variable
varname=`somecommand`
echo $varname

or,
an alternate way to do it
varname=$(some command)
echo $varname
eg. - to store current timestamp in a variable
current_timestamp=`date +%s`
echo $current_timestamp
c)s
eg
d)
eg
e)
eg
f)
eg
g)
eg

Estimating MySQL Dump Size before actual export

Estimating the MySQL Dump size before actual export.,

As far as searched through its not possible in MySQL

Here is the comparision between MySQL 6 and ORACLE.
http://blogs.mysql.com/peterg/category/mysql-60-new-features/

Will explore more, if any other tools are available.

However, one quick way might be something like,
checking the size in phpmyadmin or something like that, the rows and overhead by each tables,
then applying some ratios or compression factors to calculate the rough dump size,
It might be something useful.

Will try on this more.

However ORACLE > 10 has ESTIMATE_ONLY

Monday, April 19, 2010

NAT, DNAT, SNAT

Source NAT
Destination NAT



SNAT (Source Network Address Translation)

SNAT provides a secure mechanism for translating internal, nonroutable addresses into routable addresses. As traffic flows out of a data center, the gateway and source address of IP packets are translated and switched to the appropriate upstream gateway router. This ensures that traffic is sent and returned through the desired path.


NAT (network address translation)

To extend the reach of the IPv4 address space, companies have turned to using private IPv4 addresses through a public-to-private address translation technique known as network address translation (NAT).



NAT works by using the several million private addresses that have been put aside by the Internet Engineering Task Force, turning a public IP address such as 192. 156.136.22 into a private address, such as 10.0.0.4, for delivery to a user's PC. Private IP addresses cannot be "seen" by the Internet, and therefore may be reused by various enterprise networks.

In conjunction with a NAT-enabled gateway or router device, a privately addressed network may hide hundreds or thousands of hosts behind a single public address. The NAT device differentiates among the PCs by translating their port numbers into unique values.

But NAT is limited by applications such as streaming media that transmit IP addresses or port numbers in the payloads of packets. Such applications require that NAT take on application-specific knowledge and perform additional computation.

Worse, because NAT typically resides in a boundary router between private and public networks, it can't function with IP Security (IPSec), the popular encryption technology for virtual private networks. IPSec requires true end-to-end handshaking in order to set up initial encryption rules. Once encrypted at a client system, IPSec packets cannot be modified - or recognized - by NAT.


5.5. Destination NAT with netfilter (DNAT)

Destination NAT with netfilter is commonly used to publish a service from an internal RFC 1918 network to a publicly accessible IP. To enable DNAT, at least one iptables command is required. The connection tracking mechanism of netfilter will ensure that subsequent packets exchanged in either direction (which can be identified as part of the existing DNAT connection) are also transformed.

Proxy Server Definitions

Anonymous - HTTP Proxy server does not send HTTP_X_FORWARDED_FOR variable to host, this improves privacy since your IP address cannot be logged.

High anonymity - HTTP Servers of this type don't send HTTP_X_FORWARDED_FOR, HTTP_VIA and HTTP_PROXY_CONNECTION variables. Host doesn't even know you are using proxy server an of course it doesn't know your IP address.

Friday, April 16, 2010

Automatic Base URL in PHP

# Generate the BASE_URL

$request = $_SERVER["REQUEST_URI"];
$script_path = $_SERVER["SCRIPT_NAME"];
$base_url_len = strlen($script_path) - strlen("index.php");
$arg = explode("/", substr($request, $base_url_len));
$base_url = "http://". $_SERVER["HTTP_HOST"] . substr($script_path, 0, $base_url_len);
define("BASE_URL", $base_url);

author -- acpmasquerade

Sunday, April 11, 2010

IKE Proposals

Referred to this document
http://docstore.mik.ua/univercd/cc/td/doc/product/vpn/vpn3002/4-1/referenc/ikeapp.htm

Following are the valid IKE Proposals

Table A-1 Valid VPN 3002 Hardware Client IKE Proposals

Proposal Name Authentication
Mode
Authentication Algorithm Encryption Algorithm Diffie- Hellman
Group

CiscoVPNClient-3DES-MD5

Preshared Keys (XAUTH)

MD5/HMAC-128

3DES-168

Group 2
(1024 bits)

CiscoVPNClient-3DES-SHA

Preshared Keys (XAUTH)

SHA/HMAC-160

3DES-168

Group 2
(1024 bits)

CiscoVPNClient-DES-MD5

Preshared Keys (XAUTH)

MD5/HMAC-128

DES-56

Group 2
(1024 bits)

CiscoVPNClient-AES128-MD5

Preshared Keys (XAUTH)

MD5/HMAC-128

AES-128

Group 2
(1024 bits)

CiscoVPNClient-AES128-SHA

Preshared Keys (XAUTH)

SHA/HMAC-160

AES-128

Group 2
(1024 bits)

CiscoVPNClient-AES192-MD5

Preshared Keys (XAUTH)

MD5/HMAC-128

AES-192

Group 2
(1024 bits)

CiscoVPNClient-AES192-SHA

Preshared Keys (XAUTH)

SHA/HMAC-160

AES-192

Group 2
(1024 bits)

CiscoVPNClient-AES256-MD5

Preshared Keys (XAUTH)

MD5/HMAC-128

AES-256

Group 2
(1024 bits)

CiscoVPNClient-AES256-SHA

Preshared Keys (XAUTH)

SHA/HMAC-160

AES-256

Group 2
(1024 bits)

IKE-3DES-MD5

Preshared Keys

MD5/HMAC-128

3DES-168

Group 2
(1024 bits)

IKE-3DES-SHA

Preshared Keys

SHA/HMAC-160

3DES-168

Group 2
(1024 bits)

IKE-DES-MD5

Preshared Keys

MD5/HMAC-128

DES-56

Group 2
(1024 bits)

IKE-AES128-MD5

Preshared Keys

MD5/HMAC-128

AES-128

Group 2
(1024 bits)

IKE-AES128-SHA

Preshared Keys

SHA/HMAC-160

AES-128

Group 2
(1024 bits)

IKE-AES192-MD5

Preshared Keys

MD5/HMAC-128

AES-192

Group 2
(1024 bits)

IKE-AES192-SHA

Preshared Keys

SHA/HMAC-160

AES-192

Group 2
(1024 bits)

IKE-AES256-MD5

Preshared Keys

MD5/HMAC-128

AES-256

Group 2
(1024 bits)

IKE-AES256-SHA

Preshared Keys

SHA/HMAC-160

AES-256

Group 2
(1024 bits)

CiscoVPNClient-3DES-MD5-RSA

RSA Digital Certificate (XAUTH)

MD5/HMAC-128

3DES-168

Group 2
(1024 bits)

CiscoVPNClient-3DES-SHA-RSA

RSA Digital Certificate (XAUTH)

SHA/HMAC-160

3DES-168

Group 2
(1024 bits)

CiscoVPNClient-DES-MD5-RSA-DH1

RSA Digital Certificate (XAUTH)

MD5/HMAC-128

DES-56

Group 1
(768 bits)

CiscoVPNClient-AES128-MD5-RSA

RSA Digital Certificate (XAUTH)

MD5/HMAC-128

AES-128

Group 2
(1024 bits)

CiscoVPNClient-AES128-SHA-RSA

RSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-128

Group 2
(1024 bits)

CiscoVPNClient-AES256-MD5-RSA

RSA Digital Certificate (XAUTH)

MD5/HMAC-128

AES-256

Group 2
(1024 bits)

CiscoVPNClient-AES256-SHA-RSA

RSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-256

Group 2
(1024 bits)

CiscoVPNClient-3DES-MD5-RSA-DH5

RSA Digital Certificate (XAUTH)

MD5/HMAC-128

3DES-168

Group 5
(1536 bits)

CiscoVPNClient-3DES-SHA-RSA-DH5

RSA Digital Certificate (XAUTH)

SHA/HMAC-160

3DES-168

Group 5
(1536 bits)

CiscoVPNClient-AES128-MD5-RSA-DH5

RSA Digital Certificate (XAUTH)

MD5/HMAC-128

AES-128

Group 5
(1536 bits)

CiscoVPNClient-AES128-SHA-RSA-DH5

RSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-128

Group 5
(1536 bits)

CiscoVPNClient-AES192-MD5-RSA-DH5

RSA Digital Certificate (XAUTH)

MD5/HMAC-128

AES-192

Group 5
(1536 bits)

CiscoVPNClient-AES192-SHA-RSA-DH5

RSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-192

Group 5
(1536 bits)

CiscoVPNClient-AES256-MD5-RSA-DH5

RSA Digital Certificate (XAUTH)

MD5/HMAC-128

AES-256

Group 5
(1536 bits)

CiscoVPNClient-AES256-SHA-RSA-DH5

RSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-256

Group 5
(1536 bits)

IKE-3DES-MD5-RSA

RSA Digital Certificate

MD5/HMAC-128

3DES-168

Group 2
(1024 bits)

IKE-3DES-SHA-RSA

RSA Digital Certificate

SHA/HMAC-160

3DES-168

Group 2
(1024 bits)

IKE-AES128-MD5-RSA

RSA Digital Certificate

MD5/HMAC-128

AES-128

Group 2
(1024 bits)

IKE-AES128-SHA-RSA

RSA Digital Certificate

SHA/HMAC-160

AES-128

Group 2
(1024 bits)

IKE-AES256-MD5-RSA

RSA Digital Certificate

MD5/HMAC-128

AES-256

Group 2
(1024 bits)

IKE-AES256-SHA-RSA

RSA Digital Certificate

SHA/HMAC-160

AES-256

Group 2
(1024 bits)

IKE-DES-MD5-RSA-DH1

RSA Digital Certificate

MD5/HMAC-128

DES-56

Group 1
(768 bits)

IKE-3DES-MD5-RSA-DH5

RSA Digital Certificate

MD5/HMAC-128

3DES-168

Group 5
(1536 bits)

IKE-3DES-SHA-RSA-DH5

RSA Digital Certificate

SHA/HMAC-160

3DES-168

Group 5
(1536 bits)

IKE-AES128-MD5-RSA-DH5

RSA Digital Certificate

MD5/HMAC-128

AES-128

Group 5
(1536 bits)

IKE-AES128-SHA-RSA-DH5

RSA Digital Certificate

SHA/HMAC-160

AES-128

Group 5
(1536 bits)

IKE-AES192-MD5-RSA-DH5

RSA Digital Certificate

MD5/HMAC-128

AES-192

Group 5
(1536 bits)

IKE-AES192-SHA-RSA-DH5

RSA Digital Certificate

SHA/HMAC-160

AES-192

Group 5
(1536 bits)

IKE-AES256-MD5-RSA-DH5

RSA Digital Certificate

MD5/HMAC-128

AES-256

Group 5
(1536 bits)

IKE-AES256-SHA-RSA-DH5

RSA Digital Certificate

SHA/HMAC-160

AES-256

Group 5
(1536 bits)

CiscoVPNClient-3DES-SHA-DSA

DSA Digital Certificate (XAUTH)

SHA/HMAC-160

3DES-168

Group 2
(1024 bits)

CiscoVPNClient-AES128-SHA-DSA

DSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-128

Group 2
(1024 bits)

CiscoVPNClient-AES256-SHA-DSA

DSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-256

Group 2
(1024 bits)

CiscoVPNClient-3DES-SHA-DSA-DH5

DSA Digital Certificate (XAUTH)

SHA/HMAC-160

3DES-168

Group 5
(1536 bits)

CiscoVPNClient-AES128-SHA-DSA-DH5

DSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-128

Group 5
(1536 bits)

CiscoVPNClient-AES192-SHA-DSA-DH5

DSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-192

Group 5
(1536 bits)

CiscoVPNClient-AES256-SHA-DSA-DH5

DSA Digital Certificate (XAUTH)

SHA/HMAC-160

AES-256

Group 5
(1536 bits)

IKE-3DES-SHA-DSA

DSA Digital Certificate

SHA/HMAC-160

3DES-168

Group 2
(1024 bits)

IKE-AES128-SHA-DSA

DSA Digital Certificate

SHA/HMAC-160

AES-128

Group 2
(1024 bits)

IKE-AES256-SHA-DSA

DSA Digital Certificate

SHA/HMAC-160

AES-256

Group 2
(1024 bits)

IKE-3DES-SHA-DSA-DH5

DSA Digital Certificate

SHA/HMAC-160

3DES-168

Group 5
(1536 bits)

Wednesday, March 31, 2010

"Owner company already exists" OpenGoo

An amazing error "Owner company already exists" was popped out while working on Opengoo migration.

It was caused when the admin user installing Opengoo was deleted

This was in the version 1.5.3

Wednesday, March 24, 2010

current timestamp in linux

date command gives the current time

and date command accepts the date formatting.

so the timestamp is given by

date +%s




----------




NOTE: click here if you get an empty page.


DATE(1)     User Commands          DATE(1)

NAME


date - print or set the system date and time

SYNOPSIS


date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]

DESCRIPTION


Display the current time in the given FORMAT, or set the system date.

-d, --date=STRING
display time described by STRING, not `now'

-f, --file=DATEFILE
like --date once for each line of DATEFILE

-r, --reference=FILE
display the last modification time of FILE

-R, --rfc-2822
output date and time in RFC 2822 format

--rfc-3339=TIMESPEC
output date and time in RFC 3339 format. TIMESPEC=`date', `sec-
onds', or `ns' for date and time to the indicated precision.

-s, --set=STRING
set time described by STRING

-u, --utc, --universal
print or set Coordinated Universal Time

--help display this help and exit

--version
output version information and exit

FORMAT controls the output. The only valid option for the second form
specifies Coordinated Universal Time. Interpreted sequences are:

%% a literal %

%a locale's abbreviated weekday name (e.g., Sun)

%A locale's full weekday name (e.g., Sunday)

%b locale's abbreviated month name (e.g., Jan)

%B locale's full month name (e.g., January)

%c locale's date and time (e.g., Thu Mar 3 23:05:25 2005)

%C century; like %Y, except omit last two digits (e.g., 21)

%d day of month (e.g, 01)

%D date; same as %m/%d/%y

%e day of month, space padded; same as %_d

%F full date; same as %Y-%m-%d

%g the last two digits of the year corresponding to the %V week
number

%G the year corresponding to the %V week number

%h same as %b

%H hour (00..23)

%I hour (01..12)

%j day of year (001..366)

%k hour ( 0..23)

%l hour ( 1..12)

%m month (01..12)

%M minute (00..59)

%n a newline

%N nanoseconds (000000000..999999999)

%p locale's equivalent of either AM or PM; blank if not known

%P like %p, but lower case

%r locale's 12-hour clock time (e.g., 11:11:04 PM)

%R 24-hour hour and minute; same as %H:%M

%s seconds since 1970-01-01 00:00:00 UTC

%S second (00..60)

%t a tab

%T time; same as %H:%M:%S

%u day of week (1..7); 1 is Monday

%U week number of year with Sunday as first day of week (00..53)

%V week number of year with Monday as first day of week (01..53)

%w day of week (0..6); 0 is Sunday

%W week number of year with Monday as first day of week (00..53)

%x locale's date representation (e.g., 12/31/99)

%X locale's time representation (e.g., 23:13:48)

%y last two digits of year (00..99)

%Y year

%z +hhmm numeric timezone (e.g., -0400)

%:z +hh:mm numeric timezone (e.g., -04:00)

%::z +hh:mm:ss numeric time zone (e.g., -04:00:00) %:::z numeric
time zone with : to necessary precision (e.g., -04, +05:30) %Z
alphabetic time zone abbreviation (e.g., EDT)

By default, date pads numeric fields with zeroes. The following
optional flags may follow `%':

- (hyphen) do not pad the field _ (underscore) pad with spaces 0
(zero) pad with zeros ^ use upper case if possible # use oppo-
site case if possible

After any flags comes an optional field width, as a decimal number;
then an optional modifier, which is either E to use the locale's alter-
nate representations if available, or O to use the locale's alternate
numeric symbols if available.

AUTHOR


Written by David MacKenzie.

REPORTING BUGS


Report bugs to .

COPYRIGHT


Copyright (C) 2005 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the
terms of the GNU General Public License
. There is NO WARRANTY, to the
extent permitted by law.

SEE ALSO


The full documentation for date is maintained as a Texinfo manual. If
the info and date programs are properly installed at your site, the
command

info date

should give you access to the complete manual.



date 5.93 October 2008 DATE(1)

� 1994 Man-cgi 1.15, Panagiotis Christias

Thursday, March 18, 2010

PHP array_splice vs. array_slice

Slice
array array_slice ( array $array , int $offset [,int $length [, bool $preserve_keys = false ]] )

Extract a slice of the array

Example :

$input= array("a", "b", "c", "d", "e");

$output = array_slice($input, 2); // returns "c", "d", and "e"
$output = array_slice($input, -2, 1); // returns "d"
$output = array_slice($input, 0, 3); // returns "a", "b", and "c"

// note the differences in the array keys
print_r(array_slice($input, 2, -1));
print_r(array_slice($input, 2, -1, true));





Splice
array array_splice ( array &$input , int $offset [, int $length = 0 [, mixed $replacement ]] )
Remove a portion of the array and replace it with something else

Example :

= array("red", "green", "blue", "yellow");
array_splice($input, 2);
// $input is now array("red", "green")

$input = array("red", "green", "blue", "yellow");
array_splice($input, 1, -1);
// $input is now array("red", "yellow")

$input = array("red", "green", "blue", "yellow");
array_splice($input, 1, count($input), "orange");
// $input is now array("red", "orange")

$input = array("red", "green", "blue", "yellow");
array_splice($input, -1, 1, array("black", "maroon"));
// $input is now array("red", "green",
// "blue", "black", "maroon")

$input = array("red", "green", "blue", "yellow");
array_splice($input, 3, 0, "purple");
// $input is now array("red", "green",
// "blue", "purple", "yellow");



Thanks - PHP.net

PHP array_splice vs. array_slice

Slice
array
array_slice ( array $arra
y
, int $offset [, int $length [, bool $preserve_keys = false ]] )

Sl
array array_splice ( array &$input , int $offset [, int $length = 0 [, mixed $replacement ]] )


Flash Flipping Book HTML Version

The popular Flash Flip Book (page-flip.com) has a good html version to use.

its Joomla component version is used by Nagariknews.com and myrepublica.com

Demo goes here
http://page-flip.com/new-demos/03-kitchen-gorenje-2008/index.html

Pseudo Selectors CSS and JQuery

Pseudo Selectors Primarily for CSS and some for jquery too.
http://css-tricks.com/pseudo-class-selectors/

Wednesday, March 10, 2010

Tuesday, March 2, 2010

Programming Contest Questions

My Bookmarks for Programming Contest Questions

ACSL.org
http://acsl.org/acsl/00-01/
http://acsl.org/acsl

HP Code Wars Sample Problems
http://www.hpcodewars.org/index.php?page=samples

IPSC Questions Archives
http://ipsc.ksp.sk/old.php

List of all Programming Contests as defined in Open Directory
http://www.dmoz.org/Computers/Programming/Contests/

The International Obfuscated C Code Contest
http://www.ioccc.org/

ACM Programming Contest
http://homepages.ecs.vuw.ac.nz/~david/acm/

Waterloo Programming Contests
http://plg1.cs.uwaterloo.ca/~acm00/

Wednesday, February 17, 2010

Credit Card Digit Valiation

http://www.beachnet.com/~hstiles/cardtype.html

Tuesday, February 16, 2010

runlevels in redhat

simple interface to configure runlevels

ntsysv --level

eg. ntsysv --level 016 edits runlevels 0, 1, and 5

Saturday, January 30, 2010

Java Webstart in ubuntu 8.10

I just tried to run Java Web Start Application in my Ubuntu Box and it threw this error.

net.sourceforge.nanoxml.XMLParseException: XML Parse Exception during parsing of the XML definition at line 5: Unexpected end of data reached
at net.sourceforge.nanoxml.XMLElement.unexpectedEndOfData(XMLElement.java:1169)
at net.sourceforge.nanoxml.XMLElement.readChar(XMLElement.java:940)
at net.sourceforge.nanoxml.XMLElement.skipSpecialTag(XMLElement.java:878)
at net.sourceforge.nanoxml.XMLElement.sanitizeInput(XMLElement.java:1293)
at net.sourceforge.jnlp.Parser$1.run(Parser.java:959)
at java.lang.Thread.run(Thread.java:636)
netx: Invalid XML document syntax.
Solution found was as following
java -jar /usr/share/java/netx.jar -jnlp "and-the-jnlp-path-here

Tuesday, January 19, 2010

Logo Design Processes for 30 different logs

http://creativenerds.co.uk/articles/30-professional-logo-design-processes-revealed/

Saturday, January 9, 2010

17 javascript animation frameworks

http://www.admixweb.com/2010/01/07/17-javascript-animation-frameworks-worth-to-seing/
Your Ad Here