Skip to content

Instantly share code, notes, and snippets.

View sybarite's full-sized avatar

Vivek Gounder sybarite

View GitHub Profile
@sybarite
sybarite / gist:2994745
Created June 26, 2012 09:49
Sendmail setup with mailtrap.io

Steps to setup mailtrap.io with your sendmail in ubuntu

Install sendmail and mailutils in ubuntu 'apt-get install sendmail mailutils'

In the terminal go into root prompt with sudo -s

Go to the /etc/mail folder

@sybarite
sybarite / gist:3174807
Created July 25, 2012 06:48
This gist contains the steps to resolve all and any permissions setup for apache in a linux system

Things to do after an apache installation in your *nix system

If you add yourself to group www-data to allow you to write to /var/www/ that implies you are giving the group www-data write access to /var/www/

That means apache can write to /var/www.

Which means your web site has write access to your code. This is insecure and will likely get your server owned.

If you are the only developer, why not just make the owner of /var/www/ you?

<?php
/**
* Plugin Name: Vedamore
* Plugin URI: http://vedamore.com/
* Description: Plugin to add a meta box for beads for different products
* Version: 1.6.6
* Author: Webly
* Author URI: http://webly.co
* Requires at least: 3.3
* Tested up to: 3.5
# one-liner for generating this: mysqldump --no-data -uroot magento1600 | nawk '{if(match($0, /CREATE TABLE `(.*)`/, matchesT)) { the_table = matchesT[1]; } if(match($0, /(CONSTRAINT .*),?/, matchesK) && the_table) { the_key = gensub(/,?$/, "", matchesK[1]); the_key = gensub(/^ */, "", the_key); print "ALTER TABLE `" the_table "` ADD", the_key ";"; }}'
ALTER TABLE `admin_rule` ADD CONSTRAINT `FK_ADMIN_RULE_ROLE_ID_ADMIN_ROLE_ROLE_ID` FOREIGN KEY (`role_id`) REFERENCES `admin_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `api_rule` ADD CONSTRAINT `FK_API_RULE_ROLE_ID_API_ROLE_ROLE_ID` FOREIGN KEY (`role_id`) REFERENCES `api_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `api_session` ADD CONSTRAINT `FK_API_SESSION_USER_ID_API_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `api_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `catalog_category_entity_datetime` ADD CONSTRAINT `FK_CAT_CTGR_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id
var old_timestamp = Math.floor(Date.now()/1000);
var old_timestamp2 = -1;
selected_theme[selected_key+"Loop"] = function() {
var pause;
var seconds = parseInt(getSeconds(selected_voice.time));
var timestamp = selected_theme["timestampvoice" + selected_voice.aftype] + seconds;
if (seconds == 0){
if (timestamp > old_timestamp2 && old_timestamp2 != 0) {