Skip to content

Instantly share code, notes, and snippets.

View officialmofabs's full-sized avatar

Moses Fabiyi officialmofabs

View GitHub Profile
@officialmofabs
officialmofabs / remote-wsl.md
Created July 23, 2024 05:11 — forked from mattbell87/remote-wsl.md
VSCode Remote: Connect to WSL2 from another machine

VSCode Remote: Connect to WSL2 from another machine

Do you want to do remote development on your WSL2 container in Visual Studio Code? Read this.

Proxy jump method

  1. On the host set up OpenSSH for Windows
  2. Run wsl --update to make sure you are running the latest WSL
  3. Open WSL and install another SSH server inside WSL with sudo apt-get install openssh-server
  4. Now run sudo systemctl enable --now ssh to automatically start ssh when WSL starts.
@officialmofabs
officialmofabs / WSL2GUIXvnc-en.md
Created July 21, 2024 13:03 — forked from tdcosta100/WSL2GUIXvnc-en.md
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

Note

If you want to use pure WSLg, you can try the new WSLg tutorial.

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc) and tigervnc-standalone-server.

For this setup, I will use Ubuntu (20.04, 22.04 and 24.04 are working), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

@officialmofabs
officialmofabs / settings.json
Created July 14, 2024 04:14 — forked from kboomska/settings.json
VS Code User Settings (JSON)
{
"workbench.iconTheme": "material-icon-theme",
"editor.showDeprecated": false,
"explorer.compactFolders": false,
"workbench.startupEditor": "none",
"explorer.copyRelativePathSeparator": "/",
"editor.unicodeHighlight.allowedLocales": {
"ru": true
},
"git.openRepositoryInParentFolders": "always",
@officialmofabs
officialmofabs / docker-dhcpd.md
Created May 15, 2024 04:49 — forked from kliberty/docker-dhcpd.md
Short guide on how to set up a Docker container as a DHCP server

Setting up a Docker container as a DHCP server

In this guide I’ve tested a number of different commands and configurations using Docker to run a container with dhcpd (+macvlan driver) to serve my clients in my home network. In the end i’ll migrate from my Windows 2012 R2 Server running DHCP to a much more lightweight Docker container (7.42 MB in total). Wow.

My home environment:

  • Firewall (Juniper)
    • I’m running IP helper for bootp which in this case means that i relay DHCP requests from various VLANs into one where i've placed my Windows 2012 R2 server. This is also where my container will live. See the FW configuration below:
@officialmofabs
officialmofabs / cloud-init-create-seed
Created May 9, 2024 03:44 — forked from toabctl/cloud-init-create-seed
Create a config drive iso for cloud-init
cat <<EOF > user-data
#cloud-config
debug: True
disable_root: False
ssh_deletekeys: False
ssh_pwauth: True
ssh_authorized_keys:
- ssh-rsa XXX
# users:
@officialmofabs
officialmofabs / vscode-extensions.sh
Created May 7, 2024 06:05 — forked from matthiasott/vscode-extensions.sh
A bash script to install Visual Studio Code extensions via the CLI
# https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments
code --install-extension aaron-bond.better-comments
# https://marketplace.visualstudio.com/items?itemName=alefragnani.project-manager
code --install-extension alefragnani.project-manager
# https://marketplace.visualstudio.com/items?itemName=bmewburn.vscode-intelephense-client
code --install-extension bmewburn.vscode-intelephense-client
# https://marketplace.visualstudio.com/items?itemName=christian-kohler.npm-intellisense
@officialmofabs
officialmofabs / auto_git_file.md
Created May 1, 2024 23:18 — forked from darencard/auto_git_file.md
Automatic file git commit/push upon change

Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.

Automatically push an updated file whenever it is changed

Linux

  1. Make sure inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
@officialmofabs
officialmofabs / Git push deployment in 7 easy steps.md
Created May 1, 2024 23:16 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
Error:
dpkg: error processing package mysql-server (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure.
Errors we re encountered while processing: mysql-server-8.0 mysql-server E: Sub-process /usr/bin/dpkg returned an error code
Step to encount the error:
1. sudo apt-get clean
2. sudo apt-get purge mysql*
3. sudo apt-get updateYou10:58
4. sudo apt-get purge mysql*
@officialmofabs
officialmofabs / daemon.json
Created May 1, 2024 14:44 — forked from MrThiemann/daemon.json
Example Docker daemon.json
{
"api-cors-header": "",
"authorization-plugins": [],
"bip": "",
"bridge": "",
"cgroup-parent": "",
"cluster-store": "",
"cluster-store-opts": {},
"cluster-advertise": "",
"debug": true,