Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
I may be slow to respond.

Poli IIPoliII

:octocat:
I may be slow to respond.
View GitHub Profile
@IIPoliII
IIPoliII / getYearlyStat.sh
Created Oct 2, 2020
Get yearly used bandwidth Hetzner Robot API
View getYearlyStat.sh
#!/bin/bash
#Created by Poli
user="YourUserHere"
password="YourPasswordHere"
first_date=$(date +"%Y")"-01"
last_date=$(date +"%Y")"-12"
UsedBandwidth=0
@IIPoliII
IIPoliII / getMonthlyStats.sh
Created Oct 2, 2020
Get monthly used bandwidth Hetzner Robot API
View getMonthlyStats.sh
#!/bin/bash
#Created by Poli
user="YourUserHere"
password="YourPasswordHere"
first_date=$(date -d "`date +%Y%m01`" +%Y-%m-%d)
last_date=$(date -d "`date +%Y%m01` +1 month -1 day" +%Y-%m-%d)
UsedBandwidth=0
@IIPoliII
IIPoliII / getDailyStats.sh
Created Sep 15, 2020
Get daily used bandwidth Hetzner Robot API
View getDailyStats.sh
#!/bin/bash
#Created by Poli
user="YourUserHere"
password="YourPasswordHere"
currentDate=`date "+%Y-%m-%d"`
UsedBandwidth=0
ips=`curl -su "${user}:${password}" https://robot-ws.your-server.de/ip.json | jq '.[].ip.ip' | sed -e 's/^"//' -e 's/"$//'`
@IIPoliII
IIPoliII / install_ffmpeg_libfdkaac.sh
Created Apr 22, 2020 — forked from rafaelbiriba/install_ffmpeg_libfdkaac.sh
Install FFmpeg with libfdk_aac support (For Ubuntu)
View install_ffmpeg_libfdkaac.sh
# Criando um script .sh para executar todos os comandos:
#root@servidor:~# vi script.sh
#root@servidor:~# chmod +x script.sh
#root@servidor:~# ./script.sh
apt-get update
apt-get -y install autoconf automake build-essential git-core libass-dev libgpac-dev libsdl1.2-dev libtheora-dev libtool libvdpau-dev libvorbis-dev libx11-dev libxext-dev libxfixes-dev pkg-config texi2html zlib1g-dev libmp3lame-dev nasm gcc yasm && true
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
git clone --depth 1 git://github.com/mstorsjo/fdk-aac.git
@IIPoliII
IIPoliII / virtualhost.conf
Created Feb 5, 2020
Concrete5 fix for path info with apache2 on a nginx reverse proxy using https
View virtualhost.conf
<VirtualHost *:80>
ServerAdmin admin@john.com
DocumentRoot /var/www/john.com
ErrorLog /error.log
CustomLog /access.log combined
ServerName john.com
ServerAlias www.john.com
DirectoryIndex index.php
AcceptPathInfo On
SetEnvIf X-Forwarded-Proto "https" HTTPS=on
@IIPoliII
IIPoliII / GSCompress.sh
Last active Jan 5, 2020
GhostScript PDF compression of a folder and all the subfolders with multithreading (using screen)
View GSCompress.sh
#!/bin/bash
#Variable for choosing the file
FileInput=$1
FileOutput=$2
#GS compression of the pdf
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r300 -sOutputFile="$FileOutput" "$FileInput"
mv "$FileOutput" "$FileInput"