Skip to content

Instantly share code, notes, and snippets.

View shantanoo-desai's full-sized avatar

Shan Desai shantanoo-desai

View GitHub Profile
@pirate
pirate / docker-compose-backup.sh
Last active January 26, 2025 23:38
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@carlwgeorge
carlwgeorge / gnome.yml
Last active April 8, 2025 10:18
ansible playbook for my gnome setup
# https://docs.ansible.com/ansible/latest/modules/dconf_module.html
#
# To determine what dconf keys and values to use, you can run `dconf watch /`
# in a terminal as you make changes in settings or tweaks. You can also use
# `dconf read <key>` and `dconf write <key> <value>` to experiment with various
# settings. The dconf-editor application is also useful for exploring various
# keys along with their descriptions.
- hosts: localhost
tasks:
@alanljj
alanljj / get_ver.sh
Created April 3, 2019 03:16
get linux version shell
#!/bin/bash
Get_Dist_Name()
{
if grep -Eqii "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
DISTRO='CentOS'
PM='yum'
elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then
DISTRO='RHEL'
PM='yum'
elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then
@syntaqx
syntaqx / cloud-init.yaml
Last active April 21, 2025 10:14
cloud init / cloud config to install Docker on Ubuntu
#cloud-config
# Option 1 - Full installation using cURL
package_update: true
package_upgrade: true
groups:
- docker
system_info:
@luk6xff
luk6xff / ARMonQEMUforDebianUbuntu.md
Last active May 13, 2025 12:57 — forked from bruce30262/ARMDebianUbuntu.md
Emulating ARM with QEMU on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux

If there's no qemu-arm-static in the package list, install qemu-user-static instead

@iNamik
iNamik / docker_compose-Makefile
Last active January 22, 2024 13:12
Makefile To Help Manage Docker-Compose Services
##
# Makefile to help manage docker-compose services
#
# Built on list_targets-Makefile:
#
# https://gist.github.com/iNamik/73fd1081fe299e3bc897d613179e4aee
#
.PHONY: help about args list targets services build up down rebuild clean start status ps logs stop restart sh bash shell
# If you need sudo to execute docker, then udpate these aliases
@exocode
exocode / xfs-on-hetzner.yml
Last active March 17, 2025 09:17
Create xfs partitions on Hetzner via cloud-init. It keeps root disk available again after rebooting. Simply change your desired sizes and filesystem to use it for your needs.
#cloud-config
resize_rootfs: false
disk_setup:
/dev/sda:
table_type: 'mbr'
layout:
- 25
- 75
overwrite: true
@amatai
amatai / python_shutdown_asyncio.py
Last active March 17, 2021 21:05
Python asyncio: how to cleanly handle sighandlers and close all pending tasks
#!/usr/bin/env python3.6
import asyncio
import signal
async def taskX(task_name, loop):
while True:
try:
# simulate long running task
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active May 13, 2025 02:26
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 27, 2025 15:25
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example