Skip to content

Instantly share code, notes, and snippets.

@anthonyaxenov
anthonyaxenov / install-golang.sh
Last active June 28, 2023 14:07
[SHELL] Install golang
#!/bin/bash
# GoLang installer
# https://golang.org/doc/install
# https://www.vultr.com/docs/install-the-latest-version-of-golang-on-ubuntu
# if [ "$EUID" -ne 0 ]
# then echo "*** root permissions required ***"
# exit
@anthonyaxenov
anthonyaxenov / stacktrace.sh
Last active June 28, 2023 14:10 — forked from akostadinov/stack_trace.sh
[SHELL] Print stacktrace
# Original: https://gist.github.com/akostadinov/33bb2606afe1b334169dfbf202991d36
# The difference is that this func outputs stacktrace in reverse order (from top level to lower ones)
function print_stacktrace () {
STACK=""
local i
local stack_size=${#FUNCNAME[@]}
echo "Stacktrace:"
# skip this function and "MAIN non_file_source:0"
for (( i=$stack_size-1; i>=1; i-- )); do
local func="${FUNCNAME[$i]}"
@anthonyaxenov
anthonyaxenov / helpers.sh
Last active July 23, 2023 01:20
[SHELL] My bash helpers
#########################################################################
# #
# Bunch of helpers for bash scripting #
# #
# This file is compilation from some of my projects. #
# I'm not sure they're all in perfiect condition but I use them #
# time to time in my scripts. #
# #
#########################################################################
@anthonyaxenov
anthonyaxenov / convert.php
Last active August 3, 2023 08:38
[PHP] Simple Postman Collection to http converter
<?php
// This gist was erased.
// I recommend you to take a closer look at my new cli-tool:
//
// https://packagist.org/packages/axenov/pm-convert
//
// It can convert multple collections v2.1 to http/wget/curl formats
// very quickly and without 3rd-party dependencies.
@anthonyaxenov
anthonyaxenov / args.sh
Last active September 11, 2023 12:30
[SHELL] Argument parser for bash scripts without getopt or getopts
#!/bin/bash
#########################################################################
# #
# Argument parser for bash scripts #
# #
# Author: Anthony Axenov (Антон Аксенов) #
# Version: 1.5 #
# License: MIT #
# #
#########################################################################
@anthonyaxenov
anthonyaxenov / s3-backup.sh
Last active December 23, 2023 20:26
[SHELL] Backup your project to another server
#!/bin/bash
#####################################################################
# #
# Stupidly simple backup script for own projects #
# #
# Author: Anthony Axenov (Антон Аксенов) #
# Version: 1.2 #
# License: WTFPLv2 More info (RU): https://axenov.dev/?p=1272 #
# #
#####################################################################