Skip to content

Instantly share code, notes, and snippets.

View vlazic's full-sized avatar
🏠
Working from home

Vladimir Lazić vlazic

🏠
Working from home
View GitHub Profile
@vlazic
vlazic / filter-domains.sh
Last active September 7, 2023 16:34
A script that goes through a list of domains and filters only those that contain a specific HTTP header
#!/bin/bash
DOMAINS_FILE="domains.txt"
OUTPUT_FILE="domains_with_header.txt"
PROGRESS_FILE="progress.txt"
HEADER="X-Booking-Engine"
# Function to print the current status
print_status() {
echo "Total domains: $total_lines"
@vlazic
vlazic / .gitignore
Last active January 6, 2023 04:44
Suggests a commit message based on the staged files using OpenAI's GPT-3 API.
node_modules
@vlazic
vlazic / README.md
Last active June 23, 2022 12:00
Test CORS access with cURL

Test CORS access with cURL

What is it?

This script is a simple tool to test if server allows cross-origin resource sharing (CORS), i.e. if server allows requests from some domain.

Installation

Download script to ~/.local/bin/cors_test.sh

@vlazic
vlazic / yt-dl.sh
Last active June 18, 2021 07:26
Download list of YouTube videos in MP3 format
#!/usr/bin/env bash
blue='\033[0;34m'
nocolor='\033[0m'
green='\033[0;32m'
downloadFolder="download"
playlistFile="playlist.txt"
function exit_on_error_and_undefined() {
#!/usr/bin/env bash
# TODO: get more ideas from: https://github.com/martinburger/bash-common-helpers
blue='\033[0;34m'
nocolor='\033[0m'
red="\033[0;31m"
green="\033[0;32m"
# https://github.com/martinburger/bash-common-helpers/blob/master/bash-common-helpers.sh
@vlazic
vlazic / big-repo-cloner.sh
Created August 12, 2020 12:17 — forked from gianlucaparadise/big-repo-cloner.sh
Big repo cloner - Script to clone a git repository bigger than 1GB
# Script hosted here: https://gist.github.com/gianlucaparadise/10286e0b1c5409bd1049d67640fb7c03
# A repository bigger than 1 GB can't be cloned normally.
# In order to clone it, you need to follow the instructions from:
# https://stackoverflow.com/a/53068021/6155481
# To execute:
# sh big-repo-cloner.sh <repo_uri> <repo_destination_folder> [<checkout_branch_name>]
# repo_uri and repo_destination_folder are mandatory
# checkout_branch_name is optional
@vlazic
vlazic / avada-favicon.sh
Created April 22, 2020 10:52
Avada Favicon generator
#!/bin/bash
# this script requires ImageMagick suite to be installed
sizes=(32 57 72 114 144)
identify $1 >/dev/null || {
echo "First parameter shoud be your favicon file"
exit 0
}
@vlazic
vlazic / resume.json
Last active September 15, 2021 22:24
{
"basics": {
"name": "Vladimir Lazić",
"picture": "https://avatars2.githubusercontent.com/u/108793?v=4",
"label": "Self Employed",
"headline": "Software Engineer",
"summary": "Software Engineer with industry experience in building web apps, kind of a bookworm and a passionate hiker :)\n\nI've always aspired to learn all aspects of web development and that’s how my journey started as a fullstack web developer (LAMP stack and KnockoutJS/jQuery).\n\nThen I decided to pick some area to specialize in, and I picked frontend (mainly React and TypeScript) which I worked on for a few years.\n\nAs a long time Linux user I have my own collection of Bash and Python scripts that I use on a daily basis and in my previous job in Easy Aerial I got to implement this knowledge. I was fortunate to be involved in a lot of DevOps activities including setting up BitBucket Pipelines, Bash scripts, Vagrant VM’s etc. There I had the opportunity to mentor a lot of brilliant young programmers and to be a team lea
YAML 2 hrs 13 mins ██████▊░░░░░░░░░░░░░░ 32.4%
TypeScript 1 hr 30 mins ████▋░░░░░░░░░░░░░░░░ 22.0%
Other 1 hr 25 mins ████▎░░░░░░░░░░░░░░░░ 20.7%
JavaScript 1 hr 7 mins ███▍░░░░░░░░░░░░░░░░░ 16.4%
Text 16 mins ▊░░░░░░░░░░░░░░░░░░░░ 4.1%
@vlazic
vlazic / add-sftp-user.sh
Created February 21, 2020 22:35
This script adds SFTP user and restrict his access to specific directory
#!/bin/bash
# this script adds SFTP user and restrict his access to specific directory
# you can use it to limit SFTP user access to specific web site under /var/www
# tested on Ubuntu 18.04
SSH_CONFIG=/etc/ssh/sshd_config
VSFTPD_CONFIG=/etc/vsftpd.conf
BACKUP_DIR=/var/local/sftp-user/backups/$(date +%F)