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
sudo apt install -y apt-transport-https curl gnupg | |
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg | |
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/ | |
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list | |
sudo apt update -y && sudo apt install -y bazel clang lldb lld openjdk-8-jdk llvm build-essential libc++-dev | |
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH" | |
export LDFLAGS="-L/usr/local/opt/llvm/lib" | |
export CPPFLAGS="-I/usr/local/opt/llvm/include" | |
export CC=$(which clang)' >> ~/.profile | |
git clone https://github.com/carbon-language/carbon-lang |
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
# Description: Control Bluetooth via console commands using only one function. | |
# Argument 1: 'on'; 'off'; 'show'; 'connect'; 'disconnect'; 'scan'; 'pair' | |
# Argument 2 (connect, disconnect, pair): A Bluetooth device name | |
bluetooth() { | |
if [ "$1" = "on" ]; then | |
sudo rfkill unblock bluetooth | |
echo "Bluetooth Enabled" | |
elif [ "$1" = "off" ]; then | |
sudo rfkill block bluetooth |
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
> [!NOTE] | |
> Highlights information that users should take into account, even when skimming. | |
> [!TIP] | |
> Optional information to help a user be more successful. | |
> [!IMPORTANT] | |
> Crucial information necessary for users to succeed. | |
> [!WARNING] |
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
function Check-DefaultBrowser { | |
$currentBrowserProgId = (Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice').ProgId | |
return -not ($currentBrowserProgId -like "FirefoxURL-*") | |
} | |
function Check-DefaultPDFApplication { | |
$User = New-Object System.Security.Principal.NTAccount($env:UserName) | |
$sid = $User.Translate([System.Security.Principal.SecurityIdentifier]).value | |
$key = "HKU:\${sid}\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice" |
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
function Get-ComputerSerialNumber { | |
try { | |
$SerialNumber = (Get-WmiObject -class win32_bios).SerialNumber | |
return $SerialNumber | |
} catch { | |
Write-Error "Failed to retrieve computer model and manufacturer information." | |
} | |
} | |
Get-ComputerSerialNumber |
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
function Get-EthernetIPAddress { | |
try { | |
# Get network adapters with Ethernet in their description | |
$adapters = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like '*Ethernet*' } | |
if ($adapters.Count -eq 0) { | |
Write-Error "No Ethernet adapter found." | |
return $null | |
} |
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
function Get-EthernetMacAddress { | |
try { | |
# Get network adapters | |
$adapters = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like '*Ethernet*' } | |
if ($adapters.Count -eq 0) { | |
Write-Error "No Ethernet adapter found." | |
return $null | |
} |
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
function Get-ComputerModelAndManufacturerFolderName { | |
try { | |
$csModel = (Get-ComputerInfo).CsModel | |
$csManufacturer = (Get-ComputerInfo).CsManufacturer | |
$folderName = $csManufacturer + " " + $csModel | |
return $folderName | |
} catch { | |
Write-Error "Failed to retrieve computer model and manufacturer information." | |
} | |
} |
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
function Get-WifiIPAddress { | |
try { | |
# Get network adapters with Wi-Fi in their description | |
$adapters = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like '*Wi-Fi*' } | |
if ($adapters.Count -eq 0) { | |
Write-Error "No Wi-Fi adapter found." | |
return $null | |
} |
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
function Get-WifiMacAddress { | |
try { | |
# Get network adapters | |
$adapters = Get-NetAdapter | Where-Object { $_.InterfaceDescription -like '*Wi-Fi*' } | |
if ($adapters.Count -eq 0) { | |
Write-Error "No Wi-Fi adapter found." | |
return $null | |
} |
OlderNewer