Skip to content

Instantly share code, notes, and snippets.

Debian System Hardening

I'm writing this as my notes on hardening a Kali Linux system running kernel version 5.6.14. This is by no means an exhaustive list of everything that could be done

This is meant for general-purpose, daily-use Linux laptop. Most notably, this is a one-user system. I'm the only user here, so countermeasures for user-infighting are not taken here. I also do a lot of programming (and debugging), so some features such as the kernel Yama module are not turned to their most restrictive settings.

I'm skipping pre- and during-install procedures, such as disk encryption, secure boot, etc.. You should start this process with an already-completed fully-encrypted, passworded install. I'm also assuming some very basic knowledge, such as what constitutes a strong password, and how to edit files.

Almost all of these changes require a reboot to take effect. I'm leaving out how to apply changes on-the-fly here, but expect to reboot after major changes. The etckeeper package may be help

Using docker-machine with Photon Platform

The purpose of this repository is to help automate the initial configuration of Tenants, Projects, Quota's, Networks, Images, Clusters (Harbor and Kubernetes). You can modify any of the variables to fit your deployment and environment.

Environment requirements:

@chipx86
chipx86 / streaming-tar.py
Last active October 20, 2022 21:17
Sample code to build a tar chunk-by-chunk and stream it out all at once.
#!/usr/bin/env python
#
# Building a tar file chunk-by-chunk.
#
# This is a quick bit of sample code for streaming data to a tar file,
# building it piece-by-piece. The tarfile is built on-the-fly and streamed
# back out. This is useful for web applications that need to dynamically
# build a tar file without swamping the server.
import os
import sys
// Date Object CheatSheet
// The Date object is used to work with dates and times.
// More: http://www.w3schools.com/jsref/jsref_obj_date.asp
// 1. Instantiating a Date.
var date = new Date();
var date = new Date(milliseconds);
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 30, 2024 04:14
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
# SYNTAX:
var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches)
var pattern = /pattern/attributes; # same as above
# BRACKETS:
[...]: Any one character between the brackets.
[^...]: Any one character not between the brackets.
@TheDistantSea
TheDistantSea / version_compare.js
Created December 18, 2013 12:19
Function to compare two version strings (e.g. "1.6.1" is smaller than "1.7"). Developed in order to answer http://stackoverflow.com/a/6832721/50079.
/**
* Compares two software version numbers (e.g. "1.7.1" or "1.2b").
*
* This function was born in http://stackoverflow.com/a/6832721.
*
* @param {string} v1 The first version to be compared.
* @param {string} v2 The second version to be compared.
* @param {object} [options] Optional flags that affect comparison behavior:
* <ul>
* <li>