Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
from django.core.serializers.json import DjangoJSONEncoder | |
from django.template import Library | |
from json import dumps as json_dumps | |
register = Library() | |
@register.filter | |
def json(data): | |
""" |
FROM python:3.7.8-alpine | |
ENV PYTHONUNBUFFERED=1 | |
ENV LC_ALL=C.UTF-8 | |
ENV LANG=C.UTF-8 | |
ENV FLASK_APP=app.py | |
ENV FLASK_RUN_HOST=0.0.0.0 | |
ENV FLASK_RUN_PORT=8080 | |
EXPOSE 8080 |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#!/bin/sh | |
# Installs docker-compose inside docker-machine | |
DOCKER_COMPOSE_VERSION=1.6.0 | |
# Download docker-compose to the permanent storage | |
echo 'Downloading docker-compose to the permanent VM storage...' | |
sudo mkdir -p /var/lib/boot2docker/bin | |
sudo curl -sL https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /var/lib/boot2docker/bin/docker-compose |
GOOGLE_AUTH_PAGE=https://accounts.google.com/o/oauth2/auth | |
# GOOGLE_AUTH_PAGE_V2=https://accounts.google.com/o/oauth2/v2/auth | |
GOOGLE_TOKEN_API=https://oauth2.googleapis.com/token | |
GOOGLE_TOKEN_INFO_API=https://oauth2.googleapis.com/tokeninfo | |
# GOOGLE_TOKEN_INFO_API_V3=https://www.googleapis.com/oauth2/v3/tokeninfo | |
GOOGLE_REVOKE_API=https://oauth2.googleapis.com/revoke | |
GOOGLE_USERINFO_API_V3=https://www.googleapis.com/oauth2/v3/userinfo | |
GOOGLE_USER_PROFILE_API=https://www.googleapis.com/auth/userinfo.profile |
#!/usr/bin/env bash | |
result='\n' | |
for m in $(docker-machine ls -f '{{.Name}}') | |
do | |
result=$result"Host docker-machine-$(docker-machine inspect -f '{{.Driver.MachineName}}' $m)"'\n' | |
result=$result" HostName $(docker-machine inspect -f '{{.Driver.IPAddress}}' $m)"'\n' | |
result=$result" User $(docker-machine inspect -f '{{.Driver.SSHUser}}' $m)"'\n' | |
result=$result" IdentityFile $(docker-machine inspect -f '{{.Driver.SSHKeyPath}}' $m)"'\n' |
https://docs.rongcloud.cn/im/server/signature/#_2
curl -X POST -H "App-Key: uwd1c0sxdlx2" -H "Nonce: 14314" -H "Timestamp: 1408710653000" -H "Signature: `echo -n Y1W2MeFwwwRxa0143141408710653000|sha1sum |awk '{printf $1}'`" -d 'userId=jlk456j5&name=Ironman&portraitUri=http%3A%2F%2Fabc.com%2Fmyportrait.jpg' "https://api-cn.ronghub.com/user/getToken.json"
curl -X POST -H "App-Key: 0vnjpoad0i1uz" -H "Nonce: $(date '+%s'|tail -c 6)" -H "Timestamp: $(date '+%s')" -H "Signature: `echo -n FZ****Pwbs$(date '+%s'|tail -c 6)$(date '+%s')|sha1sum |awk '{printf $1}'`" -d 'userId=jlk456j5&name=Ironman&portraitUri=http%3A%2F%2Fabc.com%2Fmyportrait.jpg' "https://api-cn.ronghub.com/user/getToken.json"
{"code":200,"userId":"jlk456j5","token":"Vk9O2dRLPlRYXDOv4zGBEXcjTUnCGVETk65A/2iMccLZF2uk0LUN6TJLNRHJ1NzsLVRliU5BLcgGWb3oTd3OXQ=="}
#!/usr/bin/env bash | |
SESSION="vs@`pwd |rev |cut -f1 -d/ |rev| cut -f2 -d.`#`pwd |md5sum |cut -c1-7`" | |
tmux attach -d -t $SESSION || tmux new -s $SESSION |