Posts

Showing posts from 2012

How to search and rename in filenames in Windows

Using vbscript u can do multiple files replace existing string ---------------------------------------------------------- Set objFso = CreateObject("Scripting.FileSystemObject") Set Folder = objFSO.GetFolder("E:\SOFTWARES\WAV_Files\1\xxx") For Each File In Folder.Files     sNewFile = File.Name     sNewFile = Replace(sNewFile,"24bit","32bit")     if (sNewFile<>File.Name) then         File.Move(File.ParentFolder+"\"+sNewFile)     end if Next

List only the directories_SHELL

for i in $(ls -d */); do echo ${i%%/}; done or echo */ . . | sed "s/\/ /\n/g" or ls -d */

Video -> Aperture Shutter Speed and ISO, Photography 101

http://www.youtube.com/watch?v=Nk78nH3d8hU&list=PL1208EEA2D8E57D13&index=1&feature=plpp_video

Crystal Reports Viewer ActiveX Control

I just finished fixing an issue for one of my clients that I wanted to share. I Googled for hours and couldn't find a fix, so now that I have found the cure, wanted to share it.  Hopefully this will help someone in the future. The Symptom My user goes to a business website to access reports that were written with Crystal Reports. Their website offers to install the Crystal Reports Viewer (ActiveX control). You acknowledge that you want to install it and you get the following error: Internet Explorer Security Warning Windows has found a problem with this file. Name: activexviewer.cab Publisher: Unknown Publisher I do not believe it matters for this problem, but the user is using Internet Explorer 7. The Cure It appears that the vendor offering these reports is using an older version of Crystal Reports (2003) and the certificate on their ActiveX control is no longer valid. The cure is to tell Internet Explorer to not check the certificate on installs (which is a security risk),...

Easily Find the Serial Number of your Computer

Open the command prompt (Start – > CMD) and type the following command: wmic bios get serialnumber Another command that will also print the model number (or make) of your computer is: wmic csproduct get name, identifyingnumber

How to run a perl script in background on Windows?

C:\>  start /b perl script.pl 

How can I open a message box in a Windows batch file?

echo MSGBOX "YOUR MESSAGE" > %temp%\TEMPmessage.vbs call %temp%\TEMPmessage.vbs del %temp%\TEMPmessage.vbs /f /q

List out all windows Environment variables

perl -wle "print qq{$_=$ENV{$_}} for sort keys %ENV"

How to concatenate multiple MySQL rows into one field?

Using MySQL, I can do something like select hobbies from peoples_hobbies where person_id = 5; and get: shopping fishing coding but instead I just want 1 row, 1 col: shopping, fishing, coding Answer: select person_id , group_concat ( hobbies separator ', ' )     from peoples_hobbies group by person_id ;

Find path to perl on windows

perl -e "print $^X"

Interior designs

Image

Basic things to handle SLR manually

Image
Hi guys, just wanna share some basic information  to camera users should know if they choose shoot setting manually. Aperture, Shutter Speed and ISO is very common term in SLR, above is the example of ideal value for each setting   this is sample combination for aperture (f-stops) and shutter speed. let's try it out..

Understand focal length and aperture value

Image
In every aperture value we can get different kind of photo, but what is actually we looking for? it't depend on what we need. Below is a diagram illustrated subject focus in different aperture value.  as what we know, every lens have their own function, but we need to know the limitation too, below is the type of lenses with focal length size. did we know how much our camera can see?

Web links of Perl tutorials

http://perl5maven.com/perl-tutorial Perl, is a general programming language. It has been used in everything from bioscience ( http://www.bioperl.org ) to web development ( http://mojolicio.us  , http://perldancer.org ,  http://www.catalystframework.org  , and many many more.) As with many things in Perl there is usually more then one way to do things. Here is a small sample of things Perl community in general has: Parsers:  http://www.jeffreykegler.com/marpa BioPerl:  http://www.bioperl.org Scientific computing:  http://pdl.perl.org/ Webframe works: (lots here, just naming a few) * Plack:  http://plackperl.org/ * Mojolicious:  http://mojolicio.us * Perl Dancer:  http://perldancer.org * Catalyst:  http://www.catalystframework.org * CGI Application : http://search.cpan.org/~markstos/CGI-Application-3.21/lib/CGI/Application.pm Templating Frameworks: (Lot here, just naming a few) * Template Toolkit :  http://temp...

What are the unique features in Perl

" Perl was originally written to manipulate text in files, extract data from files, and write reports, but through continued development, it can manipulate processes, perform networking tasks, process Web pages, talk to databases, and analyze scientific data."  "Perl makes simple tasks easy, and makes difficult tasks possible."  1) Perl using a scalar, but no boolean / integer / long / float / double / scring. 2) Perl inherits / extends features of many shell scripting languages: shell / korn shell / C shell / Born shell 3) there are above 25k open source modules on the CPAN site one of the greatest advantages of Perl is the wealth of modules that can be found on CPAN.

Script to take dump from mysql and send mail

#! /bin/bash # your MySQL server's name SERVER=localhost # directory to backup to BACKDIR=~/backups # date format that is appended to filename DATE=`date +'%m-%d-%Y'` #----------------------MySQL Settings--------------------# # your MySQL server's location (IP address is best) HOST=localhost # MySQL username USER=root # MySQL password PASS="" # List all of the MySQL databases that you want to backup in here, # each separated by a space DBS="mtv_kbc" # set to 'y' if you want to backup all your databases. this will override # the database selection above. DUMPALL=n #----------------------Mail Settings--------------------# # set to 'y' if you'd like to be emailed the backup (requires mutt) MAIL=y # email addresses to send backups to, separated by a space EMAILS="cinu97@gmail.com" SUBJECT="MySQL backup on $SERVER ($DATE)" #----------------------FTP Settings----------------...

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

solution: ------------ /etc/init.d/mysqld stop mysqld_safe --skip-grant-tables & mysql  -u root mysql > use  mysql ; mysql > update user set password=PASSWORD(" newrootpassword") where User='root'; mysql > flush privileges; mysql > quit /etc/init.d/mysqld stop /etc/init.d/mysqld start

mysql user grant permissions

mysql> GRANT ALL PRIVILEGES ON  dbname.* TO 'user'@'localhost';

sample ss7.conf for 8port

$ vi /etc/ asterisk /ss7.conf [linkset-MSC1]  enabled => yes  enable_st => no  use_connect => yes  hunting_policy => seq_htl  subservice => auto  context => ss7  language => en  t35 => 15000,timeout  [link-l1]  linkset => MSC1  channels => 2-31  schannel => 1@host1:12000  ;schannel => 1,host1:12000  for chan_ss7 < 1.3  firstcic => 1  enabled => yes  [link-l2]  linkset => MSC1  channels => 1-31  schannel =>  firstcic => 33  enabled => yes  [link-l3]  linkset => MSC1  channels => 1-31  schannel =>  firstcic => 65  enabled => yes  [link-l4]  linkset => MSC1  channels => 1-31  schannel =>  firstcic => 97  enabled => yes  [link-l5]  linkset => MSC1  channels => 1-31  schannel =>...

sangoma card installation procedure

reference : http://wiki.sangoma.com/wanpipe-linux-asterisk-zaptel 1)Zaptel Installation Download Zaptel into arbitrary directory (/usr/src) and untar it. #>tar xvfz zaptel-<version> #>ln -s zaptel-<version> zaptel #>cd zaptel-<version> #>./configure #>make #>make install 2)# LibPRI Installation Download libpri into arbitrary directory (/usr/src) and untar it. #>tar xvfz libpri-<version> #>cd libpri-<version> #>make #>make install 3)Download Asterisk into arbirary directory (/usr/src/) and untar it. Untar Asterisk and proceed with installation #>tar xvfz asterisk-<version>.tgz #>cd asterisk-<version> #>./configure #>make #>make install #>make samples (in case of very first install) 4)Wanpipe installatio...

perl search & replace a string recursivly

perl -p -i -e 's/oldstring/newstring/g' `grep -ril oldstring *`

delete all data in a file

$cat /dev/null > filename

what is the difference between linux and unix?

For a start Linux is open source, Unix is proprietary.  Many applications are available on Linux, drivers are available compare to Unix.  The GUI and GUI applications on Linux are much more advanced than in Unix.  More community support for Linux than Unix.

Add a new line in beginning of file (Using SED)

sed -i '1i  write text watever u want to add ' filename.pl

cronetab for taking backups for every two days

#crontab -e 0 0 */2 * * /bin/sh /export/home/telesoft/vxml/ logs/cinu.sh ============================== =========== cinu.sh ----------- #!/bin/sh DATE=`date +%b\ %d --date="2 days ago"` echo COPY $DATE LOGS BACKUP_DIR=`date +%b%d` echo BACKUP DIR $BACKUP_DIR mkdir $BACKUP_DIR ls -l| grep "$(date +%b\ %d  --date="2 days ago")" | awk '{ print $9}'>$BACKUP_DIR.txt list=`cat $BACKUP_DIR.txt` for i in $list; do echo $i cp $i $BACKUP_DIR done tar -zcvf $BACKUP_DIR.tar.gz $BACKUP_DIR scp $BACKUP_DIR.tar.gz 123.176.41.150:/home/admin/

SHELL: copy perticular date created files into other directory

1step : #  ls -l | grep  'Nov  3'  | awk '{ print $9}' >> /dest/file.txt ------------------------------ ------------------------------ ------------------------------ ------------------  | |    note: $9 is for what                                                                                | |                                              ...

PERL Startup

Perl by Example 4th Edition by Ellie Quigley "...If you're just getting started with Perl, this is the book you want—whether you're a programmer, system administrator, or web hacker