Skip to content

Instantly share code, notes, and snippets.

View amitjindal's full-sized avatar
🚀
Building SAAS Products

Amit Jindal amitjindal

🚀
Building SAAS Products
View GitHub Profile
References: https://gist.github.com/noelboss/3fe13927025b89757f8fb12e9066f2fa
More info: https://www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks
https://www.youtube.com/watch?v=6mYtJu0E47U
[misc commands deluser newuser]
The following steps is for Developers to push their code from their local machine, to their server with git, and let git auto
pull the update to your remote folder. How it works:
- From your local machine, you do your normal coding. When done, you push your new code to git
- Git then updates your local machine, and push it to your server's git
- Git on your server gets the new update, and push it to your server's working folder
@amitjindal
amitjindal / jail.local
Created May 1, 2020 17:30 — forked from pferrarezi/jail.local
[fail2ban] Improved nginx-badbots
# Copy file /etc/fail2ban/jail.conf to /etc/fail2ban/jail.local
# Add to file: /etc/fail2ban/jail.local
[nginx-badbots] # stop some known malicious bot request patterns:
enabled = true
port = http,https
filter = nginx-badbots
logpath = %(nginx_access_log)s
maxretry = 1
@amitjindal
amitjindal / jail.local
Created May 1, 2020 17:29 — forked from dale3h/jail.local
[fail2ban] Improved nginx-badbots
# Add to file: /etc/fail2ban/jail.local
[nginx-badbots]
enabled = true
port = http,https
filter = nginx-badbots
logpath = %(nginx_access_log)s
maxretry = 1
findtime = 604800
bantime = 604800
@amitjindal
amitjindal / forms.py
Created December 15, 2019 15:19 — forked from neara/forms.py
Django Class Based Views and Inline Formset Example
from django.forms import ModelForm
from django.forms.models import inlineformset_factory
from models import Sponsor, Sponsorship
class SponsorForm(ModelForm):
class Meta:
model = Sponsor
@amitjindal
amitjindal / purgecss-tailwind-gulp-example.js
Created July 14, 2019 17:59 — forked from taylorbryant/purgecss-tailwind-gulp-example.js
Use PurgeCSS with Tailwind & Gulp (Inspired by @andrewdelprete)
const gulp = require('gulp');
const tailwindConfig = "tailwind.js"; /* Path to Tailwind config */
const mainCSS = "src/style.css"; /* Path to main stylesheet */
/**
* Custom PurgeCSS Extractor
* https://github.com/FullHuman/purgecss
*/
class TailwindExtractor {
static extract(content) {
@amitjindal
amitjindal / spacemacs-cheshe.md
Last active February 19, 2019 11:13 — forked from robphoenix/spacemacs-cheshe.md
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
@amitjindal
amitjindal / cache-warmer.py
Created April 27, 2018 06:53 — forked from hn-support/cache-warmer.py
A threaded cache warmer in python
#!/usr/bin/env python
"""
Warm the caches of your website by crawling each page defined in sitemap.xml.
To use, download this file and make it executable. Then run:
./cache-warmer.py --threads 4 --file /data/web/public/sitemap.xml -v
"""
import argparse
import multiprocessing.pool as mpool
import os.path
import re
@amitjindal
amitjindal / gist:7438c62f3f62588b023910310711edea
Created November 2, 2017 17:30 — forked from evildmp/gist:3094281
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@amitjindal
amitjindal / magento-code-snippets.md
Created January 18, 2017 03:09 — forked from arosenhagen/magento-code-snippets.md
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name