Skip to content

Instantly share code, notes, and snippets.

View AlexZ005's full-sized avatar
💭
What's happening?

AlexZ005

💭
What's happening?
View GitHub Profile
@setlocal enableextensions enabledelayedexpansion
@echo off
set VAR=EXLETTE
for /f "skip=1" %%L in ('wmic logicaldisk where volumename^="Elements" Get Caption') do @call :SetVar %%L
set VAR=EXDEST
for /f "skip=1" %%L in ('wmic logicaldisk where volumename^="THESAURUS" Get Caption') do @call :SetVar %%L
echo Deleted files will be moved to !EXDEST:~0,-1!/DELETE/Backup-rsync-temp/Photo/
// ----------------------------------------------------------------------------------------
// Slight modification of "Toon Cloud" by Antoine Clappier - March 2015
//
// Licensed under:
// A Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
// http://creativecommons.org/licenses/by-nc-sa/4.0/
// ----------------------------------------------------------------------------------------
//#define TAU 6.28318530718
@AlexZ005
AlexZ005 / Hyper-V NAT for Windows Server 2016
Created October 8, 2018 21:37
Configuring NAT for Hyper-V Virtual Machines on Windows Server 2016
#1. Host machine
# Create new switch
New-VMSwitch -SwitchName NAT -SwitchType Internal
# Check current VM network adapters
Get-VMNetworkAdapter -VMName DC,FS
# Connect current adapters to created NAT switch
Connect-VMNetworkAdapter -VMName DC,FS -SwitchName NAT
# Add network adapters for both VM's with selected virtual switch
#Add-VMNetworkAdapter -VMName DC,FS -SwitchName NAT
[manjaro manjaro]# btrfs check --repair /dev/sda2
enabling repair mode
parent transid verify failed on 45465600 wanted 85472 found 85467
parent transid verify failed on 45465600 wanted 85472 found 85467
Ignoring transid failure
Checking filesystem on /dev/sda2
UUID: fc21feaa-71af-4b3b-8282-4a0e1ee7b2ec
repair mode will force to clear out log tree, are you sure? [y/N]: y
Fixed 0 roots.
checking extents
LeetCode April 1
//from array give a number which not repeats
/**
* @param {number[]} nums
* @return {number}
*/
var singleNumber = function(nums) {
for (var i=0; i<=nums.length;i++)
{
mkdir ~/.tmux
mkdir ~/.tmux/plugins
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
cat <<EOF >> ~/.tmux.conf
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-sessionist'
run -b '~/.tmux/plugins/tpm/tpm'
EOF
tmux source ~/.tmux.conf
@AlexZ005
AlexZ005 / VLC Powershell 2.0
Last active July 25, 2020 04:24
Download and install VLC media player
#Source: https://www.reddit.com/r/PowerShell/comments/5fxsqj/dynamically_get_current_version_of_vlc_and/
$vlcURL = "https://download.videolan.org/vlc/last/win32/"
$getHTML = (New-Object System.Net.WebClient).DownloadString($vlcURL)
$name = if ($getHTML -match '.+>(vlc-.+\.exe)<.+')
{
$Matches[1]
}
$vlcURL = "https://download.videolan.org/vlc/last/win32/$name"
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
### Configure the AWS Provider
@AlexZ005
AlexZ005 / gist:fdee3961d62a6183606639e4d2379d13
Created April 22, 2021 13:54
Setup Kubernetes Cluster - Master
#Manual Setup of Master cluster node
swapoff -a
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install curl -y
volumeMounts:
- mountPath: /usr/share/nginx/html/
name: log-volume
volumes:
- name: log-volume
hostPath:
# directory location on host
path: /tmp/username
# this field is optional