This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Obtains the Windows Host IP Address | |
# This can be used for accessing resources on the host device (eg. adb to WSA) | |
export WSL_HOST_IP="$(tail -1 /etc/resolv.conf | cut -d' ' -f2)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Elevation! | |
# https://stackoverflow.com/a/31602095/2041598 | |
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit } | |
$remoteport = wsl hostname -I | |
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; | |
if( $found ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PWD=$(pwd) | |
DAYS_THRESHOLD=5 | |
# Check if in Git Repository | |
if [ ! "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then | |
echo "This is not a git repository!" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH-Agent | |
## SSH Agent and keys | |
# set SSH_AUTH_SOCK env var to a fixed value | |
export SSH_AUTH_SOCK=~/.ssh/ssh-agent.sock | |
# test whether $SSH_AUTH_SOCK is valid | |
ssh-add -l 2>/dev/null >/dev/null | |
# if not valid, then start ssh-agent using $SSH_AUTH_SOCK | |
if [ $? -ge 2 ]; then | |
# if sock file exists, let's delete it | |
if [[ -e "$SSH_AUTH_SOCK" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mysqlPWD=frappe | |
if [ "$#" -ne 3 ]; then | |
echo "Please pass the v10 URL, sitename and the backup timestamp" | |
exit | |
fi | |
if [ ! -d "./v10-data" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.spread-screen { | |
width: 100vh; | |
// bootstrap 4 | |
// the following are referenced from bootstrap.scss/_grid.scss | |
// mixins/_grid.scss @make-container @make-container-max-widths mixins | |
margin-left: -$spacer; | |
@each $breakpoint, $container-max-width in $container-max-widths { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import win32com.client | |
import string, sys | |
xlApp = win32com.client.Dispatch("Excel.Application") | |
print("Excel library version:", xlApp.Version) | |
path = "Statement.xlsx" | |
tokens = [str(x) for x in list(range(0,4))] | |
# tokens.extend([x for x in string.ascii_lowercase]) |