This is an unofficial manual for the couchdb
Python module I wish I had had.
pip install couchdb
{ | |
"api-cors-header": "", | |
"authorization-plugins": [], | |
"bip": "", | |
"bridge": "", | |
"cgroup-parent": "", | |
"cluster-store": "", | |
"cluster-store-opts": {}, | |
"cluster-advertise": "", | |
"debug": true, |
lsof -nPi tcp:443 | grep 18.215.66.244 |
rev=$(git rev-parse HEAD | sed 's/\(.\{7\}\).*/\1/') | |
echo $rev |
arecord -f cd - | aplay - |
# yanked from https://askubuntu.com/questions/730754/how-do-i-show-the-git-branch-with-colours-in-bash-prompt | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[01;31m\] $(parse_git_branch)\[\033[00m\]\$ ' | |
else | |
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(parse_git_branch)\$ ' | |
fi | |
# THE SIX LINES BELOW are the default prompt and the unset (which were in the original .bashrc) |
# script that obtains a certificate for domain.com using a TXT challenge (letsencrypt) | |
sudo certbot -d domain.com --manual --preferred-challenges dns certonly |
import socket | |
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP | |
client.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) | |
client.bind(("", 37020)) | |
while True: | |
data, addr = client.recvfrom(1024) | |
print("received message: %s"%data) |
manage.py dumpdata --natural-foreign --natural-primary -e contenttypes -e auth.Permission --indent 4 |
This is an unofficial manual for the couchdb
Python module I wish I had had.
pip install couchdb
# @brief | |
# Performs file upload validation for django. The original version implemented | |
# by dokterbob had some problems with determining the correct mimetype and | |
# determining the size of the file uploaded (at least within my Django application | |
# that is). | |
# @author dokterbob | |
# @author jrosebr1 | |
import mimetypes |