Skip to content

Instantly share code, notes, and snippets.

View jawkha's full-sized avatar

Jawad Khawaja jawkha

View GitHub Profile
@jawkha
jawkha / ubuntu-server-hardening.md
Last active July 9, 2022 12:17 — forked from mirajehossain/ubuntu-server-hardening.md
ubuntu-server-hardening checklist

Ubuntu-Server-Hardening

1. Avoid Using FTP, Telnet, And Rlogin / Rsh Services on Linux

Under most network configurations, user names, passwords, FTP / telnet / rsh commands and transferred files can be captured by anyone on the same network using a packet sniffer. The common solution to this problem is to use either OpenSSH , SFTP, or FTPS (FTP over SSL), which adds SSL or TLS encryption to FTP.

Type the following command to delete NIS, rsh and other outdated service:

sudo apt --purge remove xinetd nis yp-tools tftpd atftpd tftpd-hpa telnetd rsh-server rsh-redone-server
@jawkha
jawkha / python_decorator_guide.md
Created December 18, 2021 09:03 — forked from Zearin/python_decorator_guide.md
The best explanation of Python decorators I’ve ever seen. (An archived answer from StackOverflow.)

NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.


Q: How can I make a chain of function decorators in Python?


If you are not into long explanations, see [Paolo Bergantino’s answer][2].

@jawkha
jawkha / react.js
Created May 2, 2021 19:59
React Source Code v16.7.0
/** @license React v16.7.0
* react.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
'use strict'
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 72 columns, instead of 17. in line 2.
Country,1950,1951,1952,1953,1954,1955,1956,1957,1958,1959,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020
China,554419,569909,582576,593366,603052,612242,621363,630678,640296,650213,660408,670953,682103,694339,708255,724219,742415,762581,784075,805986,827601,848760,869486,889485,908464,926241,942685,957891,972205,986132,1000089,1014022,1027949,1042431,1058172,1075589,1095014,1116095,1137724,1158357,1176884,1192897,1206711,1218817,1230020,1240921,1251636,1261996,1271982,1281515,1290551,1299130,1307352,1315304,1323085,1330776,1338409,1345994,1353569,1361169,1368811,1376498,1384206,1391883,1399454,1406848,1414049,1421022,1427648,1433784,1439324
India,376325,382377,388799,395544,402579,409881,417443,425271,433381,441799,450548,459642,469077,478826,488848,499123
Specification Keyword RGB hex value
CSS Level 1 black #000000
CSS Level 1 silver #c0c0c0
CSS Level 1 gray #808080
CSS Level 1 white #ffffff
CSS Level 1 maroon #800000
CSS Level 1 red #ff0000
CSS Level 1 purple #800080
CSS Level 1 fuchsia #ff00ff
CSS Level 1 green #008000
@jawkha
jawkha / Knex-Setup.md
Created November 18, 2020 08:24 — forked from NigelEarle/Knex-Setup.md
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
@jawkha
jawkha / Knex-Migrations-Seeding.md
Created November 18, 2020 08:23 — forked from NigelEarle/Knex-Migrations-Seeding.md
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@jawkha
jawkha / Git - working with forks
Created March 1, 2019 06:54
Useful Git commands for working with forks of other repos
To show all the remotes the repo is pointing to:
`git remote -v`
To add the upstream repo to the list of remotes:
`git remote add upstream <git@github.com:<repo-owner>/<repo-name.git>`
To fetch all the changes from upstream to the local repo:
`git fetch upstream`
To set up the master branch to track the remote master branch from upstream