Skip to content

Instantly share code, notes, and snippets.

View matuu's full-sized avatar

Matuu matuu

View GitHub Profile
#!/bin/bash
sudo apt-get -y install language-pack-es-base
sudo apt-get -y install postgresql-9.1 libpq-dev postgresql-9.1-postgis gdal-bin
sudo apt-get -y install git python-pip python-dev
sudo apt-get -y install libxml2-dev libxslt1-dev
sudo -u postgres psql -c "CREATE ROLE dev LOGIN PASSWORD 'dev' SUPERUSER VALID UNTIL 'infinity';"
sudo -u postgres createdb template_postgis
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql
sudo -u postgres psql -d template_postgis -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
@matuu
matuu / qpdf.py
Last active August 29, 2015 14:26 — forked from juancarlospaco/qpdf.py
PDF Conversor powered by Qt5, does NOT show up any GUI, just needs an URL string, then it Prints PDF, and returns file path string, uses UUID if no output filename is passed, optional Landscape orientation if supported, CSS3 Just Works!.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""PDF Conversor powered by Qt5."""
from uuid import uuid4
from PyQt5.QtCore import QUrl
@matuu
matuu / fstab-generate-arch
Last active September 20, 2015 16:35 — forked from Brainiarc7/fstab-generate-arch.md
Generate fstab in Arch Linux
First, install arch-install-scripts:
sudo pacman -S --needed arch-install-scripts
Secondly, mount your partitions in all the internal hard drives.
Thirdly, generate and validate your config by piping it out to stdout:
genfstab -U -p / | less
@matuu
matuu / chat.py
Created March 30, 2016 03:15 — forked from gregvish/chat.py
Python 3.4 asyncio chat server example
from socket import socket, SO_REUSEADDR, SOL_SOCKET
from asyncio import Task, coroutine, get_event_loop
class Peer(object):
def __init__(self, server, sock, name):
self.loop = server.loop
self.name = name
self._sock = sock
self._server = server
Task(self._peer_handler())
@matuu
matuu / client.py
Created March 30, 2016 03:15 — forked from dbehnke/client.py
Python AsyncIO Client and Server Example using StreamReader and StreamWriter
"""
client.py - AsyncIO Server using StreamReader and StreamWriter
This will create 200 client connections to a server running server.py
It will handshake and run similar to this:
Server: HELLO
Client: WORLD
@matuu
matuu / middleware.py
Created August 11, 2017 13:56 — forked from igniteflow/middleware.py
Django language middleware. Detect the user's browser language settings and activate the language. If the default language is not supported, try secondary options. If none of the user's languages are supported, then do nothing.
class LanguageMiddleware(object):
"""
Detect the user's browser language settings and activate the language.
If the default language is not supported, try secondary options. If none of the
user's languages are supported, then do nothing.
"""
def is_supported_language(self, language_code):
supported_languages = dict(settings.LANGUAGES).keys()
return language_code in supported_languages
http://fooprotected.wordpress.com/2012/04/02/debian-on-androidatrix-with-debootstrap/
Debian on Android/Atrix with Debootstrap
April 2, 2012deathjest3rLeave a commentGo to comments
The Story
I have bought a new Smartphone. No, not the new and shiny Samsung Galaxy Nexus. An already a little bit older model, but still one of the most powerful devices out there, and a lot cheaper then the Galaxy Nexus, the Motorola Atrix 4G. My Nokia N900 served me well for the past 1.5 years, but now it was time for me to jump on the train called Android. But with my new Smartphone I don’t wanted to lose the possibility to use all my favorite Unix tools (e.g. SSH, SCP, RSYNC, etc.). So I decided to search for a guide on how to install Debian on Android. I found a lot, but non of them directly addressed on how to install Debian on Android/Atrix. So I decided to write a short guide for all the Atrix owners out there.
Rooting the Atrix
Before you start with the guide on how to install Debian you have to root your phone, otherwis