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 / 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 / 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,
@officialmofabs
officialmofabs / vscode-extensions.bat
Created April 20, 2024 17:39 — forked from leodutra/vscode-extensions.bat
My Visual Studio Code Extensions for Windows and Linux (vscode ext)
call code --install-extension alefragnani.bookmarks
call code --install-extension amandeepmittal.pug
call code --install-extension amazonwebservices.aws-toolkit-vscode
call code --install-extension angular.ng-template
call code --install-extension bierner.markdown-preview-github-styles
call code --install-extension coenraads.bracket-pair-colorizer-2
call code --install-extension cweijan.vscode-office
call code --install-extension DavidAnson.vscode-markdownlint
call code --install-extension dbaeumer.vscode-eslint
call code --install-extension eamodio.gitlens
@officialmofabs
officialmofabs / httpd.conf
Last active July 8, 2024 22:52 — forked from gaspanik/httpd.conf
Apache: sample-httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# Default log files, DB, archives, etc.
*.log
*.sql
*.zip
*.sqlite
*.7z
*.dmg
*.gz
*.iso
*.jar
@officialmofabs
officialmofabs / cloud-init.yaml
Created March 26, 2024 17:47 — forked from pmbaumgartner/cloud-init.yaml
Multipass & Docker Setup
#cloud-config
package_upgrade: true
ssh_authorized_keys:
- <your key>
packages:
- apt-transport-https
- ca-certificates
- curl

#Adding an existing project to GitHub using the command line

Simple steps to add existing project to Github.

1. Create a new repository on GitHub.

In Terminal, change the current working directory to your local project.

##2. Initialize the local directory as a Git repository.

git init
# https://hub.docker.com/repository/docker/aleleba/code-server
FROM codercom/code-server:3.12.0
RUN sudo apt-get update
#Instalando Node.js
RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
RUN sudo apt -y install nodejs
#Terminando de Instalar Node.js