Skip to content

Instantly share code, notes, and snippets.

View ultim8k's full-sized avatar
🛠️
Rock & roll!

Kostas Kapenekakis ultim8k

🛠️
Rock & roll!
View GitHub Profile
@ultim8k
ultim8k / Resize virtual machine partition.md
Created September 23, 2021 09:49 — forked from HugoPoi/Resize virtual machine partition.md
How to resize virtual machine partition after extend the disk

Resize a VM system disk

Introduction

  • You have a VM with small disk
  • You have GPT partition table
  • You NOT USE LVM (you should)
  • You need to extend a partition on the main drive
  • You use Debian 8.x aka Jessie

Extend the disk

@ultim8k
ultim8k / wifi-qrcode-generator.sh
Created February 27, 2021 02:40
Create QR code for your wifi using qrencode
qrencode "WIFI:T:WPA;S:${SSID};P:${PASSWORD};;" -o wifi.png
@ultim8k
ultim8k / autossh.service
Created February 21, 2021 15:00 — forked from thomasfr/autossh.service
Systemd service for autossh
[Unit]
Description=Keeps a tunnel to 'remote.example.com' open
After=network.target
[Service]
User=autossh
# -p [PORT]
# -l [user]
# -M 0 --> no monitoring
# -N Just open the connection and do nothing (not interactive)
@ultim8k
ultim8k / script-template.sh
Created January 20, 2021 16:38 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@ultim8k
ultim8k / docker_compose_cheatsheet.md
Created December 12, 2020 02:46 — forked from jonlabelle/docker_compose_cheatsheet.md
Docker Compose Cheatsheet
@ultim8k
ultim8k / cocktail-recipes.md
Last active January 24, 2023 01:49
Cocktail recipes

Cocktail Recipes

Espresso Martini 🍸 ☕️

  • 30 ml Kahlua
  • 30 ml vodka
  • 30 ml espresso
  • couple of ice cubes
  • Coffee beans to garnish
# Track time of execution
RPROMPT="[%D{%F}T%*]"
TMOUT=1
TRAPALRM() {
zle reset-prompt
}
provider "aws" {
region = "eu-west-1"
}
# Lambda
resource "aws_lambda_function" "tf-example" {
function_name = "ServerlessExample"
# The bucket name as created earlier with "aws s3api create-bucket"
s3_bucket = "tf-example-store"
@ultim8k
ultim8k / git_retag
Last active February 13, 2024 08:56 — forked from lucijafrkovic/git_retag
Retagging on git
1. list all remote tags
git ls-remote --tags
2. delete local tag
git tag -d v1.0.1
3. push tag deletion to remote
git push origin :refs/tags/v1.0.1
4. tag local branch again
@ultim8k
ultim8k / uuid.sh
Created October 10, 2019 09:32
Generate UUID in BASH/ZSH
### Source: https://coderwall.com/p/t_sz3q/generate-uuid-at-shell-prompt
# alias uuid="python -c 'import sys,uuid; sys.stdout.write(str(uuid.uuid4()))' | pbcopy && pbpaste && echo"
alias uuid="uuidgen | tr -d '\n' | tr '[:upper:]' '[:lower:]' | pbcopy && pbpaste && echo"