This file contains hidden or 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
from tkinter import * | |
import pandas as pd | |
import xdrlib | |
import random | |
from pynput import keyboard | |
from array import array as ar | |
def main(): | |
This file contains hidden or 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
var express=require('express'); | |
var app=express(); | |
var fs=require('fs'); | |
app.get('/',function(req,res){ | |
fs.readFile('index.html',function(err,buffer){ | |
var html=buffer.toString(); | |
res.setHeader('Content-Type','text/html'); | |
res.send(html); | |
}); | |
}); |
This file contains hidden or 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
import sys,re | |
with open('C:/Users/erdem/Desktop/memories/newe.txt', 'r') as test_cases: | |
for test in test_cases: | |
if test in ['','\n']:pass | |
else: | |
v=re.search('([-;\w]+)', test).group(0) | |
vqq=';'.join(re.findall('([\d|\w]+-[\d|\w]+)', test)) | |
st='' | |
if vqq==v and 'END' in v and 'BEGIN' in v: |
This file contains hidden or 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
//Rearange Number to Get its Maximum | |
var maxRedigit = function(num) { | |
var ou=[]; | |
var snum=num.toString(); | |
if (num<=0 || snum.length!=3){return null} | |
for (var i=0,len=snum.length;i<len;i+=1){ | |
ou.push(+snum.charAt(i));} | |
var a=ou.sort(function(a,b){return b-a}).join(''); | |
return parseInt(a) | |
}; |
This file contains hidden or 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
#Product of consecutive Fib numbers in python | |
def productFib(n): | |
f=[1,1] | |
d1,d2,d3,pro=0,0,0,0 | |
while pro<=n: | |
if pro==n:return ([d1,d2,True]) | |
else:pro=0 | |
d1,d2=f[0],f[1] | |
d3=d1+d2 | |
pro=d1*d2 |
This file contains hidden or 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
filename=ARGV.first | |
script=$0 | |
puts "Data in the file named as #{filename} will be deleted" | |
puts "Press enter to continue" | |
print "? " | |
STDIN.gets | |
puts "Opening the file...." | |
target=File.open(filename,'w') |
This file contains hidden or 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
from Crypto.Cipher import AES | |
from Crypto import Random | |
def encrypt(key,message): | |
cipher=AES.new(key,AES.MODE_CFB,iv) | |
msg=cipher.encrypt(message) | |
print(msg) | |
return msg | |
def decrypt(key,msg): | |
dec=AES.new(key,AES.MODE_CFB,iv) | |
return dec.decrypt(msg).decode('ascii') |
This file contains hidden or 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
from passlib.hash import pbkdf2_sha256 | |
import getpass | |
import mysql.connector | |
def enc_pass(pwd): | |
hash=pbkdf2_sha256.encrypt(pwd,rounds=200,salt_size=16) | |
return hash | |
def con_database(pwd): | |
cnx=mysql.connector.connect(user='*****',password='*****',host='*******',database='******') | |
cursor=cnx.cursor() | |
try: |
This file contains hidden or 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
import socket | |
import subprocess | |
import sys | |
from datetime import datetime | |
subprocess.call('CLS', shell=True) | |
remoteServer = input("Enter a remote host to scan: ") | |
remoteServerIP = socket.gethostbyname(remoteServer) | |
print ("-" * 60) | |
print ("Please wait, scanning remote host", remoteServerIP) |
This file contains hidden or 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
import argparse | |
import socket | |
from datetime import datetime | |
maxbyte=65535 | |
def server(port): | |
sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) | |
sock.bind(('127.0.0.1',port)) | |
print('Listining at {}'.format(sock.getsockname())) | |
while True: |
NewerOlder