Skip to content

Instantly share code, notes, and snippets.

View gunjanpatel's full-sized avatar

Gunjan Patel gunjanpatel

View GitHub Profile
@Shebo
Shebo / README.md
Last active August 29, 2015 14:02 — forked from aronwoost/README.md

Launch the instance and connect with ssh.

##Update the server

sudo yum update

##Install php and MySQL packages

@phproberto
phproberto / sample.php
Last active December 17, 2015 12:39
Retrieve JForm post data with JInput
<?php
// Required objects
$input = JFactory::getApplication()->input;
// Get the form data
$formData = new JRegistry($input->get('jform', '', 'array'));
// Get any data being able to use default values
$id = $formData->get('id', 0);
// original from: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
// original gist: https://gist.github.com/willpatera/ee41ae374d3c9839c2d6
function doGet(e){
return handleResponse(e);
}
// Enter sheet name where data is to be written below
var SHEET_NAME = "Sheet1";
@jcarolinares
jcarolinares / useful_commands_to_use_in_shell.md
Last active February 3, 2023 02:23
This is a simple guide for non-pro bash users to do random but annoying tasks in just seconds

Useful commands to use in Shell or others:

This is a simple guide for non-pro bash users to do random but annoying tasks in just seconds

Your boss will be happy and you'll be less stressed ;)

Files

Search a file name using a string:

@pixeline
pixeline / php_upgrade_to_71.sh
Last active March 16, 2023 16:49
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
@dominicsayers
dominicsayers / postfix-dovecot-subdomains.md
Last active April 10, 2023 17:39
Installing Postfix & Dovecot on a fresh Amazon EC2 Ubuntu Server 12.10 instance and setting it up so all mail to all subdomains goes to one local user with IMAP access.

Instance setup

  1. Make sure the security group is allowing through any ports you need for SMTP & IMAP. Also open port 10000 for Webmin.
  2. You'll want to give it an Elastic IP address so it doesn't wander aimlessly round the IPv4 address space.

Webmin setup

  1. sudo apt-get install ntp ntpdate dkms htop - optional: these are just my favourite things
  2. sudo pico /etc/apt/sources.list and add at the end:
@sanderpotjer
sanderpotjer / edit.php
Last active May 5, 2023 03:08
Template override for improved Joomla article submission form
<?php
/**
* @package Article Form override for Joomla 3
* @copyright Copyright (c) 2014 Sander Potjer - www.perfectwebteam.nl
* @license GNU General Public License version 3 or later
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
@tronsha
tronsha / installphp7.sh
Last active October 13, 2023 00:13
Install PHP7 to Ubuntu
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
apt-get update
apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make
mkdir -p /etc/php7/conf.d
mkdir -p /etc/php7/cli/conf.d
mkdir /usr/local/php7
@gboudreau
gboudreau / install-ffmpeg-amazon-linux.sh
Last active November 21, 2023 19:48
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@phedoreanu
phedoreanu / apache ssh keys
Last active January 25, 2024 17:34
git PHP webhook
sudo mkdir -m 0700 /var/www/.ssh
sudo chown -R apache:apache /var/www/.ssh
sudo -u apache ssh-keygen (empty passphrase)
paste public key into repo manager
(git-repo) sudo -u apache git pull origin branch (this will create /var/www/.ssh/known_hosts)
call git_hook.php?branch=xxx