Skip to content

Instantly share code, notes, and snippets.

View kaipee's full-sized avatar

Keith Patton kaipee

View GitHub Profile
@kaipee
kaipee / Examining images and docker registry.md
Created February 14, 2022 11:38 — forked from x-yuri/Examining images and docker registry.md
Examining images and docker registry #docker #registry #images

Examining images and docker registry

Dockerfile:

FROM alpine
RUN echo a > a
COPY b .

NC does not close the network connection as it does not receive EOF. We need to 'timeout' or close the connection after a short period. This can be achieved by putting a sleep command into the stdin being passed to nc.

(echo "password 1234"; sleep 2) | nc -q 0 localhost 30002

...or by adding a maximum wait-time to the netcat connection

echo "password 1234" | nc -w 1 localhost 30002

(a small 1 second wait-time seems to be sufficient for the nc listener to respond and close safely.)

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)[1] export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
@kaipee
kaipee / hardening_ubuntu_defaults.md
Last active October 2, 2018 22:06
A few initial pointers for securing Linux systems

Hardening Ubuntu defaults

This gist aims to be an incomplete set of steps to provide additional hardening of a default Ubuntu Server installation. The following guides and configurations have been collated from man pages; source documentation; and online guides / best practices.

This document will focus on production Ubuntu server installations, not desktop configurations. Please note : your requirements may differ, use at your own risk.

This is a live document which I hope to update with new findings.