Skip to content

Instantly share code, notes, and snippets.

View nim4n136's full-sized avatar
🏠
Working from home

NIM4N nim4n136

🏠
Working from home
View GitHub Profile
@GhazanfarMir
GhazanfarMir / Instructions.sh
Last active May 14, 2024 03:26
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@merolhack
merolhack / centos7-set-drupal8-permissions.sh
Created December 7, 2016 20:01
Set SELinux, ACL and common permissions to Drupal 8 over CentOs 7
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
echo "0.- Reestablecer el contexto"
sudo restorecon -Rv /var/www/html
echo "1.- Cambiar propietario del webroot de Apache"
@noelboss
noelboss / git-deployment.md
Last active May 16, 2024 20:41
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@apparentlymart
apparentlymart / index.html
Created May 15, 2016 19:48
Golang and Terminal.js web terminal
<html>
<head>
<script src="/terminal.js/dist/terminal.js"></script>
<style>
#terminal {
background: #000000;
color: #ffffff;
display: inline-block;
padding: 10px;
}
@kphretiq
kphretiq / Flask-SqlAlchemy-Many-to-Many.py
Last active March 16, 2024 17:18
A (hopefully) simple demo of how to do many-to-many relationships using Flask-SQLAlchemy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from flask import Flask, url_for
from flask_sqlalchemy import SQLAlchemy
"""
Flask-SQLAlchemy many-to-many relationship using helper table
http://flask-sqlalchemy.pocoo.org/2.1/models/
Hippies love their dogs.
@jeremypage
jeremypage / ogr2ogr.cmd
Created February 3, 2015 12:46
ogr2ogr: Convert MapInfo TAB file to geoJSON (British National Grid projection)
ogr2ogr -f "GeoJSON" -a_srs "EPSG:27700" output.geojson input.TAB
@cbmd
cbmd / default.conf
Created December 9, 2012 21:13
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@ibeex
ibeex / auth.py
Created October 14, 2011 20:04
Python LDAP (ActiveDirectory) authentication
import ldap
def check_credentials(username, password):
"""Verifies credentials for username and password.
Returns None on success or a string describing the error on failure
# Adapt to your needs
"""
LDAP_SERVER = 'ldap://xxx'
# fully qualified AD user name
LDAP_USERNAME = '%s@xxx.xx' % username