For Elementary OS 18.04 guest under MacOS host.
Open terminal inside the VM and type:
$ sudo apt -y update
$ sudo apt -y upgrade
$ sudo apt -y install dkms build-essential
#!/usr/bin/env bash | |
python -c 'open("/tmp/teste-dir/ultimos-primeiro.txt", "w").writelines(sorted(open("/tmp/teste-dir/so_diretorios.txt").readlines(), key=lambda s: s.count("/"), reverse=True))' |
"""Useful functions to handle the class attribute of DOMNode. | |
Usage: | |
``` | |
>>> el = document['someid'] | |
>>> add_class(el, 'class-one') | |
>>> add_class(el, 'old-class') | |
>>> change_class(el, 'old-class', 'new-class') | |
>>> remove_class(el, 'class-one') | |
>>> print(el.class_name) |
class VinculoGeral(models.Model): | |
'''Essa classe será criada pelo Django. | |
Ela não tem nenhuma validação. | |
''' | |
tipo_vinculo = models.ForeignKey('TipoVinculoProfissional') | |
profissional = models.ForeignKey('Profissional') | |
data_inicio = models.DateField() | |
data_fim = models.DateField() |
GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.
I'm a Python programmer and frequently work with the excellent [virtualenv][] tool by Ian Bicking.
Virtualenv is a great tool on the whole but there is one glaring problem: the activate
script that virtualenv provides as a convenience to enable its functionality requires you to source it with your shell to invoke it. The activate
script sets some environment variables in your current environment and defines for you a deactivate
shell function which will (attempt to) help you to undo those changes later.
This pattern is abhorrently wrong and un-unix-y. activate
should instead do what ssh-agent
does, and launch a sub-shell or sub-command with a modified environment.
#!/bin/sh | |
# deploy.sh | |
N="`readlink \"$1\"`" | |
mv -T "$1.stage" "$1" | |
ln -s "$N" "$1.stage" | |
rm -rf "$N" | |
cp -aH "$1" "$N" |
= Continuous Delivery Changelog
I have recently changed the Gentics Mesh release process from regular releases to a continous delivery release process. One of the questions that directly came up was how to manage a public changelog in continuous delivery workflow?
Previously (regular sequential releases) I would write the changelog entry upfront and since I knew what release version would be expected i could just refer to that version. With CD this changes. I can no longer refer to a specific version since i'm doing CD without actually knowing the version upfront.
I know that I could just fetch the SCM log and generate a changelog using that information but I don't like to use SCM messages for a public (enduser friendly) changelog. A changelog that just consists of SCM messages is way to noisy. Unfortunately it seems that all the open source changelog plugin utlize the git log to build a changelog.
For Gentics CMS I already wrote my own [maven changelog plugin](https://github.com/gentics/maven-changelog-
"""IPython startup script to detect and inject VIRTUAL_ENV's site-packages dirs. | |
IPython can detect virtualenv's path and injects it's site-packages dirs into sys.path. | |
But it can go wrong if IPython's python version differs from VIRTUAL_ENV's. | |
This module fixes it looking for the actual directories. We use only old stdlib | |
resources so it can work with as many Python versions as possible. | |
References: | |
http://stackoverflow.com/a/30650831/443564 |
# Define variables | |
project_name := $(shell pwd | xargs basename) | |
inifile := development.ini | |
dbfile := $(shell grep -e '^sqlalchemy\.url' ${inifile} \ | |
| grep -o -e 'sqlite:.*' \ | |
| xargs basename \ | |
) | |
pip_cache := /Users/viniciusban/projects/pip-downloaded-packages | |
pip_options := --no-index --no-cache --find-links=${pip_cache} |