Skip to content

Instantly share code, notes, and snippets.

View shellkore's full-sized avatar
🌚
Working in Stealth Mode

Shailesh Kumar Sahu shellkore

🌚
Working in Stealth Mode
View GitHub Profile
@shellkore
shellkore / client.sh
Created November 24, 2021 07:15
linux-windows-file-to-fro
serverUrl="http://192.168.1.2:44444/"
fileToDownload="sample.txt"
# echo "${url}"
curl -O "${serverUrl}${fileToDownload}"
#do your thing
# eg : Compile your code and save output file.
fileToUpload="output.txt"
@shellkore
shellkore / button.css
Created March 22, 2021 11:42
Cool-waving-button
@import url("https://fonts.googleapis.com/css?family=Lato:400,100,300,700,100italic,300italic,400italic,700italic,900,900italic");
@import url("https://fonts.googleapis.com/css?family=Raleway:400,700");
body {
padding: 0;
margin: 0;
}
body .btn-bg {
width: 100%;
height: 100vh;
min-height: 300px;
@shellkore
shellkore / Procfile
Created September 30, 2020 00:44
fastAPI skeleton app
web: gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app
@shellkore
shellkore / guessNumber.py
Created May 19, 2020 10:01
flask-session-use
from flask import Flask, session, redirect, url_for, escape, request
import random
app = Flask(__name__)
app.secret_key = "ASDF1234"
def getHint(randNumber,guess,noOfTry):
print('random number=',randNumber,type(randNumber))
print('guessed number=',guess,type(guess))
print('noOfTry=',noOfTry,type(noOfTry))

systemctl status mongod

systemctl start mongodb

systemctl stop mongodb

systemctl restart mongodb

ngrok http -host-header=<home_address> eg: ngrok http 3333 -host-header=localhost:3333

Initialisation

sudo apt-get update

sudo apt install python3-pip

sudo apt-get install apache2

sudo apt-get install libapache2-mod-wsgi

@shellkore
shellkore / ipcam_capture.py
Created February 26, 2020 16:49
using ipcam to access it over RPi
import cv2
import time
ipcam_ip = "192.168.43.1"
ipcam_port = "8080"
ipcam_url = f"rtsp://{ipcam_ip}:{ipcam_port}/h264_ulaw.sdp"
cam = cv2.VideoCapture(ipcam_url)
cv2.namedWindow("ipcam")

mysql> USE mysql;

mysql> CREATE USER 'YOUR_SYSTEM_USER'@'localhost' IDENTIFIED BY '';

mysql> GRANT ALL PRIVILEGES ON . TO 'YOUR_SYSTEM_USER'@'localhost';

mysql> UPDATE user SET plugin='unix_socket' WHERE User='YOUR_SYSTEM_USER';

mysql> FLUSH PRIVILEGES;

import requests
file_url = "https://github.com/jbrownlee/Datasets/releases/download/Flickr8k/Flickr8k_text.zip"
r = requests.get(file_url, stream = True)
placeToDownload = "/content/drive/My Drive/Colab Notebooks/image-caption-gen-flickr8k/Flickr8k_text.zip"
with open(placeToDownload, "wb") as file:
for block in r.iter_content(chunk_size = 1024):
if block:
file.write(block)