Skip to content

Instantly share code, notes, and snippets.

View umair313's full-sized avatar
🎯
Focusing

umair mehmood umair313

🎯
Focusing
View GitHub Profile
@umair313
umair313 / mysql-docker.sh
Created May 19, 2024 04:40 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@umair313
umair313 / kernel-dev.md
Created April 19, 2024 19:35 — forked from vegard/kernel-dev.md
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@umair313
umair313 / docker-compose.yml
Created January 26, 2023 21:10
Docker Compose for Django and MySQL database with wait retry for database
version: '3.4'
x-common: &common
stdin_open: true
tty: true
networks:
- djangoproject
services:
@umair313
umair313 / initial_server_setup.sh
Last active March 7, 2023 06:57
bash script to install the required packages and clone the project repository from github. Tested on Ubuntu 22.04, with digital ocean server.
#!/bin/bash
username=$1
github_email="github email used to generate SSH keys and clone the repository"
github_repo="repository SSH link"
server_ip=SERVER_IP
# Emoji
strong_emoji="\U1F4AA"
@umair313
umair313 / test_image_upload.py
Created September 13, 2022 10:54 — forked from guillaumepiot/test_image_upload.py
Django Rest Framework - Image/File upload test
import os
import io
from PIL import Image
from django.core.urlresolvers import reverse
from django.conf import settings
from rest_framework import status
from rest_framework.test import APITestCase
@umair313
umair313 / clean_code.md
Created January 26, 2022 05:51 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@umair313
umair313 / division_with_out_division_Operator.cpp
Created July 14, 2019 08:46
program perform division with out division operator and display result
#include <iostream>
using namespace std;
int main(){
int numerator=679;
int denominator=3;
int count=0;
int flag=0;
int numerator_high=0;
@umair313
umair313 / Division_without_division_operator.py
Last active July 14, 2019 08:31
This program divide number with out division operator '/' and display it only . only divide integer numbers > 0 . In Python
a = 1467 #nomerator
b = 21 #denominator
count = 0
flag = False
a_is_greater = False
floating_pre = 0
if a > 0 and b > 0 and a > b:
a_is_greater = True
@umair313
umair313 / arithmetic.cpp
Created June 30, 2019 09:34
this program will take two number's from user and display sum of two numbers
#include <iostream>
using namespace std;
int main() {
int a,b,result;
cout<< "Enter Number a : ";
cin>>a;
cout<< "Enter Number b : ";
@umair313
umair313 / first.cpp
Last active June 29, 2019 17:03
this is simple Hello World Program
#include <iostream>
using namespace std;
int main(){
cout<<"Hello World!";
return 0;
}