Skip to content

Instantly share code, notes, and snippets.

View Xevib's full-sized avatar
🎯
Focusing

Xevi Xevib

🎯
Focusing
View GitHub Profile
@ecarreras
ecarreras / test_show_qt_window.py
Created March 27, 2018 21:58
test_show_qt_window.py
from PyQt4.QtGui import QApplication, QMainWindow, QDialog, QHBoxLayout
from PyQt4.QtCore import SIGNAL
from Koo.Rpc import Rpc
from Koo.Common import Api
from Koo.Common import Localization
Localization.initializeTranslations()
from Koo.Dialogs import WindowService
x = Rpc.session.login('http://admin:admin@localhost:8069', 'test_1522167327')
@amatmv
amatmv / smtp_server_python.py
Created September 27, 2017 10:56
SMTP Testing Server
from datetime import datetime
import asyncore
from smtpd import SMTPServer
class EmlServer(SMTPServer):
no = 0
def process_message(self, peer, mailfrom, rcpttos, data):
filename = '%s-%d.eml' % (datetime.now().strftime('%Y%m%d%H%M%S'),
self.no)
f = open(filename, 'w')
def get_version():
import os
import subprocess
try:
try:
version = subprocess.check_output([
'git', 'describe', '--tags'
]).strip()
except subprocess.CalledProcessError:
version = __import__('pkg_resources') \
@jsanz
jsanz / README.md
Last active June 6, 2016 19:38
OSM no es un mapa, es una base de datos
@ecarreras
ecarreras / README.md
Last active August 7, 2023 07:39
PostgreSQL replication

Checklist

  • Create user replication in the master
sudo -u postgres psql -c "CREATE USER rep REPLICATION \
LOGIN ENCRYPTED PASSWORD 'thepassword';"
  • Modify postgresql.conf in the master
listen_address = # make sure we're listening as appropriate
wal_level = hot_standby
@ecarreras
ecarreras / install.py
Last active December 28, 2015 10:01
Instal·la mòdul remotament
import logging
import os
import click
from erppeek import Client
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger('installer')
def setup_peek(**peek_config):
@ngpestelos
ngpestelos / remove-docker-containers.md
Last active October 8, 2025 18:58
How to remove unused Docker containers and images

May 8, 2018

I wrote this four years ago, so instead use this command:

$ docker rmi $(docker images -q -f dangling=true)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: