Skip to content

Posts by Filipe Teixeira

27
Mai

tinyjs

http://tinyjs.com/tags/jquery

27
Mai

pack de icons

Página com vários icones , para uti­lizar em apli­cações web.

Barra de ferramentas.

http://www.famfamfam.com/archive/

12
Mai

10 Livros gratuitos para iniciar em linux.

Nestes livros pode encon­trar, boa infor­mação para quem se está a ini­ciar no linux, ou se já é uti­lizador do mesmo.

1) Intro­duc­tion to Linux – A Hands on Guide

Author: Machtelt Gar­rels
For­mat: HTML

2) Bash Guide for Beginners

Author: Machtelt Gar­rels
For­mat: HTML

3) Rute User’s Tuto­r­ial and Exposition

Author: Paul Sheer
For­mat: HTML

4) The Linux Starter Pack

Author: Paul Hud­son
For­mat: PDF

5) FLOSS Man­u­als

Author: FSF
For­mat: HTML & PDF

6) The Eas­i­est Linux Guide You’ll Ever Read

Author: Scott Mor­ris
For­mat: PDF

7) Linux Knowl­edge Base and Tutorial

Author: James Mohr
For­mat: PDF

8) Ubuntu Pocket Guide and Reference

Author: Keir Thomas
For­mat: PDF

9) Linux New­bie Admin­is­tra­tor Guide

Author: Peter and Stan Kli­mas
For­mat: HTML

10) Slack­ware Linux Basics

Author: Daniël de Kok
For­mat: HTML

Fonte: www.linuxhaxor.n

12
Mai

Script simples para backup de BD MySQL

Nos últi­mos dias estou até apren­dendo um pouco mel­hor shell script para imple­men­tar um scrip­tiz­inho de backup de banco de dados MySQL.

O script é bem sim­ples, faz um dump em um arquivo SQL, com­pacta e apaga o SQL (deixando só o arquivo com­pactado). Para ficar mais diver­tido, man­dei ele apa­gar os back­ups anti­gos (man­tém só os 10 últi­mos (exagero!)) e man­dar e-mails avisando o sta­tus do backup. Ele manda e-mails sem­pre, mas pelo código você vai ver como é sim­ples man­dar e-mails só em caso de erros. No iní­cio achei inter­es­sante man­dar e-mails sem­pre para con­fir­mar que o backup está fun­cio­nando legal.

Depois colo­quei na cron do Linux (Ubuntu) para exe­cu­tar todos os dias às 2h da manhã (que você pode con­fig­u­rar de acordo com sua necessidade).

Segue abaixo:

#!/bin/bash
U_PASTA="/home/user/backup" # < -- substitua pelo caminho onde vai salvar o backup
U_DATA=$(/bin/date +%Y%m%d%H%M%S)
U_CAMINHO="backup-$U_DATA.sql"
U_CAMINHOTAR="backup-$U_DATA.tar.gz"
U_HOST="localhost"
U_USER="root"
U_PASSWORD="********"
U_DATABASE="minha_base_mysql"
U_EMAIL="meuemail@meudominio.com.br"
#
erro=""
#
cd $U_PASTA
#
#
# Faz o backup do MySQL
#
mysqldump -h $U_HOST -u $U_USER -p$U_PASSWORD $U_DATABASE > $U_CAMINHO
if [ $? -ne 0 ]
then
    erro="Erro na geracao do SQL"
fi
#
#
# Compacta o arquivo
#
if [ "$erro" == "" ]
then
    tar zcvf $U_CAMINHOTAR $U_CAMINHO
    if [ $? -ne 0 ]
    then
        erro="Erro ao compactar o SQL"
    fi
fi
#
#
# Remove o arquivo sql que nao sera mais usado
#
if [ "$erro" == "" ]
then
    rm -f $U_CAMINHO
    if [ $? -ne 0 ]
    then
        erro="Erro ao apagar arquivo SQL temporario"
    fi
fi
#
#
# Apaga arquivos antigos e mantem apenas os 'n' ultimos
#
n=10
c=0
for i in *.tar.gz
do
    let c=$c+1
done
if [ $c -gt $n ]
then
    for i in *.tar.gz
    do
        if [ $c -le $n ]
        then
            break
        fi
        rm $i
        let c=$c-1
    done
fi
#
if [ "$erro" == "" ]
then
    erro="Backup efetuado com sucesso!"
    subject="[Sucesso]"
else
    subject="[Erro]"
fi
echo "$erro => $U_CAMINHOTAR" | mail -s "$subject Backup em $(/bin/date +'%d/%m/%Y %H:%M:%S')" $U_EMAIL
#
# Volta para a pasta anterior
cd -

Para agen­dar a exe­cução, digite:

$ crontab -e

Vai abrir um edi­tor de texto com o arquivo de con­fig­u­ração da cron. Daí você pode dig­i­tar algo como:

# m h  dom mon dow   command
00 02 * * * /home/user/backup_bd.sh

Onde backup_bd.sh é o arquivo do script que pas­sei acima.

É isso. Espero que seja útil.

PS: Mod­i­fiquei algu­mas coisas na hora de pub­licar para não expor minha base, daí espero que não tenha cometido nen­hum erro.

Outro PS: O script é meio amador, mas fun­ciona legal. A base que faço backup gera um arquivo sql de 117Mb, com­pactado cai para 18Mb, e tudo isso em cerca de 15 segun­dos

via: Andre Noel

12
Mai

Howto run a script when a USB device IS Pluged

howto run a script when a USB device is pluged in

This explains how you could run a script made by you (say /usr/local/my_script) when you plug a spe­cific USB device.

1. First run lsusb to iden­tify your device. Exam­ple:
$lsusb
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 040a:0576 Kodak Co.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000

2. After doing this you know that
– the ven­dor ID of your device is 040a
– the prod­uct ID of your device is 0576

3. Now is time to cre­ate your UDEV rule:

Code:
sudo nano /etc/udev/rules.d/85-my_rule.rules

4. And add the text

Code:
ACTION=="add", SUBSYSTEM=="usb_device", SYSFS{idVendor}=="040a", SYSFS{idProduct}=="0576", RUN+="/usr/local/my_script"
Expla­na­tion:
When the usb_device prod­uct iden­ti­fied as 0576 of ven­dor 040a is added, run /usr/local/my_script
Note that ‘==’ and “!=” are com­para­tors, while = and += are assingments
24
Abr

jCarousel

Rid­ing carousels with jQuery

Author: Jan Sor­galla
Ver­sion: 0.2.3 (Changelog)
Down­load: jcarousel.tar.gz or jcarousel.zip
Licence: MIT and GPL
Doc­u­men­ta­tion: http://sorgalla.com/projects/jcarousel/

jCarousel is a jQuery plu­gin for con­trol­ling a list of items in hor­i­zon­tal or ver­ti­cal order. The items, which can be sta­tic HTML con­tent or loaded with (or with­out) AJAX, can be scrolled back and forth (with or with­out animation).

Exam­ples

The fol­low­ing exam­ples illus­trate the pos­si­bil­i­ties of jCarousel:

23
Abr

download ubuntu jaunty jackalope 9.04

Hoje saiu a nova ver­são do ubuntu jack­a­lope 9.04 , já actu­al­izei as min­has ver­sões do ubuntu até agora cor­reu tudo bem.

Para  con­seguirem a ultima ver­são do ubuntu gra­tuita e legal sigam este link :

http://www.ubuntu.com/getubuntu/download

ou

http://darkstar.ist.utl.pt/ubuntu/releases/9.04/

Novi­dades:

1) Gnome 2.26 desk­top envi­ron­ment, which includes the fol­low­ing new fea­tures:

a) brasero, an all-in-one CD burn­ing appli­ca­tion.
b) Improved multi-monitor han­dling.

2) X.Org server 1.6, which sup­ports sev­eral new video cards, as well as ATI-specific per­for­mance improve­ments includ­ing EXA accel­er­a­tion by default, 2D sup­port for R6xx/R7xx, 3D sup­port for R5xx cards, along with an updated –fglrx pro­pri­etary dri­ver for R6xx/R7xx 3D sup­port.

3) New noti­fi­ca­tion style and pref­er­ences.
4) Boot per­for­mance is “sig­nif­i­cantly improved”.
5) Linux ker­nel 2.6.28–11.37, which is based on 2.6.28.8.
6) Ext4 file sys­tem sup­port.

7) Server edi­tion includes sup­port for cloud com­put­ing via Euca­lyp­tus, an open source tech­nol­ogy which is included in Ubuntu as a tech­nol­ogy pre­view, enables you to use your own servers to deploy, exper­i­ment and test your own pri­vate cloud that matches the Ama­zon EC2 API.

8) Turn-key mail servers with the dovecot-postfix pack­age, which sup­ports SMTP, POP3 and IMAP with TLS and SASL.  “

23
Abr

Backup MySQL em servidor remoto

Backup entre dois servi­dores  [Local] e [Remote].

mysql­dump –u USERNAME –pPASS­WORD nome-da-db >/home/mysqlbak/mysqldump.sql
rsync –avz /home/mysqlbak/mysqldump.sql username@ip-do-servidor-remoto:/home/mysqlbak/mysqldump.sql

Podem ler mais neste post: http://www.webkaput.com/backup-em-servidor-remoto/

22
Abr

Oracle compra Sun

O negó­cio entre a Sun e a Ora­cle acaba de ser anun­ci­ado e anal­is­tas começam a dis­cu­tir qual será o futuro do MySQL, base de dados.

Como exem­plo nada mel­hor que este comando sql.

BEGIN;
INSERT INTO ora­cle (SELECT interesting_stuff FROM sun WHERE likely_to_make_money = 1);
DROP sun; COMMIT; http://ginx.com/-50VNH

20
Abr

Eight Great Ways to Share Slides Online

Begin with a Pow­er­Point:

1. SlideShare is prob­a­bly the best known and most used presentation-sharing plat­form. LOTS of pre­sen­ta­tions to view, and options for post­ing your own either pub­licly or pri­vately. There are easy con­nec­tions to LinkedIn and Face­book. SlideShare accepts Pow­er­Point, Open Office and Keynote pre­sen­ta­tions, but does not pre­serve ani­ma­tion, tran­si­tions, or nar­ra­tion, and does not sup­port embed­ded audio or video.

slideshare

2. Slide­Boom con­verts Pow­er­Point to Flash, and will pre­serve move­ment and sound. The site offers search-and-share capa­bil­i­ties sim­i­lar to SlideShare, along with a Blog Side­bar Wid­get and a free Pow­er­Point add-in (iSpring) that enables you to con­vert a pre­sen­ta­tion to Flash in Pow­er­Point. A basic Slide­Boom account is free, and there is also a Pro account that includes more stor­age and added fea­tures for $99 a year. Slide­Boom also offers sophis­ti­cated busi­ness solutions.

slideboom

3.  SlideServe is very sim­i­lar to the basic ver­sion of Slide­Boom.

slideserve

4.  Scribd is quite dif­fer­ent from the first three plat­forms listed. It’s a very pop­u­lar (50 mil­lion view­ers a month) doc­u­ment pub­lish­ing site that enables users to upload all sorts of file formats—including Pow­er­Point presentations–for con­ver­sion to iPa­per, a beau­ti­ful online read­ing for­mat. Scribd also pro­vides sophis­ti­cated com­mu­nity and search tools, plus an iPa­per viewer that can be embed­ded on your own web­site. Scribd does not sup­port any tran­si­tions, ani­ma­tion or embed­ded media in presentations.

scribd

Can begin with­out a PowerPoint:

5.  208 Slides is some­thing of a hybrid, and the main goal seems to be sim­plic­ity. It lets you cre­ate and share slides via its online application–which is pretty basic–or you can upload a Pow­er­Point pre­sen­ta­tion and then enhance it, using a stream­lined inter­face and tools that let you gather media eas­ily. Then you can send the fin­ished pre­sen­ta­tion to SlideShare, or down­load it to Pow­er­Point. No tran­si­tions or animation.

208-slides

6.  Slid­e­Rocket is intended as a replace­ment, not an accom­pa­ni­ment, for Pow­er­Point. It offers a fully func­tional pre­sen­ta­tion devel­op­ment appli­ca­tion, with stun­ning 3-D tran­si­tion effects. Although you can store and share pre­sen­ta­tions via Slide Rocket, there is no social platform—the focus is on cre­ation. The basic account is free, with addi­tional account lev­els (that include extra fea­tures like web meet­ings and pre­sen­ta­tion ana­lyt­ics) avail­able at $10 and $20 per month.

sliderocket

7.  Slide doesn’t cre­ate con­ven­tional slideshows at all, and has noth­ing to do with Pow­er­Point. It lets you cre­ate a “show” con­tain­ing images (which you upload or select from a social media site), then apply an effect (such as rotat­ing the images, col­lag­ing them, melt­ing them, etc.) and option­ally add audio from Slide’s music library. The images then play in the slide space, which is inside a “skin” that can be cus­tomized (for exam­ple, the images can play on a drive-in movie screen). Finally, you post the show on one or more social media accounts, or get the code and embed it on your own site, or email it. Slide defines itself as a “social enter­tain­ment application.”

slidecom

8.  Zoho Show is part of the Zoho suite, which pro­vides a long list of online alter­na­tives to desk­top appli­ca­tions (Zoho Write, Zoho Sheet, Zoho Project, and so on). Show can start with a Pow­er­Point pre­sen­ta­tion, but pro­vides a nice toolset for cre­at­ing slides directly, includ­ing some attrac­tive themes. It repli­cates much Pow­er­Point func­tion­al­ity, but tran­si­tions and ani­ma­tion are not yet avail­able. Zoho makes it easy to export (to HTML, PDF, PPT, etc.), pub­lish, and share presentations.

zoho

fonte:tutorialblog.org

Bad Behavior has blocked 25 access attempts in the last 7 days.