Monday, August 30, 2010

wordpress site url change

You can do this via cpanel

=========
go to cpanel >> phpmyadmin >> select database >> select table wp-options and edit the table with correct site URL.
========

Also we can do this via backend

==========
step 1: use foreverg_wrdp1;
step2: show tables;
step3: desc wp_options;
step4: select * from wp_options where option_name='home';
step5: select * from wp_options where option_name='siteurl';
step6: update wp_options set option_value='http://forevergreenliving.com/' where option_id=37;
step7: update wp_options set option_value='http://forevergreenliving.com/' where option_id=1;
=========

Tuesday, August 24, 2010

Script to replace frames

grep -iRl octopusdye.ru /home/newellfi/public_html

for i in `grep -Rl 725af0498bd203c5f15bea5958ce1494 .` ;do sed -i '/725af0498bd203c5f15bea5958ce1494/d' $i ;done

Scripting Tutorials

SHELL SCRIPTING:

* sHELL: it is an interface between user and OS.
bash is a character based sell interface, these interfaces accepts lines f textul command
that the user type in.

* For sorting a file

sort -n filname >> filname.txt
This will save the sorted out put of filename to filename.txt

* UNIX is one of the first operating systems to make the user interface independent
of the operating system.

** Bourne shell, K shell,

* To install bash as your login shell, type chsh bash-name, where bash-name
is the response you got to your whereis command (or whatever worked).
For example:% chsh /usr/local/bin/bash

* lp ==command used for printing

* WILD CARDS:

? == ANY SIGNLE CHARACTER
* == aNY STRING OF CHARACTER
[set] == any characher in set

Brace []:

b{ar{d,n,k},ed}s. == >> out puts bards,barns,barks,beds


** cat < file1 > file2 This similaer tp cp file1 file2

** CUT command:

grep usernames from /etc/passwd file

cat /etc/passwd | cut -d: -f1 >> test1


** To print natural numbers:

for i in `seq 1 10`;do echo $i;done;


ECHO:

echo string ==>> o/put as string
echo 'string' ==>> o/put as string
echo "string" ==>> o/put as string

echo 2 * 2 > 3 == o/put as a file with name 3 and containing all the file names in the
current directory including 2.

echo '2 * 2 > 3' == >> o/put as 2 * 2 > 3

echo " 2 * 2 > 3 " == >> o/put as 2 * 2 > 3


Most popular unix editors:
vi and emacs

Word press MU or WordPressµ

Wordpress MU is or WordPressµ is multi user version of wordpress.It is useful for peples who wants to set up a large networs of blogs.It is used in newspapers, magazines etc.

Using the WordPress multi-user edition, you will be able offer users an opportunity to sign up for a new blog. They will be able to securely manage their templates and settings without affecting any other users. You can have unlimited users with unlimited blogs, and users can have various roles (administrator, editor, author, contributor, subscriber) on each other's blogs. One or more Site Administrators can perform site-wide management tasks, including adding users and blogs, altering permissions and granting access to themes.

WordPress MU Plugins and Themes are controlled by a central system administrator. Unlike the single-user version of WordPress, individual WPMU bloggers cannot upload their own WordPress Plugins and Themes. The users can only select from the ones made available by the system administrator. Individual themes can be made available to all blogs or just to specific ones.

Tuesday, July 27, 2010

How to tar multiple files

To group multiple files : tar -cvf foo.tar a.dat b.dat c.dat ( this will group files [a-c]*.dat to one file foo.tar )
c = create a tar file
v = verbose( nothing important :P )
f = create the tar file with filename provided as the argument

Thats all you need to know to tar(group) a bunch of files/directories.

* To tar files and gzip them : tar -czf foo.tar.gz *.dat ( this will create a gzip-compressed Tar file of the name foo.tar.gz of all files with a .dat suffix in that directory )

* To untar(separate) files from a tar archive : tar -xvf foo.tar ( this will produce three separate files a.dat, b.dat and c.dat )

* To untar(extract) a gzipped tar archive file : tar -xzf foo.tar.gz

* To untar a bzipped (.bz2) tar archive file : tar -xjf foo.tar.bz2

Tuesday, July 20, 2010

Iframe attack

find . -type f -exec replace '' '' -- {} \;

eg: find . -type f -exec replace '
' '' -- {} \;

Thursday, July 8, 2010

cpanel backup with wget

wget --http-user=YourUsername --http-password=YourPassword http://YourWebsiteUrl:2082/getbackup/backup-YourWebsiteUrl-`date +"%-m-%d-%Y"`.tar.gz