##local-pc
ssh-keygen -t ed25519 -C "user@example.com" -f demo
ssh -i demo ubuntu@IPX
##server
sudo su
iptables -F
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
''' | |
1) Write a python script to download the historical climate data of all locations into a csv file. | |
http://www.weather.gov.sg/climate-historical-daily/ | |
Output as a csv file in below format with all the stations in a file per month for 2022 Sep, 2022 Oct and 2022 Nov. | |
CSV format: | |
Station,Year,Month,Day,Daily Rainfall Total (mm),Highest 30 min Rainfall (mm),Highest 60 min Rainfall (mm),Highest 120 min Rainfall (mm),Mean Temperature (°C),Maximum Temperature (°C),Minimum Temperature (°C),Mean Wind Speed (km/h),Max Wind Speed (km/h) | |
Changi,2023,1,1, 0.0, 0.0, 0.0, 0.0, 27.2, 30.6, 25.3, 9.8, 31.5 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# 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 |
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
import sqlalchemy | |
import sqlite3 | |
def get_engine_conn(dbx): | |
return sqlalchemy.create_engine(f'sqlite:///{dbx}') | |
def get_conn(dbx): | |
return sqlite3.connect(dbx) |
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
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() | |
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> | |
<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 ]; |
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
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 : |
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
''' | |
Create a web scrapper which will take Consumer Number as input and crawl payment detail from here. | |
https://www.mgvcl.in:7013/.../LaunchPortal/LaunchDesktop... | |
Eg. | |
Input: | |
(Consumer No) 41102 | |
Output: | |
{"consumer_no":41102,"consumer_name":"D.E.E. Western Railway Loco Work Shop","bill_date":"AUG-2017","bill_amount":"1351462.58","amount":1351462.58} |
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
function palinum(a){ | |
b=a; | |
c=0; | |
while(b!=0){ | |
c*=10; | |
c+=b%10; | |
b/=10; | |
b=Math.floor(b); | |
} | |
console.log(c==a); |
NewerOlder