Skip to content

Instantly share code, notes, and snippets.

View josedaniel's full-sized avatar
Building.

José Daniel Paternina josedaniel

Building.
View GitHub Profile
@remy
remy / gist:350433
Created March 31, 2010 14:58
Storage polyfill
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
@josedaniel
josedaniel / md5.js
Created May 2, 2011 14:21
Javascript MD5 Tool
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
/*
@anabelle
anabelle / commands-to-find-malware.sh
Created December 16, 2011 02:17
Shell commands to help finding infections in website files
# files modified within 30 days.
find /home/mywebsite -type f -name "*.php" -ctime -30
# find for suspicious strings
find ./ -name "*.php" -type f | xargs sed -i 's#<?php /\*\*/ eval(base64_decode("aWY.*?>##g' 2>&1
find ./ -name "*.php" -type f | xargs sed -i '/./,$!d' 2>&1
# grep for suspicious and very long strings
grep -R "document.write(unescape" *
grep -iR --include "*.js" "[a-zA-Z0-9\/\+]\{255,\}" *
@anabelle
anabelle / gist:1515478
Created December 23, 2011 22:01 — forked from ofan/gist:1508676
comon passwords
123456789
12345678
11111111
dearbook
00000000
123123123
1234567890
88888888
111111111
147258369
@anabelle
anabelle / sshadd.sh
Created December 25, 2011 01:58
add ssh key to server
# Agregar esto a .bashrc o a .bash_aliases
# Uso: add_ssh usuario@servidor.tld
function add_ssh {
cat ~/.ssh/id_rsa.pub | ssh $1 'cat >> .ssh/authorized_keys'
}
export -f add_ssh
@anabelle
anabelle / aircrack-cheatsheet.sh
Created January 13, 2012 01:33
Aircrack suite steps
# iniciar monitor
sudo airmon-ng start wlan0
# ver redes
sudo airodump-ng mon0
# Obtener handshake (reemplazar canal y MAC
sudo airodump-ng -c 3 -w wpa --bssid 00:00:00:00:00:00 mon0
# Forzar handsahake
@anabelle
anabelle / codeigniter_sengrid_parse_api_upload.php
Created January 21, 2012 23:29
Function to get an email using Sendgrid Parse API and save attachments using CodeIgniter
<?php
# CI Reference: http://codeigniter.com/user_guide/libraries/file_uploading.html
# SendGrid Reference: http://docs.sendgrid.com/documentation/api/parse-api-2/
public function input(){
//file upload configuration
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|jpeg';
$config['max_size'] = '8192';
$config['max_width'] = '0';
@josedaniel
josedaniel / ssh.sh
Created May 22, 2012 22:24
Meterse al ssh del servidor remoto
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> ~/.ssh/authorized_keys'
@josedaniel
josedaniel / input.css
Created June 26, 2012 20:31
CSS custom inputs
/* CUSTOM FORM CONTROLS */
input[type="text"],input[type="password"]{
font-size:13px;
padding: 3px 7px;
border:none;
box-shadow: inset 0 1px 2px #999;
outline: none;
color:#444;
margin-right:10px;
border-bottom: 1px solid #eee;
@josedaniel
josedaniel / README.md
Created February 10, 2014 23:06 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/