This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
texts =[u"वाराणसी", u"भौगोलिक", u"उपदर्शन"] | |
signs = [ | |
u'\u0902', u'\u0903', u'\u093e', u'\u093f', u'\u0940', u'\u0941', | |
u'\u0942', u'\u0943', u'\u0944', u'\u0946', u'\u0947', u'\u0948', | |
u'\u094a', u'\u094b', u'\u094c', u'\u094d'] | |
limiters = ['.','\"','\'','`','!',';',',','?'] | |
virama = u'\u094d' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Getopt::Long qw(:config no_ignore_case ); | |
my $replace = undef; | |
my $delete = undef; | |
my $help = 0; | |
GetOptions ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# texts =[u"वाराणसी", u"भौगोलिक", u"उपदर्शन"] | |
# CREATE TABLE syllabalize (id int(11) DEFAULT NULL, seqn int(11) DEFAULT NULL, akshar varchar(10) DEFAULT NULL) DEFAULT CHARSET=utf8 | |
import codecs | |
f = codecs.open('testfile.txt', encoding='utf-8') | |
texts = f.read().split() | |
signs = [ | |
u'\u0902', u'\u0903', u'\u093e', u'\u093f', u'\u0940', u'\u0941', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TABLE_SCHEMA=$1 | |
TABLE_NAME=$2 | |
mytime=`date '+%y%m%d%H%M'` | |
hostname=`hostname | tr 'A-Z' 'a-z'` | |
file_prefix="trimax$TABLE_NAME$mytime$TABLE_SCHEMA" | |
bucket_name=$file_prefix | |
splitat="4000000000" | |
bulkfiles=200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mydb=$1 | |
> $mydb.sql | |
param="-uroot --compact $mydb" | |
yesterday=`date '+%Y-%m-%d 00:00:00' -d "1 day ago"` | |
today=`date '+%Y-%m-%d 00:00:00'` | |
mywhere="lastupdate>'$yesterday' and lastupdate<'$today'" | |
# incremental data backup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use test; | |
drop table if exists filler; | |
drop procedure prc_filler; | |
CREATE TABLE filler (id INT NOT NULL, msg_timestamp int, mydate date, key(mydate)) ENGINE=Myisam; | |
DELIMITER $$ | |
CREATE PROCEDURE prc_filler(cnt INT, mydate datetime) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# download this script | |
# make sure s3cmd is installed | |
# yum install s3cmd | |
# if yum mentioned above does not work then | |
# wget http://downloads.sourceforge.net/project/s3tools/s3cmd/1.5.0-alpha1/s3cmd-1.5.0-alpha1.tar.gz | |
# tar xvf s3cmd-1.5.0-alpha1.tar.gz | |
# cd s3cmd-1.5.0-alpha1 | |
# python setup.py install | |
# python 2.6+ is required |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# call the script as shown below | |
# sh -xv extract.sh "db_name" "2013-02-23 00:00:00" "2013-02-23 01:59:59" | |
# or else it will select yesterday binary by default | |
mystart1=`date -d"1 days ago" +'%Y-%m-%d 00:00:01'` | |
mystop1=`date +'%Y-%m-%d 00:00:00'` | |
mystart=${2:-$mystart1} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# script to convert mysql schema to be compatible with data warehouse software | |
# make sure that s3cmd and maatkit utility is installed | |
db_name=${1:-'test'} | |
> /root/$db_name.txt | |
temppath='/mnt/data/pdump1' | |
host='localhost' | |
user='maatkit' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language.html | |
<html> | |
<body> | |
<head> | |
<title> Translate any word to 5 Indian languages</title> | |
</head> | |
<form action="welcome.php" method="post"> |
OlderNewer