Skip to content

Instantly share code, notes, and snippets.

@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active April 17, 2025 04:55
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 (XWayland) tutorial or the WSLg (Wayland) 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

@defaye
defaye / install_cyberduck.sh
Last active July 5, 2021 12:32
Install Cyberduck cloud storage command line tool on Ubuntu 18.04
echo -e "deb https://s3.amazonaws.com/repo.deb.cyberduck.io stable main" | sudo tee /etc/apt/sources.list.d/cyberduck.list > /dev/null
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FE7097963FEFBE72
sudo apt-get update && sudo apt install -y duck
@manoj-choudhari-git
manoj-choudhari-git / app-config.ts
Created May 15, 2020 19:47
App Config TS for Azure AD protected Angular App
import { Configuration } from 'msal';
import { MsalAngularConfiguration } from '@azure/msal-angular';
// this checks if the app is running on IE
export const isIE = window.navigator.userAgent.indexOf('MSIE ') > -1 ||
window.navigator.userAgent.indexOf('Trident/') > -1;
/***********************************************************
* STEP 1 - B2C Policies and User Flows
@jjcodes78
jjcodes78 / nextjs-deploy.md
Last active January 2, 2025 15:03
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
Dependences:
sudo apt-get update
sudo apt-get install build-essential
apt-get install python-dev
sudo pip install -U setuptools
Steps:
download from https://mrjbq7.github.io/ta-lib/install.html
@gpsarkar
gpsarkar / setup-git-repo-on-onedrive.txt
Last active June 13, 2024 01:52
Setup git repo on onedrive.
Go to onedrive folder in your pc and create a folder for git repository.
Usually onedrive resides in `C:\Users\%username%\OneDrive`
Open GitBash
cd ~/OneDrive
mkdir git
cd git
mkdir myproject
cd myproject
@danallison
danallison / with_sql_session.py
Last active August 29, 2024 10:08
Connect to Postgresql locally or through SSH tunnel
from sshtunnel import SSHTunnelForwarder
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from functools import wraps
# secrets.py contains credentials, etc.
import secrets
def get_engine_for_port(port):
return create_engine('postgresql://{user}:{password}@{host}:{port}/{db}'.format(
@pedro-stanaka
pedro-stanaka / 0_base_post_install.sh
Created November 28, 2017 19:03
Post Install Script for Manjaro
#!/bin/bash
################################
######### VARIABLES ############
################################
EMAIL="[email protected]"
AUTHOR="Pedro Tanaka"
################################
# Update pacman and install keyring to avoid signature problems
@pimatco
pimatco / all-angular-material-components-imports.txt
Last active September 17, 2024 21:54
All Angular Material Components Imports from app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
//Angular Material Components
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatCheckboxModule} from '@angular/material';
import {MatButtonModule} from '@angular/material';