Skip to content

Instantly share code, notes, and snippets.

View solancer's full-sized avatar
🎯
Focusing

Srinivas Gowda solancer

🎯
Focusing
View GitHub Profile
@solancer
solancer / Laravel-Perm.sh
Last active December 19, 2017 16:37 — forked from ClaudioVarandas/laravel_perm.sh
Laravel permissions
# add sudo user to www-data group
# usermod on your user. So that would be
sudo usermod -aG www-data srinivas
# set perms with sudo user in accordance with apache user
sudo chown -R srinivas:www-data .
# change group perms of storage and cache folder to exlcusively support only apache user
sudo chgrp -R www-data storage bootstrap/cache
# declare user and group permissions on the same
sudo chmod -R ug+rwx storage bootstrap/cache
# unmask hack to set www-data for newly created files
@solancer
solancer / breakpoints.css
Created September 13, 2017 07:46
CSS Grid Breakpoints
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
/* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) {
@solancer
solancer / contact-ajax.js
Created September 30, 2017 20:52
Generic contact form AJAX function
$(document).ready(function() {
$("#contactForm").submit(function(e) {
e.preventDefault();
var o = $(this).serializeArray(),
t = $(this).attr("action"),
i = $("#contactFormResponse"),
n = $("#cfsubmit");
n.text();
return n.text("Sending..."), $.ajax({
url: t,
@solancer
solancer / php-mass-mailer.php
Created October 1, 2017 00:53 — forked from jonaslejon/php-mass-mailer.php
PHP Mass Mailer
<?php
/*
The code below was found during a forensic investigation. It seems to be a mass mailer that is using the PHPMailer class to send mail
from compromised web hosting providers.
The "password" is 5307c392-ad5e-4909-adec-c9fd12572686, see below.
Investigation was made by Jonas Lejon <jonas.githubgist at- triop.se>
The signature for PHP.Trojan.Mailer-1 can only find the packed version of this file.
@solancer
solancer / bash_rc
Created October 7, 2017 11:58
Composer On MAMP
PHP_VERSION=`ls /Applications/MAMP/bin/php/ | sort -n | tail -1`
alias composer='php /Applications/MAMP/bin/php/${PHP_VERSION}/bin/composer.phar'
export PATH=/Applications/MAMP/bin/php/${PHP_VERSION}/bin:$PATH export
@solancer
solancer / script.js
Created October 20, 2017 22:52
jQuery Ajax Form With FIle Attachement
<script>
jQuery(document).ready(function() {
jQuery("#proform").submit(function(e) {
e.preventDefault();
var o = jQuery(this).serializeArray(),
t = jQuery(this).attr("action"),
i = jQuery("#formResponse"),
n = jQuery("#cfsubmit"),
form_data = new FormData(jQuery('#proform')[0]);
n.text();
#!/bin/bash -ex
# SETUP PERMISSIONS
VPATH=${1%/}
GROUP_WEBWORK=${2}
WEBSERVER="www-data"
HELP="\nHelp: This script is used to fix permissions\nPlease provide the following arguments:\n\t 1) Path to web root\n\t 2) Shared workgroup of website. AKA group ownership\nNote: \"www-data\" (apache default) is assumed as the owner of the web files.\n\nUsage: [sudo] bash ${0##*/} [web_root_path] [group_name]\n"
[ -z "$VPATH" ] && VPATH=`pwd` # is null, use present dir
[ -z "$GROUP_WEBWORK" ] && GROUP_WEBWORK=webwork # is null, set default
@solancer
solancer / cpasteenable.js
Created February 19, 2018 20:07
Javascript console code to enable pasting text on sites that block it
var allowPaste = function(e){
 e.stopImmediatePropagation();
 return true;
};
document.addEventListener('paste', allowPaste, true);
@solancer
solancer / API.md
Last active February 20, 2018 10:23 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: