Skip to content

Instantly share code, notes, and snippets.

View gdetor's full-sized avatar

Georgios Is. Detorakis gdetor

View GitHub Profile
@gdetor
gdetor / shorenurl.sh
Created February 7, 2023 00:03
A script for shortening a long URL (bash-tested)
#!/usr/bin/bash
echo -n "Original URL: "
read url
short_url=$(curl -s http://tinyurl.com/api-create.php?url=${url})
echo "Short URL: ${short_url}"
@gdetor
gdetor / split_pdf.sh
Created February 7, 2023 00:02
Simple bash script for splitting a pdf file into multiple pages
#!/bin/bash
# This script exctracts a specific number of pages from a pdf file.
#
# Arguments: $1 -> Input file
# $2 -> Outout file
# $3 -> First page (to cut)
# $4 -> Last page
#
# Example: pdf_split input.pdf output.pdf 1 5
#
@gdetor
gdetor / cropping.sh
Last active February 7, 2023 00:02
A simple script for cropping pdf files within a directory (bash-tested)
#!/bin/bash
file=`which parallel`
echo $file
for file in *.pdf;
do
echo "Now cropping file: $file"
pdfcrop $file $file > /dev/null 2>&1
@gdetor
gdetor / vimrc
Created February 6, 2023 23:48
Sample of vimrc file
"
"0 run vim -V9myvimlog - creates a vim runtime log file at debug level 9
" Pathogen calls
"
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()