Skip to content

Instantly share code, notes, and snippets.

View pj8912's full-sized avatar
💭
...

John Pinto pj8912

💭
...
View GitHub Profile
@pj8912
pj8912 / sql_timestamp.py
Created January 9, 2024 09:42
Current Timestamp created using python in sql format for current_timestamp
from datetime import datetime
def now():
format_string = "%Y-%m-%d %H:%M:%S"
current_datetime = datetime.now()
current_datetime_without_microseconds = current_datetime.replace(microsecond=0)
return current_datetime_without_microseconds
print(now()) #output example : 2024-01-09 09:05:06
#sql
@pj8912
pj8912 / ip_flask.py
Created December 1, 2023 20:53
Get IP address of visitors using Flask for Python
from flask import request
from flask import jsonify
@app.route("/get_my_ip", methods=["GET"])
def get_my_ip():
return jsonify({'ip': request.remote_addr}), 200
@pj8912
pj8912 / README.md
Created November 7, 2023 20:31
Basic droplet + MySql cost in digital ocean

Basic droplet + MySql cost in digital ocean

image

@pj8912
pj8912 / projects.md
Last active October 25, 2023 09:21
ChatGPT low-level programming syllabus
  1. Assembly Language Game: Create a simple game (e.g., a text-based adventure game) using assembly language. This project should demonstrate your understanding of assembly language instructions and control flow.

  2. Memory Allocation Simulator: Build a program that simulates memory allocation and deallocation processes. This project will help you explore memory management concepts and data structures.

  3. Basic Operating System Shell: Develop a basic command-line shell in assembly language. The shell should support essential commands like file management, process execution, and system calls.

  4. File Encryption/Decryption Tool: Write a program in assembly language that encrypts and decrypts files using low-level file I/O operations. This project will involve file system interactions and basic cryptography.

  5. Stack-Based Calculator: Create a calculator that performs arithmetic operations using a stack-based approach in assembly language. This project will demonstrate your knowledge of sta

@pj8912
pj8912 / notify.css
Created October 2, 2023 14:31
Notification popup css and javascript
.notify {
position: fixed;
bottom: 50px;
right: 20px;
width: 400px;
padding: 12px;
background: #364c89;
color: #fff;
border-radius: 20px;
opacity: 0;
@pj8912
pj8912 / README.md
Created September 7, 2023 04:20
Apache, python installation in linux server

Apache installation in linux server

  • sudo apt update
  • sudo apt install apache2
  • apache2 - version
  • sudo ufw app list
  • sudo ufw allow 'Apache'
  • sudo systemctl status apache2
  • sudo apt-get install libapache2-mod-wsgi python-dev
@pj8912
pj8912 / sqlite_ext.md
Created September 5, 2023 09:02
All SQLite Database File extensions

All SQLite Database File extensions

  • .sqlite
  • .sqlite3
  • .db
  • .db3
  • .s3db
  • .sl3
@pj8912
pj8912 / aws_py.md
Last active August 29, 2023 10:04
aws, python deployment related queries and resources