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
Setting up a VirtualBox Machine and Preparing a Kubernetes Cluster
Step 1: Download OVA Image
Download the Ubuntu 25.04 Server Cloud image from:
https://cloud-images.ubuntu.com/releases/plucky/release/ubuntu-25.04-server-cloudimg-amd64.ova
Step 2: Import to VirtualBox
* File > Import Appliance
* Set:
@AlexZ005
AlexZ005 / zsh-theme-changer.sh
Created June 13, 2024 03:33
Change zsh themes in loop, execute as ./zsh-theme-changer.sh && source ~/.zshrc
#!/bin/bash
# Directory containing the themes
THEME_DIR=~/.oh-my-zsh/themes/
# Path to the temporary file storing the theme index
INDEX_FILE=~/.theme_index
# Function to change the theme
change_theme() {
@AlexZ005
AlexZ005 / VLC
Created December 30, 2021 16:45
vlc --extraintf=http --http-host 127.0.0.1 --http-port 8081 --http-password any_password
vlc --extraintf=http --http-host 127.0.0.1 --http-port 8082 --http-password any_password
set CURLOPT_USERPWD=":any_password"
curl -u %CURLOPT_USERPWD% http://127.0.0.1:8082/requests/status.xml?command=pl_pause & curl -u %CURLOPT_USERPWD% http://127.0.0.1:8081/requests/status.xml?command=pl_pause
@AlexZ005
AlexZ005 / bashrc-pick-username
Last active October 4, 2021 17:08
ask for a username on login and create a new directory in home folder
#prepare bashrc
read -p 'Pick username: ' user
#[ -d $user ] && echo "WARNING! User already exists!" || mkdir ~/$user
if [[ ! -d $user ]]; then
mkdir $user
else
echo "WARNING! User already exists! Overwrite?"
read -p "" -n 1 -r
echo # (optional) move to a new line
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
@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
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
### Configure the AWS Provider
@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"
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
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++)
{