Skip to content

Instantly share code, notes, and snippets.

View Rubix982's full-sized avatar
🇵🇰

Saif Ul Islam Rubix982

🇵🇰
View GitHub Profile
@Rubix982
Rubix982 / DDL_For_DB_Project.txt
Created October 31, 2020 14:22
Just a simple DDL for MySQL
CREATE TABLE `User + User Registration Info` (
`User_Id` NUMBER,
`Joined Website` DATETIME,
`Handler` VARCHAR(40),
`first_name` VARCHAR(20),
`middle_name` VARCHAR(20),
`last_name` VARCHAR(20),
`Email` VARCHAR(30),
`Password` VARCHAR(30),
PRIMARY KEY (`User Id`)
Setting:
Company going through COVID 19, less sales, less resouces, less expandability options.
The company deals with Transportation And Warehousing.
Company has these departments, with 7 people overall, including the RM, FP, HRP,
- Management, 1
- Human Resources, 2
- Financial Department, 2
- Technical / IT, 1
@Rubix982
Rubix982 / sumArrayMPI.c
Created November 7, 2020 08:27
Program in MPI to sum an array
#include <mpich/mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
// size of array
#define n 10
int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
#include <mpi.h>
#include <stdio.h>
int main(int argc, char** argv) {
// Initialize the MPI environment
MPI_Init(NULL, NULL);
// Get the number of processes
int world_size;
MPI_Comm_size(MPI_COMM_WORLD, &world_size);
/* ------------------------- Question 1 ------------------------- */
> use HOTEL
switched to db HOTEL
> dbs
2020-12-12T11:42:52.660+0500 E QUERY [thread1] ReferenceError: dbs is not defined :
@(shell):1:1
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
# For datasets starting with D
import random
for j in range(0, 10):
n = random.randint(90,100)
arr = []
for i in range(0, n):
arr.append(random.randint(0, 100))
print(arr)
# For datasets starting with F

Contributor License Agreement

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all IOMED Medical Solution S.L. open source projects.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with IOMED Medical Solution S.L., contributors or maintainers.

1. Grant of Copyright License.

@Rubix982
Rubix982 / encodings.csv
Last active March 23, 2021 19:49
Extract UTF 8 encodings from W3Schools
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 3.
' ','%20',
'!','%21',
'"','%22',
'#','%23',
'$','%24',
'%','%25',
'&','%26',
''','%27',
'(','%28',
')','%29',
@Rubix982
Rubix982 / raw_sock.c
Created April 6, 2021 05:42
Short C program to sniff packets from the Network OSI Layer, with the IP protocl.
// Courtesy of https://squidarth.com/networking/systems/rc/2018/05/28/using-raw-sockets.html
// $ gcc raw_rock.c -o raw_sock && sudo ./raw_sock
// raw_sock.c
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<netinet/ip.h>
#include<sys/socket.h>
#include<arpa/inet.h>
@Rubix982
Rubix982 / DNS.py
Created April 10, 2021 06:48
The `data.json` is a quick web scrap of potential A, NS, and MX records from about 150 DNS records, generated from `DNS.py`. A list of 499 DNS records was scraped from some domain registry, not sure where. For now, only the results of the first 150 have been put into `data.json`. Feel free to make a folder `./data/` at the same root level, put `…
import dns.resolver
import os
import json
def get_csv_domain_data():
folder_path = str(os.path.abspath(__file__))[
0:-len(os.path.basename(__file__))] + "data/"
file_name = "test.csv"