Skip to content

Instantly share code, notes, and snippets.

View inceabdullah's full-sized avatar
🏢
Working from office

inceabdullah

🏢
Working from office
View GitHub Profile
@inceabdullah
inceabdullah / %% Ansible Get Current Host IP.md
Created December 17, 2023 12:48
Ansible Get Current Host IP

Ansible Get Current Host IP

   - name: IPv4
     ansible.builtin.debug:
       msg:
         ipv4: "{{ ansible_facts['env'].SSH_CONNECTION.split(' ')[2] }}"
@inceabdullah
inceabdullah / dump-docker-images-from-list-file.sh
Created December 14, 2023 12:23
Tar Dump All Docker Images From List
#!/bin/bash
# cat imagelist.txt |bash THISSCRIPT.sh
# imagelist.txt:
# nginx:latest
# user/image:tag
color_echo() {
local color='\033[1;33m'
@inceabdullah
inceabdullah / docker-list-local-images-and-digests.sh
Created December 14, 2023 11:51
Docker List Local Images and Its Digests
#!/bin/bash
# Prerequirements
# rargs
# INCLUSIVE_REGEX= # word which will not be included
GREP_INCLUSIVE_COMMAND_PIPE=
if [ ! -z "$INCLUSIVE_REGEX" ] ;
@inceabdullah
inceabdullah / nexus-repository-item-list-with-digests.sh
Created December 14, 2023 10:46
Nexus List of Image Names an Digests
#!/bin/bash
# Bash script interacts with a Nexus repository manager to retrieve information
# about Docker images stored in a specified repository. It iterates through the
# components (images), extracts their name and version, and fetches the image
# manifest using Docker commands. The script then outputs the SHA256 digest
# along with the image name.
@inceabdullah
inceabdullah / Dockerfile
Created November 27, 2023 12:16
xmpp-proxy - Rust builder - Dockerfile
FROM rust@sha256:e0740b99be8107433f623772f3ee44f63da96df56306a8b599bfd501a256e9b9
WORKDIR /usr/src
COPY ./xmpp-proxy ./
RUN cargo install --path .
RUN cargo build --release --no-default-features --features c2s-incoming,tls
CMD ["./target/release/xmpp-proxy"]
@inceabdullah
inceabdullah / 11-media-by-label-auto-mount.rules
Last active December 12, 2023 05:04
Automound Umount USD Device UDev
#/etc/udev/rules.d/11-media-by-label-auto-mount.rules
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"
IMPORT{program}="/sbin/blkid -o udev -p %N"
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"
KERNEL=="sd[a-z][0-9]", ENV{USER}="<USER: whoami>"
ACTION=="add", ENV{mount_options}="relatime,uid=<UID: id -u>
@inceabdullah
inceabdullah / dump-all-docker-images.sh
Last active November 20, 2023 11:58
Tar Dump All Docker Images
#!/bin/bash
# https://stackoverflow.com/a/37650072
# curl -fsSL https://gist.githubusercontent.com/inceabdullah/fc9fcd467d55ad381df5f297013fca96/raw/4fff61312690877fbc1b05a9daa0aa1a72586f26/dump-all-docker-images.sh | bash
DUMP_DIR=$PWD
color_echo() {
local color='\033[1;33m'
local message=$1
local BOLD='\033[31m'
#!/bin/bash
# https://unix.stackexchange.com/a/332522
# https://raw.githubusercontent.com/cykerway/complete-alias/master/complete_alias
source ~/.bash_completion.d/complete_alias
# Get all aliases
aliases=$(alias)
# Extract alias names
@inceabdullah
inceabdullah / .k8s_aliases
Created November 10, 2023 07:02
Kubernetes Aliases
alias kx='kubectx'
@inceabdullah
inceabdullah / netplan.conf.html
Created November 9, 2023 10:14
Netplan Conf
<meta charset="utf-8" />
<b style="font-weight:normal" id="docs-internal-guid-4c053d32-7fff-e2ab-2c71-42d00e24573d">
<h2 dir="ltr" style="line-height:1.38;margin-top:18pt;margin-bottom:6pt"><span style="font-size:16pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap">Netplan Conf</span></h2>
<p dir="ltr" style="line-height:1.38"><span style="font-size:11pt;font-family:Arial,sans-serif;color:#000000;background-color:transparent;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;white-space:pre-wrap">Example: 2 NIC, one of them has 2 different IP, another has different gateway</span></p>
<br />
<p dir="ltr" style="line-height:1.6285714285714286;background-color:#1e1e1e"><span style="font-size:10.5pt;font-family:'Courier New',monospace;color:#569cd6;background-color:transparent;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre;wh