Skip to content

Instantly share code, notes, and snippets.

View it3xl's full-sized avatar

Ilya Tretyakov #it3xl it3xl

View GitHub Profile
@it3xl
it3xl / split-bash-string-command.sh
Last active May 8, 2022 14:42
Splitting Long Strings and Commands in Bash
ns=my_ns
my_pod=pod-of-mine
zuza='oppa doppa'
# As a direct command.
kubectl -n $ns exec $my_pod -- sh -c ' \
val="tram '"$zuza"' pam"; \
echo gu '"$zuza"' ga; \
echo la la "$val" la la;'
# For https://stackoverflow.com/questions/40569045/register-scheduledjob-as-the-system-account-without-having-to-pass-in-credentia/60554216#60554216
$ErrorActionPreference = 'Stop'
Clear-Host
#### Start of Main Logic ###########################
$taskName = "my_PowerShell_job"
$accountId = "NT AUTHORITY\SYSTEM";
@it3xl
it3xl / Employee-Transact-SQL.sql
Created July 7, 2021 05:18
Handy little Transact-SQL queries for employee data
-- http://sqlfiddle.com/#!18/f85ba/44
CREATE TABLE Department(
ID INT PRIMARY KEY CLUSTERED,
Name NVARCHAR (256) NOT NULL
);
CREATE TABLE Employee(
ID INT PRIMARY KEY CLUSTERED,
Department_ID INT,
Chief_ID INT,
@it3xl
it3xl / EnableWiFiAdapter.ps1
Created June 12, 2021 17:55
PowerShell, enable my Wi-Fi adapter
# The "Wi-Fi" below should be a concreat name of your Wi-Fi adapter.
Enable-NetAdapter -Name Wi-Fi
@it3xl
it3xl / MakeMeAdm.ps1
Created June 12, 2021 17:50
PowerShell, make user an Administrator
# For PoserShell 5.1 and above.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-PackageProvider -Name NuGet -Force -Scope AllUsers
Install-Module -Name Microsoft.PowerShell.LocalAccounts -Force -Scope AllUsers
#Get-Module -ListAvailable -Name Microsoft.PowerShell.LocalAccounts
##Import-Module -Name Microsoft.PowerShell.LocalAccounts
Add-LocalGroupMember -Group Administrators -Member MyDomain\MyLogin