Skip to content

Instantly share code, notes, and snippets.

View kumarchandresh's full-sized avatar
🛠️
Tinkering stuff

Kumar Chandresh kumarchandresh

🛠️
Tinkering stuff
View GitHub Profile
@kumarchandresh
kumarchandresh / jupyter_notebook_config.py
Last active October 11, 2021 15:51
Jupyter notebook config
# Configuration file for jupyter-notebook.
#------------------------------------------------------------------------------
# Application(SingletonConfigurable) configuration
#------------------------------------------------------------------------------
## This is an application.
## The date format used by logging formatters for %(asctime)s
# Default: '%Y-%m-%d %H:%M:%S'
# c.Application.log_datefmt = '%Y-%m-%d %H:%M:%S'
@kumarchandresh
kumarchandresh / resolve_path.sh
Created November 28, 2020 09:30
How to resolve/expand path in Linux (Ubuntu) shell script
#!/bin/bash
# Examples:
# resolve_path "/abc/xyz"
# resolve_path "./abc/xyz"
# resolve_path "./abc/../xyz"
resolve_path() {
retval=
while read -r pathseg; do
function Set-Wallpaper {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateScript( { Test-Path -Path $_ })]
[String] $Path
)
$Definition = @"
using System;
@kumarchandresh
kumarchandresh / wallpaper.ps1
Created March 9, 2020 07:48
Change Windows wallpaper to one of the Windows Spotlight (Lockscreen) background using PowerShell
function Set-Wallpaper {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateScript( { Test-Path -Path $_ })]
[String] $Path
)
$Definition = @"
using System;

1. Make sure everything is updated.

sudo apt update && sudo apt upgrade -y

2. Install Python 3.7

sudo apt install python3.7-minimal

3. Add Python 3.7 to python3 alternatives

Register both Python 3.7 and and preinstalled Python 3.6 to python3 alternatives.

1. Create/Edit wsl.conf file in WSL

sudo vim /etc/wsl.conf

2. Add the following code in interop section of wsl.conf

[interop]
appendWindowsPath=false

3. Restart WSL and check PATH