As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/usr/bin/env python | |
# Inspired by https://gist.github.com/jtangelder/e445e9a7f5e31c220be6 | |
# Python3 http.server for Single Page Application | |
import urllib.parse | |
import http.server | |
import socketserver | |
import re | |
from pathlib import Path |
#!/bin/bash | |
#set -eo pipefail | |
# | |
# Sample for getting temp session token from AWS STS | |
# | |
# aws --profile youriamuser sts get-session-token --duration 3600 \ | |
# --serial-number arn:aws:iam::012345678901:mfa/user --token-code 012345 | |
# | |
# 1 or 2 args ok |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Box Shadow</title> | |
<style> | |
.box { | |
height: 150px; | |
width: 300px; | |
margin: 20px; |
class Array | |
def to_csv(csv_filename="hash.csv") | |
require 'csv' | |
CSV.open(csv_filename, "wb") do |csv| | |
csv << first.keys # adds the attributes name on the first line | |
self.each do |hash| | |
csv << hash.values | |
end | |
end | |
end |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
As configured in my dotfiles.
start new:
tmux
start new with session name:
[core] | |
autocrlf = input | |
excludesfile = ~/.gitignore_global | |
[user] | |
name = nobody | |
email = nobody@example.com | |
[color] | |
diff = auto | |
status = auto | |
branch = auto |
# -*- coding: utf-8 -*- | |
import kombu | |
import kombu.mixins | |
import kombu.common | |
import transactional.controller | |
class Worker(kombu.mixins.ConsumerMixin): | |
def __init__(self, connection, controller, queues): | |
self.connection = connection |
import pika | |
import pruebas.controller | |
class BlockingConnectionAdapter(object): | |
def __init__(self, controller, queue='test'): | |
self.controller = controller | |
self.connection = pika.BlockingConnection() | |
self.channel = self.connection.channel() | |
self.queue = self.channel.queue_declare(queue=queue, durable=True, exclusive=False, auto_delete=False) |