Skip to content

Instantly share code, notes, and snippets.

View awaismirza's full-sized avatar
🎯
Focusing

Awais Jamil awaismirza

🎯
Focusing
View GitHub Profile
@awaismirza
awaismirza / ssh.md
Created April 26, 2023 10:19
How to copy ssh-keygen using port

Replace {PORT} with port and USER and IP with your username and IP address

ssh-copy-id -o 'Port={PORT}' USER@IP

@awaismirza
awaismirza / docker-devsetup.sh
Last active January 2, 2023 19:53
Install node, java, gradle, groovy, go, python, flutter and android sdk using script below
// TO Run Docker Conatiner
docker run -it --name devserver -p 2200:22 --mount src="/Volumes/code",target=/root/coding,type=bind -d ubuntu:latest
// Arm64 Dev Setup with Root User
chown -R $(whoami) . &&
apt update &&
apt upgrade -y &&
apt install git curl -y &&
apt-get install build-essential &&
apt-get install snapd &&
@awaismirza
awaismirza / Login_form.dart
Last active September 20, 2022 13:38
Flutter-Dart Code Snippets
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:worktime_client/src/extensions/email_validator.dart';
import 'package:worktime_client/src/config/constants.dart';
import 'package:worktime_client/src/services/http-client.dart';
class LoginFormState extends State<LoginForm> {
final _formKey = GlobalKey<FormState>();
@awaismirza
awaismirza / SSH Setup into WSL2
Last active July 31, 2023 23:03
Setup SSH in WSL2
SSH into a WSL2 host remotely and reliably
Motivation 🐼
My MacBook is screaming at me while working on my heavy Webpack project. I have a powerful Windows 10 PC in my living room and my project runs just fine with WSL2 + VSCode remote, but how do I SSH into WSL from my MacBook remotely?
Let’s get into it 🔥
Make sure openssh-server is installed on your WSL Linux distro (In my case Ubuntu):
sudo apt install openssh-server
2. We need to set a different port for our SSH process, since Windows already uses the default one which usually is 22. I think 2222 is easy to remember.
# edit /etc/ssh/sshd_config with the following three changes
@awaismirza
awaismirza / openssl-cheatsheet.md
Last active February 28, 2024 18:12
OpenSSL cheatsheet

OpenSsl Cheat Sheet

Generate Key

We can use openssl Command-line utility to generate private key which will be used for generating certificate Signing Request and Certificate.

openssl genpkey -out server.key -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -aes-128-cbc

You can name your key whatever you like for example key.pem | key.key | sample.hello doesn’t matter what you name the key but the general convention is to use .pem extension.

Generate Certificate Signing Request

console.log('hello world')
@awaismirza
awaismirza / vscode-keymap-mac.json
Last active April 15, 2023 05:39
VS CODE KEYMAPS
[
{
"key": "ctrl+pagedown",
"command": "workbench.action.nextEditor"
},
{
"key": "ctrl+pageup",
"command": "workbench.action.previousEditor"
},
{