Skip to content

Instantly share code, notes, and snippets.

View tomrockdsouza's full-sized avatar
🏠
Busy

Tomrock D'souza tomrockdsouza

🏠
Busy
View GitHub Profile
'''
Most efficient algorithm in python
Get prime numbers upto a given number.
By Tomrock D'souza
'''
from numba import jit
from time import time
@jit(nopython=True)
@tomrockdsouza
tomrockdsouza / DisableAutomaticRestartSignOn.reg
Last active June 22, 2024 05:12
Got a new windows 11 laptop and the system automatically logs in without a password. Now how do we stop this ?
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
"DisableAutomaticRestartSignOn"=dword:00000001
@tomrockdsouza
tomrockdsouza / DisableAutoLoginWindows11.txt
Last active June 22, 2024 05:06
Got a new windows 11 laptop and the system automatically logs in without a password. Now how do we stop this ?
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
On the above key create
DWORD32: DisableAutomaticRestartSignOn
with value: 1
@tomrockdsouza
tomrockdsouza / expose_local_server.md
Last active December 30, 2023 19:10
Commands and Instruction to expose your local server unlimited on the web with any domain or subdomain

Youtube Tutorial


##local-pc
ssh-keygen -t ed25519 -C "user@example.com" -f demo
ssh -i demo ubuntu@IPX

##server
sudo su
iptables -F
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Hennge Senior Software Engineer (Python Challenge)
#######################################################################
# Mission Description
#
# We want to calculate a sum of squares of some integers, excepting negatives
# * The first line of the input will be an integer N (1 <= N <= 100)
# * Each of the following N test cases consists of one line containing an integer X (0 < X <= 100),
# followed by X integers (Yn, -100 <= Yn <= 100) space-separated on the next line
# * For each test case, calculate the sum of squares of the integers excepting negatives,
# and print the calculated sum to the output. No blank line between test cases
import sqlalchemy
import sqlite3
def get_engine_conn(dbx):
return sqlalchemy.create_engine(f'sqlite:///{dbx}')
def get_conn(dbx):
return sqlite3.connect(dbx)
@tomrockdsouza
tomrockdsouza / create_sqlite3_db.py
Created February 27, 2022 15:45
Create a SQLite database within seconds without 3rd party libraries.
import sqlite3
import re
if __name__ == '__main__':
database_name=input('Enter Database Name: ')
database_name=re.sub(r'\W+', '', database_name)
conn = sqlite3.connect('./'+database_name+'.db')
conn.close()
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://cdn.rawgit.com/ricmoo/aes-js/e27b99df/index.js"></script>
<script>
function decryptAES(encryptedHex){
// An example 128-bit key
var key = [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 ];
@tomrockdsouza
tomrockdsouza / tommy.py
Last active November 27, 2017 17:07
Stack based Flood Fill algorithm in Python
row=int(input())
col=int(input())
xpoint=int(input())
ypoint=int(input())
mult = row * col
p=[]
def isPrime(num):
for x in reversed(range(2,num)):
if num%x==0 and num>1 :