Often you need to run debugger within docker. It many cases it looks like this:
import pdb; pdb.set_trace()Or:
| from troposphere import \ | |
| AWSHelperFn, Base64, Cidr, Condition, Equals, GetAtt, Join, Not, Output, Parameter, Ref, \ | |
| Region, Select, Split, StackName, Sub, Tags, Template | |
| from troposphere.autoscaling import \ | |
| AutoScalingGroup, LaunchTemplateSpecification, LifecycleHookSpecification | |
| from troposphere.awslambda import \ | |
| Code, Function, Permission | |
| from troposphere.ec2 import \ | |
| CreditSpecification, IamInstanceProfile, InternetGateway, LaunchTemplate, LaunchTemplateData, \ | |
| Route, RouteTable, SecurityGroup, SecurityGroupRule, Subnet, SubnetRouteTableAssociation, VPC, \ |
| # Install ARCH Linux with encrypted file-system and UEFI | |
| # The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description. | |
| # Download the archiso image from https://www.archlinux.org/ | |
| # Copy to a usb-drive | |
| dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux | |
| # Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration. | |
| # Set swedish keymap |
| --- Actions --- | |
| $Copy <M-C> | |
| $Cut <M-X> <S-Del> | |
| $Delete <Del> <BS> <M-BS> | |
| $LRU | |
| $Paste <M-V> | |
| $Redo <M-S-Z> <A-S-BS> | |
| $SearchWeb <A-S-G> | |
| $SelectAll <M-A> | |
| $Undo <M-Z> |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb
This is a supplement to the official Phabricator Installation Guide, because their guide will leave you with all kinds of permission and config errors and ~15,000 setup issues on startup.
# apt-get install mercurial subversion python-pygments sendmail imagemagick
| #!flask/bin/python | |
| from flask import Flask, jsonify, abort, request, make_response, url_for | |
| from flask.ext.httpauth import HTTPBasicAuth | |
| app = Flask(__name__, static_url_path = "") | |
| auth = HTTPBasicAuth() | |
| @auth.get_password | |
| def get_password(username): | |
| if username == 'miguel': |
| location /resize { | |
| alias /tmp/nginx/resize; | |
| set $width 150; | |
| set $height 100; | |
| set $dimens ""; | |
| if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
| set $width $1; | |
| set $height $2; | |
| set $image_path $3; |
| { | |
| "pongs" : [ | |
| "ma dici a me? Ehi con chi stai parlando? Dici a me?", | |
| "c'è qualcun altro qui? Stai parlando con me?", | |
| "non nominare il nome di Dio invano", | |
| "tutti con me c'avete oggi??", | |
| "dimmi, stavo sognando tua cuggina", | |
| "devo dire a tutti quanto sei bravo col flauto salato?", | |
| "vai a giocare a mosca cieca sull'autostrada, su", | |
| "toh un bug, indovina git blame chi sta indicando?", |