Skip to content

Instantly share code, notes, and snippets.

View lucasferreira's full-sized avatar
🤓
burnweb.com.br

Lucas Ferreira lucasferreira

🤓
burnweb.com.br
View GitHub Profile
@lucasferreira
lucasferreira / optmyjpg.sh
Created October 27, 2017 13:58
Batch Image Optimization in Linux
jpegoptim --max=90 --strip-all *.jpg && chown www-data.www-data *.jpg && chmod 755 *.jpg
@lucasferreira
lucasferreira / find_wordpress_suspect_files.sh
Created July 13, 2017 19:30
Procura por arquivos estranhos em instalações de Wordpress
find . -type f -name '*.php' | xargs grep -i "x29" --color
find . -type f -name '*.php' | xargs grep -i "str_root13 *(" --color
find . -type f -name '*.php' | xargs grep -i "eval *(str_rot13 *(base64_decode *(" --color
find . -type f -name '*.php' | xargs grep -i "gzinflate *(" --color
find . -type f -name '*.php' | xargs grep -i "str_rot13 *(" --color
find . -type f -name '*.php' | xargs grep -i "base64_decode *(" --color
find . -type f -name '*.php' | xargs grep -i "eval *(" --color
@lucasferreira
lucasferreira / restore_mysql.sh
Created July 4, 2016 17:36
Restore MySQL UTF-8 database
mysql -uUSERNAME -pPASSWORD --default_character_set utf8 DATABASE_NAME < file.sql
(function(window){
var EVENT_EXISTS = 'GlobalEvents: Event already exists.';
var eventIsRunning,
_eventStack,
_findByName,
stackEvent,
removeEvent,
eventListener,
<?php
/*
###############################################
#### ####
#### Author : Harish Chauhan ####
#### Date : 31 Dec,2004 ####
#### Updated: ####
#### ####
###############################################
@lucasferreira
lucasferreira / install_oci8.sh
Created October 13, 2014 16:23
Installing OCI8 (Oracle) + PHP + Ubuntu
# Download Instant Client RPMs (basic + devel):
# http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
sudo apt-get install alien
sudo apt-get install libaio1
sudo apt-get install php5-dev build-essential php-pear
sudo alien oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
sudo alien oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
@lucasferreira
lucasferreira / zerofill.js
Created September 13, 2014 19:06
Fill a number or string with zeroes (pad number with [n] zeroes)
/* Autor: Lucas Ferreira - http://blog.lucasferreira.com | Usage: fz(9) or fz(100, 7) */
function fz(o, s) {
for(var s=Math.max((+s||2),(n=""+Math.abs(o)).length); n.length<s; (n="0"+n));
return (+o < 0 ? "-" : "") + n;
};
/**
* requestAnimationFrame polyfill by Erik Möller & Paul Irish et. al.
* https://gist.github.com/1866474
*
* http://paulirish.com/2011/requestanimationframe-for-smart-animating/
* http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
**/
/*jshint asi: false, browser: true, curly: true, eqeqeq: true, forin: false, newcap: true, noempty: true, strict: true, undef: true */
<!doctype html>
<html lang="en" class="breakpoint-medium">
<head>
<meta charset="utf-8">
<title>Metaquery Boilerplate</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<meta name="breakpoint" content="small" media="(max-width: 480px)">
<meta name="breakpoint" content="medium" media="(min-width: 481px) and (768px)">
server {
listen 80;
listen [::]:80;
server_name domain.com;
autoindex off;
index index.php index.html;
root /srv/www/domain.com/public;