This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| pg_uuid | |
| ~~~~~~~~~~~~~~~~ | |
| <NO DESCRIPTION>. | |
| :copyright: (c) 2018 by WRDLL <4ever@wrdll.com> | |
| """ | |
| from flask import Flask |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import wraps | |
| from flask import Flask, g, session, request, abort, jsonify | |
| from flask_migrate import MigrateCommand, Migrate | |
| from flask_script import Manager | |
| from flask_sqlalchemy import SQLAlchemy | |
| flask_app = Flask(__name__, static_folder='./static') | |
| db = SQLAlchemy() | |
| migrate = Migrate() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM node:8.9.4-alpine AS build_box | |
| WORKDIR /app | |
| COPY package*.json ./ | |
| RUN NODE_ENV=dev npm install | |
| COPY . /app | |
| RUN npm run build | |
| # Make final image | |
| FROM node:8.9.4-alpine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # Make sure you grab the latest version | |
| curl -OL https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip | |
| https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip | |
| # Unzip | |
| unzip protoc-3.6.1-linux-x86_64.zip -d protoc3 | |
| # Move protoc to /usr/local/bin/ | |
| sudo mv protoc3/bin/* /usr/local/bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import hashlib | |
| import argparse | |
| import binascii | |
| import struct | |
| def encrypt_v1(imei, key): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Generates ten data files, each 300 MB in size and filled with random data. | |
| [[ ! -d "data/" ]] && mkdir "data/" | |
| for i in {1..10}; do | |
| dd if="/dev/random" of="data/file${i}" bs=1m count=300 | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # | |
| # Extracts email addresses from one or more plain text files. | |
| # | |
| # Notes: | |
| # - Does not save to file (pipe the output to a file if you want it saved). | |
| # - Does not check for duplicates (which can easily be done in the terminal). | |
| # | |
| # (c) 2013 Dennis Ideler <ideler.dennis@gmail.com> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # mkcd command | |
| # This is an improvised version of the mkcd command at http://superuser.com/questions/152794/is-there-a-shortcut-to-mkdir-foo-and-immediately-cd-into-it | |
| # This function has to be added to the ~/.bashrc file | |
| # After that you can run command like: mkdir abc, mkdir -p one/two/three | |
| # | |
| function mkcd { | |
| last=$(eval "echo \$$#") | |
| if [ ! -n "$last" ]; then | |
| echo "Enter a directory name" |
NewerOlder