Skip to content

Instantly share code, notes, and snippets.

View ankitsam's full-sized avatar
🥂
Cheers

Ankit Sharma ankitsam

🥂
Cheers
View GitHub Profile
@armetiz
armetiz / 01_1_wkhtmltopdf_dependencies.config
Created May 7, 2019 14:21
wkhtmltox-0.12.5-1 AWS ElasticBeanstalk AMI 2018.03
packages:
yum:
zlib: []
fontconfig: []
freetype: []
libX11: []
libXext: []
libXrender: []
xorg-x11-fonts-75dpi: []
xorg-x11-fonts-Type1: []
@ntamvl
ntamvl / ubuntu-16-increase-maximum-file-open-limit-ulimit-n.md
Last active July 26, 2021 10:06
Ubuntu 16 – how to increase maximum file open limit ( ulimit -n )

Ubuntu 16 – how to increase maximum file open limit ( ulimit -n )

If you are setting up nginx,chances are you will discover your worker_connections is at some low number, such as 1024. You can’t increase this number unless you increase kernel limit as well. First of all run cat /proc/sys/fs/file-max to discover your maximum limit.

abc@ubuntu:~$ cat /proc/sys/fs/file-max
1048576
abc@ubuntu:~$ ulimit -n
1024
@ankitsam
ankitsam / ec2_mysql_public_html_backup.sh
Last active July 29, 2021 22:52
Shell Script for daily backup EC2(Ubuntu) - Separate websites & MySql databases zips to S3
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Variables
USER="root"
PASSWORD=""
OUTPUT="/home/ubuntu/backups"
WWW="/var/www/*"
BUCKET="Backup-Bucket"
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active April 25, 2024 12:11
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

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/
@markrickert
markrickert / SafeZendTransactionsMysql.php
Created September 14, 2011 14:49
Safely Handling Mysql Transactions in Zend
<?php
// the below code assumes you have the private/protected
// variable $this->_db set to your database adapter.
// begin the transaction
$this->_db->beginTransaction();
try {
// mock insert into a user table
$result = $this->_db->insert('users', array(
@davidalexander
davidalexander / gist:1086455
Last active September 7, 2023 07:42
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

@balupton
balupton / README.md
Last active April 20, 2022 13:21
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
@jakebellacera
jakebellacera / ICS.php
Last active April 19, 2024 09:06
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*