Skip to content

Instantly share code, notes, and snippets.

@b01
b01 / download-vs-code-server.sh
Last active May 4, 2024 21:41
Linux script to download latest VS Code Server, good for Docker (tested in Alpine).
#!/bin/sh
# Copyright 2023 Khalifah K. Shabazz
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the “Software”),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@novemberborn
novemberborn / howto.md
Created February 18, 2016 17:47
Creating a PKCS#12 file from a Let's Encrypt certificate
@nerdalert
nerdalert / Netfilter-IPTables-Diagrams.md
Last active April 9, 2024 09:18
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@stefanocoding
stefanocoding / activate_intel_gpu_on_macbookpro.md
Last active January 5, 2024 22:26
Activate integrated Intel GPU of a MacBook Pro Mid 2014 (MacBookPro11,3) on Ubuntu 18.04

This may work with other Macbook Pro models that have an Intel GPU and a NVidia one, but I only have proof that this works on a MacBook Pro Mid 2014 (MacBookPro11,3) with Ubuntu 18.04. If you want to be sure about which model you have, run sudo dmidecode -t system in the Terminal and you will see the information about the system including the serial number and product name (MacBookPro11,3 in my case). I'm assuming you have installed the NVidia propietary drivers, which can be installed from the application "Software & Updates" in the tab "Additional Drivers".

Steps to use the Intel GPU:

  1. Run lspci |grep VGA and check that only one line mentioning "NVIDIA" is printed. This is to be sure that you are required to do the following steps. If two lines appear, and one of those mentions "Intel", then you probably do not need to activate the GPU but only select it as the main GPU (jump to the step where you have to "Open nvidia-settings").
  2. Download apple_set_os.efi from https://github.com/0xbb/apple_se
@thomasfr
thomasfr / autossh.service
Last active January 5, 2024 08:11
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
@stonehippo
stonehippo / docker_usb_guest_osx.md
Last active January 3, 2024 21:18
Getting a USB device to show up in a Docker container on OS X

Getting a USB device to show up in a Docker container on OS X

Some background

I was trying to get the Arduino IDE to work inside a Docker container on OS X. I was able to get the IDE working (see Getting X11 GUI applications to work on OS X with Docker), but I could not figure out how to make the USB port for the Arduino visible.

The solution

I first tried to directly map hardware serial port into the Docker container, doing something like this:

@karanth
karanth / parse-imap.md
Last active August 7, 2022 06:27
Notes on parsing IMAP responses

The IMAP protocol workflow consists of the following steps,

  • A network connection established between the client and the server.
  • A greeting message sent by the server indicating that the client has successfully connected.
  • A series of interactions between the client and server.

The interactions consists of strings of lines, i.e. string terminated by a carriage return and a line feed (CRLF or \r\n). Interactions can be both commands (sent by clients) and data (sent by clients and servers). Both the client and the server strictly interact using lines or known length octet streams (8-bit characters) followed by a line.

####Client

An IMAP client issues commands to the server in a CRLF terminated string. The syntax of a command includes a tag, followed by the command and parameters. A tag is an alphanumeric identifier and each client command has a different tag for that session. A tag could be something like but not limited to A1, A2 etc.

@magnetikonline
magnetikonline / README.md
Last active December 22, 2021 17:13
Using Dnsmasq with Ubuntu 16.04LTS/14.04LTS/12.04LTS for virtual machine web application testing.

Using Dnsmasq with Ubuntu for VM web application testing

When running virtual machines under a Linux host system for testing web apps in various browsers (e.g. Internet Explorer), I found it rather tedious having to continually tweak the hosts file within each VM for the purpose of adding entries pointing back to the host machine's development web server address.

Instead the steps below will setup Dnsmasq on a Ubuntu 16.04LTS, 14.04LTS or 12.04LTS host machine for the purpose of serving both it's own DNS queries and that of virtual machine guests. Dnsmasq will parse the /etc/hosts file on your host machine where we will keep a single set of DNS entires to our test web application(s).

@ismailyenigul
ismailyenigul / nextcloud-traefik2-multi-network-deployment.yml
Last active September 15, 2021 07:55
nextcloud-traefik2-multi-network-deployment
## Trafik Multi Network Deployment
1. Create Traefik network
` # docker network create --driver=bridge --attachable --internal=false traefik `
2. Edit `traefik2/docker-compose.yml`
- Change ACME email
- Change --providers.docker.network=traefik value if you created different network then `traefik`