This file contains 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
https://staaldraad.github.io/2017/12/20/netstat-without-netstat/ | |
https://unix.stackexchange.com/questions/131101/without-using-network-command-lines-in-linux-how-to-know-list-of-open-ports-and | |
# enter as root within docker | |
dr exec -it -u root:root lab bash | |
grep -v "grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){ | |
ret = 0 | |
n = length(str) |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" type="text/css" href="styles.css"> | |
</head> | |
<body> | |
<nav> | |
<ul class="menu"> | |
<li><a href="#">Home</a></li> |
This file contains 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
ARG registry=library | |
ARG base=ubuntu | |
ARG version=20.04 | |
FROM $registry/$base:$version | |
RUN apt-get update && apt update -y && apt-get install -y\ | |
python3\ | |
wget\ | |
python3-pip\ | |
curl\ |
This file contains 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 python3 | |
# -*- coding: utf-8 -*- | |
# https://stackoverflow.com/questions/21531061/image-url-downloads-the-image-instead-of-displaying-it | |
from fastapi import FastAPI | |
from starlette.responses import FileResponse | |
app = FastAPI() | |
@app.get("/image") | |
async def get_image(): |
This file contains 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 python3.7 | |
from fastapi import FastAPI | |
app = FastAPI() | |
@app.get('/') | |
async def home(): | |
return {"msg":"hi"} |
This file contains 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
https://stackoverflow.com/questions/73263202/how-to-display-uploaded-image-in-html-page-using-fastapi-jinja2 | |
display.html | |
------------ | |
<html> | |
<head> | |
<title>Display Uploaded Image</title> | |
</head> | |
<body> | |
<h1>My Image</h1> | |
<a href="/">Upload another image</a> |
This file contains 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/python3 | |
import requests | |
import urllib | |
import code | |
import os | |
from bs4 import BeautifulSoup | |
import pdb | |
import sys | |
url = 'https://www.mutualfundindia.com/MF/Portfolio/Details?id=32144' | |
is_debug_mode = False |
This file contains 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
https://www.digitalocean.com/community/tutorials/how-to-install-go-1-7-on-centos-7 |
This file contains 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
# cheat sheet | |
https://github.com/wsargent/docker-cheat-sheet | |
#cmds | |
docker --version | |
docker info | |
docker images | |
docker ps | |
docker system prune -a |
This file contains 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
$ cat main | |
#!/bin/bash | |
rm -v /tmp/eject | |
i=0 | |
while true | |
do | |
if [ -f /tmp/eject ] | |
then | |
exit 0 | |
fi |
NewerOlder