Skip to content

Instantly share code, notes, and snippets.

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jezeniel
jezeniel / dhclient.conf
Last active August 29, 2015 14:01
Default dhclient.conf
# Configuration file for /sbin/dhclient, which is included in Debian's
# dhcp3-client package.
#
# This is a sample configuration file for dhclient. See dhclient.conf's
# man page for more information about the syntax of this file
# and a more comprehensive list of the parameters understood by
# dhclient.
#
# Normally, if the DHCP server provides reasonable information and does
# not leave anything out (like the domain name, for example), then
@jezeniel
jezeniel / ssh_forwarding_cheatsheet.md
Last active November 27, 2023 17:32
SSH Agent Forwarding cheatsheet

Using the ssh agent

The following would show a similar output if a key is already added to your agent, and you are good to go.

$ ssh-add -l
2048 d7:8e:3d:03:9c:4f:f8:9d:04:0f:11:c5:24:e1:2f:3a rsa w/o comment (RSA)

The following will show if no agent is running.

@jezeniel
jezeniel / django_logging_debug.py
Last active August 25, 2016 10:02
Django logging debug
import logging
# Just a simple way to output or print data on the console's stdout
logger = logging.getLogger('django')
logger.info("TEST")
@jezeniel
jezeniel / fabfile_cheatsheet.md
Created October 14, 2016 09:32
Fabfile Cheatsheet

Fabric Cheatsheet

Cookbook

The fab command

Change host per task

@jezeniel
jezeniel / test_behaviours.py
Created May 24, 2017 11:52
Django Mock Model Test
from django.db import connection
from django.test import TestCase
from ..behaviors import WalletIntegration
class TestModel(WalletIntegration):
class Meta:
app_label = 'test'
@jezeniel
jezeniel / error_registry.py
Created September 13, 2017 10:14
Error Registry
class Jug:
def __init__(self):
self.exception_handlers = {}
def errorhandler(self, exception):
def decorator(f):
self.exception_handlers[exception] = f
return f
return decorator
@jezeniel
jezeniel / app.py
Last active February 22, 2018 10:39
Workshop
from flask import Flask, jsonify, request, render_template
app = Flask(__name__)
@app.route('/page/<name>/')
def page(name):
return render_template('hello.html', name=name)
@app.route('/api/get/')
@jezeniel
jezeniel / app.py
Created February 22, 2018 11:11
Celery Part
from celery import Celery
from flask import Flask, jsonify, request, render_template
def make_celery(app):
celery = Celery(app.import_name,
broker=app.config['CELERY_BROKER_URL'],
backend=app.config['CELERY_RESULT_BACKEND'])
celery.conf.update(app.config)
TaskBase = celery.Task