CyberTek - the future at the present!
Google

Archive for the 'development' Category

Enable PCNTL form in php

Posted by: admin (Tue 14)

To enable support PCNTL in php5 (tested on Ubuntu 10.10) in the first instance it is necessary to install php5-cli and php5-dev, of course you must meet all the required dependencies from the system:

# Sudo apt-get install php5-dev php5-cli

After we have to put in the path where you can find the source of the form that we want to fill in:

# Cd / etc/php5/cli/php5-5.3.3/ext/pcntl

The path may be different, depending on the distro and version of php (/ etc/php5/cli/php5-xxxxx/ext/pcntl). But after we pass the final steps:

# Phpsize

#. / Configure

# Make

# Make install

Alternatively you can also make install to copy by hand the module you just compiled:

# Cp modules / pcntl.so / usr/lib/php5/shared_location_modules

Finally add the. Ini to load the php our form:

# Echo "extension = pcntl.so"> / etc/php5/conf.d/pcntl.ini

Do not forget to restart apache then to apply our changes:

# / Etc/init.d/apache2 restart

Published in: apache , development , php , tips , ubuntu

Script for saving to mysql databases

Posted by: admin (set 21)

Today I present to you a convenient database to automate the saving Enlarged NOSRI mysql database, in addition to the original script can be added at the end of the rescue and compression of individual databases in a few lines to copy to a remote server and a message box in our report email.

# / Bin / bash
# Shell script to backup MySql database
# To backup databases Nysql file to / backup dir and later pick up by your
# Script. You can skip Few databases from backup too.
# For more info please see (Installation info):
# Http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/01/mysql-backup-script.html
# Last updated: Aug - 2005
# -----------------------
# This is a free shell script under GNU GPL version 2.0 or above
# Copyright (C) 2004, 2005 nixCraft project
# Feedback / comment / suggestions: http://cyberciti.biz/fb/
# -------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Http://bash.cyberciti.biz/ Visit for more information.
# Updated Sep - 2007 by CyberTek - http://www.cybertek.it
# -------------------------

MyUser = "SET-MYSQL-USER-NAME" # USERNAME
Mypass = "SET-PASSWORD" # password
Myhost = "localhost" # Hostname

# Linux bin paths, change this if it can not be autodetected via Which command
MYSQL = "$ (Which mysql)"
Mysqldump = "$ (Which mysqldump)"
CHOWN = "$ (Which chown)"
CHMOD = "$ (Which chmod)"
GZIP = "$ (Which gzip)"

# Backup Dest directory, change this if You Have someother location
DEST = "/ backup"

# Main WHERE backup directory will be stored
MBD = "$ DEST / mysql"

# Get hostname
HOST = "$ (hostname)"

# Get the date format dd-mm-yyyy
NOW = "$ (date +"% d -% m -% Y ")"

# File to store current backup file
FILE = ""
# Store list of databases
DBS = ""

# DO NOT BACKUP These databases
IGGY = "test"

[! - D $ MBD] & & mkdir - p $ MBD | |:

# Only root can access it!
CHOWN $ 0.0 - R $ DEST
DEST $ CHMOD $ 0600

# Get all database list first
DBS = "$ ($ MYSQL-u $ MyUser-h myhost-p $ $ mypass-Bse 'show databases')"

for db in $ DBS
do
skipdb = - 1
if ["$ IGGY!" = ""];
then
for i in $ IGGY
do
["$ Db" = = "$ i"] & & skipdb = 1 | |:
done
fi

if ["$ skipdb" = = "-1"] then
FILE = "$ MBD / $ db. $ HOST. NOW.gz $"
# Do all inone job in pipe,
# Connect to mysql using mysqldump for select mysql database
# And pipe it out to gz file in backup dir:)
$ Mysqldump - $ MyUser u - h myhost $ - $ p mypass $ db | $ GZIP - 9> $ FILE
fi

done

# Copy on remote server
echo'******************* Example_Backup *******************'> / root / mybackup.txt
echo \>> / root / mybackup.txt
date>> / root / mybackup.txt
echo \>> / root / mybackup.txt
Details *********************''********************* echo>> / root / mybackup.txt
# Remember that the scp command can not specify the password if you have cleared a key on the target system
# Otherwise you will have to do it
scp / backup / mysql / * root@example.dom: / home / backup / example / mysql /
oh-ls / backup / mysql />> / root / mybackup.txt
echo'************************************************ * '>> / root / mybackup.txt
# Send an email with the report of the work performed
mail-s "Example Backup" example@example.dom </ root / mybackup.txt

# Remove after upload
rm-f / backup / mysql / *

Published in: development , mysql , scripts , tips

VI - Manual controls

Posted by: admin (set 11)
In this article I submit to you the legendary omnipresent on every Linux distribution. For some it is extreme, and I must admit that I misjudged those who prefer other editors like nano or a console them, but cmq for those who want to use it or for those who want to brush up on the commands have been forgotten here is a quick and useful summary of the commands:

there [filename]

Cursor movement

[N] HJK move the cursor
^ D moves the cursor 12 lines down
^ U move the cursor in the top 12 lines
^ F cursor forward one page
^ B cursor one page back
G cursor to the end of the text
[N] G cursor to line n
| Cursor to first column
[N] | n cursor to the character of the line
^ G back on the last line of information
H cursor to the first line of the screen
[N] H n cursor to the line of the screen
M cursor to center screen
The last line of the screen cursor
[N] L n cursor to the last line of the screen
[N] w cursor to next word
W as w but does not take account of punctuation
[N] b cursor to previous word
B as b but does not take account of punctuation
and cursor at the end of the word is located in
^ Cursor to first non-white
D cursor at the start line??
O cursor at the start line??
$ Cursor to end of line

SEARCH

(Pattern) search text
/ [Pattern] look forward to tpattern
? [Pattern] looks for the pattern back
n repeat search forward
N repeat search backward
/ [Pattern] / n n lines after the cursor pattern
wildcard pattern
^ Beginning of line
$ End of line
. any character
[] Holds the character
f [character] looks for the character in the current line forward
F [character] looks for the character in the current row back

ENTRIES

i insert text to the left
to insert text right of cursor
To insert the end of line
^ U move back one word insertion
@ Insert in back of what 'which' was inserted
or placement on a line below
Or posting on a line above
Esc ends insertion

CORRECTIONS

[N] x Delete character
r [character] replaces the original character with another
R replaces all characters up to data <ESC>
[N] s replaces a character with a string
dw deletes a word before the cursor
db delete one word behind the cursor
dd delete a line
D Clears' located under the cursor
cw replacing words
cf [character] changes on the current line up to (character) included
ct [character] as cf character except
cc allows you to change a line
dL remove all the lines of the screen under the cursor
dG deletes the line where the cursor is at end of file
df [character] deletes the current line from the cursor to the character within
dt [character] as df, except character

Remedy the rror

u undo
U undo Line

UNION LINE

[N] J put the line below in the tail current

Line doubler

[N] Y loads into a buffer, the current line
p Copy the lines in the buffer
retrieves the last reset

MANIPULATION OF FILES

: W saves, continues
: W <name> save with new name, continues
: X, yw <name> writes lines from x to y on file <name>
: Wq save and exit
ZZ saves and exits
Q leaves if you have made no changes
: Q! leaves
: <name> And enter into the editor view <name>
: R <name> into the text <name> the end of the line under the cursor

BOOKMARKS

m <character> create bookmark
'<character> Going to bookmark

VIDEO MANAGEMENT

^ L redraws video
z <return> puts the current line to the top of the screen
z. current line in the middle of the screen
z-line to the bottom of the screen acorrente

Published in: development , linux , shell , tips

NVU package on Ubuntu Edgy

Posted by: admin (set 2)
A richeista a player we present here the link where to download the package del'editor NVU web page. NVU is a visual editor that allows beginners and those who want to set up a web page quickly to prevent the acquisition of detailed HTML. The code generated by NVU is not totally clean like a professional would want, but it is not bad as some commercial visual editor.
NVU
The link to download the package for Ubuntu Edgy is here .
For a screenshot of the program click here .

Published in: development , ubuntu

Script to backup dvd

Posted by: admin (Aug 29)

The following script is backed up by some folders burned to DVD at the end of an email report is sent to the address indicated. He used the M-mode (append) Asthe the-Z if started in a non-interactive does not work properly in the presence of data on the media, you can try using cmq growisofs-use-the-force-luke = tty-Z even in quiet mode despite having been given some details on the media.

Example:

Create a file and make it executable:

> Touch / bin / dvdbackup.sh

> Chmod 755 / bin / dvdbackup.sh

Add the following instructions:

# / Bin / bash
# Replace the locations of the program with those of your operating system
Growisofs = / usr / bin / growisofs
ECHO = / bin / echo
GREP = / bin / grep
MAIL = / bin / mail
today = `/ bin / date +% A`
# Backup begins below
$ ECHO "Creating $ backup today">> / tmp / backupoutput.tmp
$ ECHO>> / tmp / backupoutput.tmp
$ Growisofs-use-the-force-luke = tty-dvd-compat-M / dev / dvd-D-J-R-T-l
-Graft-points-hide-joliet-long-joliet-trans-tbl
-Iso-level 4-speed = 1-overburn-V "$ today Backup"
etc / mail = / etc / mail
var / spool / mail = / var / spool / mail
home = / home
root = / root>> / tmp / backupoutput.tmp 2> & 1
# Change the save path from here on as needed
mycode = $?
$ ECHO>> / tmp / backupoutput.tmp
$ Echo "There was an error, error code: $ mycode">> / tmp / backupoutput.tmp
$ ECHO>> / tmp / backupoutput.tmp
$ Echo "End of today $ backup">> / tmp / backupoutput.tmp
$ GREP-i-v sleeping / tmp / backupoutput.tmp> / tmp/backupoutput.tmp2
$ GREP-i-v formatting / tmp/backupoutput.tmp2> / tmp / backupoutput.txt
$ MAIL-s-n "Result of the backup to DVD" usermail @ domain </ tmp / backupoutput.txt

In crontab then just add the schedule to start in invoking a backup:

> Crontab-e

Example of line to add:

0 20 * * * / bin / dvdbackup.sh

Published in: development , scripts , tips

Microsoft loses credibility with developers

Posted by: admin (June 4)

The continuous and repeated attacks by Microsoft to open source are according to Marten Mickos (Executive Director of MySQL AB ), producing a loss of credibility of the Redmond company. This article reviews in more detail.

Published in: development , microsoft

Google Web Toolkit

Posted by: admin (Jun 1)

Google Web Toolkit

Google has recently released an interesting development tool to create Ajax applications in Java.

The product description can be found at this address .

The product is constantly evolving and improving, you can download it here.

Published in: development , google , tech
Powered by CyberTek - Remote Assistance