Skip to content

Instantly share code, notes, and snippets.

View ramizpolic's full-sized avatar
⚔️
Bitwise operations

Ramiz Polic ramizpolic

⚔️
Bitwise operations
View GitHub Profile
@ramizpolic
ramizpolic / mount_qcow2.md
Created February 2, 2024 09:57 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@ramizpolic
ramizpolic / getting-going-best-practices.md
Created January 19, 2024 13:42 — forked from jbjonesjr/getting-going-best-practices.md
Getting Going and Best Practices Guide

GitHub Onboarding and Introduction

A guide for getting started and best practices for teams new to, or improving their interactions with, GitHub

image GitHub's features and capabilities

This document is meant to help new teams to GitHub familiarize themselves with the features and platform, as well as start to explore some of the best practices. While not a complete exploration, it's meant as a introduction to the key tenets of using GitHub for your business. For teams and organizations that desire more one on one support, GitHub Professional Services has many different options available to customize tools, training, and process to best meet your needs. The GitHub offerings listed in the diagram above are just a sampling of the various capabilities and we'd love to create a customized offering to meet your specific organizational needs.

Overview and Intr

@ramizpolic
ramizpolic / main.go
Last active July 5, 2023 21:09
Running arbitrary scripts in Docker via Golang
package main
import (
"bufio"
"context"
"fmt"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
"io"
@ramizpolic
ramizpolic / ts_validator.ts
Last active December 22, 2020 15:22
Reusable React TypeScript equality validator (for Ant)
import { useMemo } from 'react';
import { TFunction } from 'i18next';
import { useTranslation } from 'react-i18next';
import { RuleObject, RuleRender } from 'antd/lib/form';
import { StoreValue } from 'antd/lib/form/interface';
const equalTo = (
t: TFunction,
): ((field: string, translation_key?: string) => RuleRender) => {
/**
@ramizpolic
ramizpolic / destroy-gcp-dns.sh
Created June 10, 2020 16:54
Delete DNS zone and its records at Google Cloud Platform
#!/bin/bash
set -eo pipefail
DNS_ZONE_NAME="example-dns-zone"
echo -e "Destroying dns zone ($DNS_ZONE_NAME)...\n"
# Purge all DNS records
DNS_RECORDS=$(gcloud dns record-sets list --zone=$DNS_ZONE_NAME --format=json | jq '. |
map(select(.type != ("NS") and .type != ("SOA")))')
@ramizpolic
ramizpolic / yaml_win_to_wsl.py
Created June 2, 2020 14:54
Convertes YAML file containing Windows paths to WSL paths
#!/usr/bin/env python
# Install requirements
# - pip install wsl-path-converter
# - pip install PyYAML
import yaml
import collections
import wsl_path_converter