Skip to content

Instantly share code, notes, and snippets.

View bluPhy's full-sized avatar
🏠
Working from home

bluPhy bluPhy

🏠
Working from home
View GitHub Profile
@bluPhy
bluPhy / vscode-remote-ssh-root.sh
Last active December 20, 2023 05:25
workaround hack to open vscode remote as root without logging in as root
#!/bin/bash
# Backup the original server.sh file
cp ~/.vscode-server/bin/*/server.sh ~/.vscode-server/bin/server.sh.bak
# Add sudo to node runner in server.sh
if sed -i "/node/s/^/sudo /" ~/.vscode-server/bin/*/server.sh; then
echo "sudo added to node runner in server.sh"
else
echo "Failed to add sudo to node runner. Please check the sed command."
@bluPhy
bluPhy / hosts.ps1
Last active August 31, 2021 11:13 — forked from lantrix/hosts.ps1
Powershell script for adding/removing/viewing entries to the hosts file.
#
# Powershell Functions for adding/removing/showing entries to the hosts file.
#
# Known limitations:
# - does not handle entries with comments afterwards ("<ip> <host> # comment")
#
Function Use-RunAs {
# Check if script is running as Administrator and if not use RunAs
# Use Check Switch to check if admin
param([Switch]$Check)