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 / AuthyToOtherAuthenticator.md
Created April 9, 2024 07:48 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@ultim8k
ultim8k / bot.rb
Created July 5, 2023 12:42 — forked from dideler/bot.rb
Sending a notification message to Telegram using its HTTP API via cURL
# Use this script to test that your Telegram bot works.
#
# Install the dependency
#
# $ gem install telegram_bot
#
# Run the bot
#
# $ ruby bot.rb
#
@ultim8k
ultim8k / command.sh
Created April 17, 2023 21:41 — forked from peterdemartini/command.sh
Exclude node_modules in timemachine
find `pwd` -type d -maxdepth 3 -name 'node_modules' | xargs -n 1 tmutil addexclusion
@ultim8k
ultim8k / mysql-docker.sh
Created November 30, 2021 16:03 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@ultim8k
ultim8k / mysql-volume-backup.md
Created November 30, 2021 16:03 — forked from EnigmaCurry/mysql-volume-backup.md
Physical backup and restore of MySQL data in a docker volume

Physical backup and restore of MySQL data in a docker volume

Backup

  • Login to mysql shell for the container named mysql:
docker run --rm -it --link mysql:mysql mysql:5 mysql -h mysql -u root
@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 / 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 / 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