Skip to content

Instantly share code, notes, and snippets.

View BolaNasr's full-sized avatar
🏠
Working from home

Bola E.Nasr BolaNasr

🏠
Working from home
View GitHub Profile
@BolaNasr
BolaNasr / flask-server.py
Created August 16, 2018 09:14
simple flask server
from flask import Flask, render_template, request, jsonify
from pusher import Pusher
import json
# create flask app
app = Flask(__name__)
# index route, shows index.html view
@app.route('/')
#!/bin/bash
set -ex
# make output directory
ARCHIVE=/tmp/archives
FLIST=/tmp/flist
mkdir -p $ARCHIVE
# install system deps (done)
------------------------------------------------------------------
--
-- Author: Alexey Melnichuk <alexeymelnichuck@gmail.com>
--
-- Copyright (C) 2013-2016 Alexey Melnichuk <alexeymelnichuck@gmail.com>
--
-- Licensed according to the included 'LICENCE' document
--
-- This file is part of lua-path library.
--
firebase : da 3shan database ( Get w set w delete ) 3n tre2 API
(car wash GP) project name
t3lem mn new boston
https://www.youtube.com/playlist?list=PL6gx4Cwl9DGBsvRxJJOzG4r4k_zLKrnxl
t3lem mn firebase with android
[startup.wiki]
name = "bash"
protected = true #set protected to true to respawn the container if it crashed
[startup.wiki.args]
script = """
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
export HOME=/root
export LANG=en_US.UTF-8
from Jumpscale import j
builder_method = j.builder.system.builder_method
class BuilderGolang(j.builder.system._BaseClass):
NAME = 'go'
STABLE_VERSION = '1.12'
DOWNLOAD_URL = 'https://dl.google.com/go/go{version}.{platform}-{arch}.tar.gz'
@BolaNasr
BolaNasr / dns_manager.py
Last active June 19, 2019 14:31
acl for users
from Jumpscale import j
def main(self):
"""
to run:
kosmos 'j.data.bcdb.test(name="dns_manager")'
test around acls
#!/bin/sh
# prepare ssh
[ -d /etc/ssh/ ] && chmod 400 -R /etc/ssh/
mkdir -p /run/sshd
[ -d /root/.ssh/ ] || mkdir /root/.ssh
chmod +x /opt/bin/*
mkdir -p /var/log/postgres
mkdir -p /var/log/gitea
#!/usr/bin/env bash
set -Eeo pipefail
# TODO swap to -Eeuo pipefail above (after handling all potentially-unset variables)
# usage: file_env VAR [DEFAULT]
# ie: file_env 'XYZ_DB_PASSWORD' 'example'
# (will allow for "$XYZ_DB_PASSWORD_FILE" to fill in the value of
# "$XYZ_DB_PASSWORD" from a file, especially for Docker's secrets feature)
file_env() {
local var="$1"