Skip to content

Instantly share code, notes, and snippets.

View Lapicher's full-sized avatar
🤓

Nataly Contreras Lapicher

🤓
  • CIDESI
  • Querétaro, méxico.
View GitHub Profile
@ryanwoodsmall
ryanwoodsmall / lkvh.c
Created October 25, 2017 07:02
get linux kernel version from linux/version.h header and uname() syscall
#include <stdio.h>
#include <linux/version.h>
#include <sys/utsname.h>
/*
* from rhel7's linux/version.h:
* #define LINUX_VERSION_CODE 199168
* #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
*/
@sirodoht
sirodoht / migrate-django.md
Last active April 20, 2024 09:52
How to migrate Django from SQLite to PostgreSQL

How to migrate Django from SQLite to PostgreSQL

Dump existing data:

python3 manage.py dumpdata > datadump.json

Change settings.py to Postgres backend.

Make sure you can connect on PostgreSQL. Then:

@kasappeal
kasappeal / django-postgresql-gunincorn-nginx-pyenv-ubuntu-16.04.md
Last active September 26, 2022 11:30
How to deploy a Django app with PostgreSQL + Gunicorn + Nginx using pyenv on Ubuntu Server 16.04

How to deploy a Django app with PostgreSQL + Gunicorn + Nginx using pyenv on Ubuntu Server 16.04

This guide shows how to setup a production environment for a Django application using PostgreSQL as database, Gunicorn as application server and Nginx as http server using Ubuntu Server 14.04 as Operative System.

Install PosgreSQL, Nginx, Git and Circus

Install PostgreSQL and Nginx using:

sudo apt-get install -y postgresql-9.5 postgresql-contrib-9.5 postgresql-server-dev-9.5 nginx git circus make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils python-setuptools 
@hollodotme
hollodotme / Install-nginx-with-http2-support.md
Created April 9, 2016 17:07
Install nginx with http2 support on ubuntu 14.04 LTS (Trusty)

How to install nginx (>= 1.9.5) with http2 support on Ubuntu 14.04 LTS (Trusty)

IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available)!

Remove old nginx

Remove old nginx incl. nginx-common:

apt-get autoremove --purge nginx nginx-common
@ishults
ishults / Grails_Groovy_Versions.txt
Last active February 9, 2023 18:04
List of Groovy versions for Grails
// Compiled by Igor Shults
// Last Updated: July 23, 2020
GRAILS GROOVY SOURCE
4.1.0 2.5.14 https://github.com/grails/grails-core/blob/v4.1.0/gradle.properties
4.0.4 2.5.6
4.0.3 2.5.6
4.0.2 2.5.6
4.0.1 2.5.6
4.0.0 2.5.6 https://github.com/grails/grails-core/blob/v4.0.0/build.gradle
@atd-schubert
atd-schubert / Gitlab-with-unbundled-nginx.md
Last active February 26, 2024 12:14
gitlab with own nginx

How to setup gitlab without embedded nginx

Install via omnibus-package

install the normal way:

wget https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.7.2-omnibus.5.4.2.ci-1_amd64.deb & > /dev/null

sudo apt-get update
sudo apt-get upgrade
@walkermatt
walkermatt / debounce.py
Created June 4, 2012 21:44
A debounce function decorator in Python similar to the one in underscore.js, tested with 2.7
from threading import Timer
def debounce(wait):
""" Decorator that will postpone a functions
execution until after wait seconds
have elapsed since the last time it was invoked. """
def decorator(fn):
def debounced(*args, **kwargs):
def call_it():