This file contains 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
# prefix | |
export PS1="\[$(tput setaf 7) $(tput setab 1)\][\@]\[$(tput bold)\] [\u@\H: \w] # \[$(tput sgr0)\]" | |
# environment variable | |
export PATH=$PATH:$HOME/bin/ | |
# remove duplicates from history | |
export HISTCONTROL=ignoreboth | |
# colors |
This file contains 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
# update our entry with our ip | |
wget -qO- https://api.linode.com/?api_key=KEY\&api_action=domain.resource.update\&domainid=DOMAINID\&resourceid=RESOURCEID\&Target="[remote_addr]" | |
# | |
# in case you don't have your Domain ID on hand, you would need to run the following command first: | |
# wget -qO- https://api.linode.com/?api_key=APIKEY\&api_action=domain.list | tr ',' '\n'``` | |
# | |
# afterwards, we can get the ResourceID via: | |
# wget -qO- https://api.linode.com/?api_key=APIKEY\&api_action=domain.resource.list\&domainid=DOMAINID| tr ',' '\n'``` | |
# |
This file contains 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/bash | |
USER=$1 | |
SERVER=$2 | |
FILE_PATH=$3 | |
ssh $USER@$SERVER "cat $FILE_PATH" | tar zxvf - |
This file contains 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/bash | |
tar -cvpzf /backup/backup$(date +%d-%m-%Y).tar.gz --exclude=backup --exclude=bin --exclude=boot --exclude=dev --exclude=etc --exclude=lib --exclude=lost+found --exclude=media --exclude=mnt --exclude=opt --exclude=proc --exclude=sbin --exclude=selinux --exclude=srv --exclude=sys --exclude=tmp --exclude=usr --exclude=var/backup --exclude=var/backups --exclude=var/cache --exclude=var/crash --exclude=var/lib --exclude=var/local --exclude=var/lock --exclude=var/log --exclude=var/mail --exclude=var/opt --exclude=var/run --exclude=var/spool --exclude=var/tmp --exclude=var/vmail / |
This file contains 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/bash | |
ls /boot/ | grep vmlinuz | sed 's@vmlinuz-@linux-image-@g' | grep -v `uname -r` > /tmp/kernelList | |
for I in `cat /tmp/kernelList` | |
do | |
aptitude remove $I | |
done | |
rm -f /tmp/kernelList | |
update-grub |
This file contains 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
#!/opt/local/bin/php | |
<?php | |
/* | |
1) replace the shebang (first line) with the path to your php binary | |
(probably something like /usr/bin/php) | |
2) move the file to /usr/local/bin/datauri.php | |
(this should be in your PATH) | |
3) chmod ugo+rx /usr/local/bin/datauri.php | |
(make the script executable for everyone) |
This file contains 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
<?php | |
// Strip HTML characters from a given text. | |
$text = htmlspecialchars(strip_tags($input)); | |
// Remove links from a string | |
$string = preg_replace('/\b(https?|ftp|file:(\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $string); | |
//detect iPhone/iPod/iPad | |
if(strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'],'iPod')) { |
This file contains 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
{ | |
"files": | |
{ | |
"Dojo": "http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js", | |
"MooTools": "http://mootools.net/download/get/mootools-core-1.4.5-full-compat-yc.js", | |
"PrototypeJS": "https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js", | |
"jQuery": "http://code.jquery.com/jquery.min.js", | |
"jQueryUI": "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js", | |
"normalize.css": "https://github.com/necolas/normalize.css/raw/master/normalize.css", | |
"jquery": "http://code.jquery.com/jquery.min.js", |
This file contains 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
<!-- first try HTML5 playback: if serving as XML, expand `controls` to `controls="controls"` and autoplay likewise --> | |
<!-- warning: playback does not work on iOS3 if you include the poster attribute! fixed in iOS4.0 --> | |
<video width="640" height="360" controls> | |
<!-- MP4 must be first for iPad! --> | |
<source src="__VIDEO__.MP4" type="video/mp4" /><!-- Safari / iOS video --> | |
<source src="__VIDEO__.OGV" type="video/ogg" /><!-- Firefox / Opera / Chrome10 --> | |
<!-- fallback to Flash: --> | |
<object width="640" height="360" type="application/x-shockwave-flash" data="__FLASH__.SWF"> | |
<!-- Firefox uses the `data` attribute above, IE/Safari uses the param below --> | |
<param name="movie" value="__FLASH__.SWF" /> |
This file contains 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
$('form').validate( | |
{ | |
rules: { | |
numero: { | |
required: true | |
}, | |
descricao: { | |
minlength: 3, | |
email: true, | |
required: true |
OlderNewer