Skip to content

Instantly share code, notes, and snippets.

View Pandry's full-sized avatar

Pandry Pandry

  • Italy
View GitHub Profile
@Pandry
Pandry / enableSSHOnWindows.ps1
Last active August 27, 2020 11:46
SSH Server on Windows
# Author: github.com/Pandry
# Version: 1.1
# Tested: Windows Server 2012 with Powershell 4
# Lowest system tested: Windows Server 2008 R2 SP1 with Powershell 3
#Your Public Key
$SSHPublicKey = ""
@Pandry
Pandry / PHPTester
Last active March 20, 2020 22:30
A script to paste to execute a php webapp quickly (used to play CTF atm)
cat << EOF > docker-compose.yml
version: '3'
services:
php:
build:
context: ./php
# ports:
# - 9000:9000
@Pandry
Pandry / script.js
Created December 29, 2019 11:23
A script to put on top of casper theme to have .g.svg ending images to be the background of a post
//Taken from https://stackoverflow.com/a/41042412
function colourIsLight(pixel) {
// Counting the perceptive luminance
// human eye favors green color...
pixel[3] = pixel[3]==undefined?255:pixel[3];
var a = 1 - (0.299 * pixel[0] + 0.587 * pixel[1] + 0.114 * pixel[2]) / pixel[3];
return (a < 0.5);
}
function getPropBgImage(e){
@Pandry
Pandry / bashSpinner.sh
Created December 10, 2019 16:58
A simple script to show a spinner during long tasks in bash
#!/bin/bash
###
# Author: github.com/Pandry
# Version: v1.0
# Description: A simple function to create a spinner while executing a long command
# You can easily add your spinner by putting every "frame" into the spinarr array :)
###
spinner()
@Pandry
Pandry / InfluxDB-datapoint-counter.sh
Last active December 4, 2019 15:41
A script to count all the point in a InfluxDB database
#!/bin/bash
##
# Author: github.com/Pandry
# Version: v1.0
##
INFLUXURL="http://127.0.0.1:8086"
#name of the database
DBNAME="telegraf-test"
#host is the tag present on every telegraf measurement
@Pandry
Pandry / containerd-ovirt-ga-pipeline.yml
Created March 29, 2019 16:46
A Concourse CI pipeline to build the pipeline
resources:
- name: atomic-containers-repo
type: git
source:
uri: https://github.com/projectatomic/atomic-system-containers.git
branch: master
- name: dockerhub-ovirt-ga
type: docker-image
source:
@Pandry
Pandry / certbot autorenewal script
Last active January 14, 2021 09:22
Automatic certbot autorenewal via systemd's timer
cat<<EOF>/etc/systemd/system/certbot-renew.service
[Unit]
Description=Renew Let's Encrypt certificates service
[Service]
Type=oneshot
ExecStart=/usr/bin/certbot renew --post-hook "/usr/bin/systemctl reload nginx" --quiet
#ExecStart=/usr/bin/certbot renew --standalone --pre-hook "/usr/bin/systemctl stop nginx" --post-hook "/usr/bin/systemctl start nginx" --quiet
EOF
@Pandry
Pandry / Firewalld GeoIP firewall script
Last active November 15, 2023 21:38
Block countries IPs via Firewalld
#!/bin/bash
##
# Name: GeoIP Firewall script
# Author: Pandry
# Version: 0.1.1
# Description: This is a simple script that will set up a GeoIP firewall blocking all the zones excecpt the specified ones
# it is possible to add the whitelisted zones @ line 47
# Additional notes: Usage of [iprange](https://github.com/firehol/iprange) is suggested
# for best performances
#!/bin/bash
##
## fast-run: curl -o install-cloudinit.sh https://gist.githubusercontent.com/Pandry/a24b1b681ea5524157799cb013c1b387/raw/7895d24277abce440fcfd010d7380067b255728e/installCloudinit.sh && chmod +x install-cloudinit.sh && ./install-cloudinit.sh
##
## Author: Pandry (github.com/Pandry)
## Date: 23/10/2018
## Script: CloudInit installer for RHosting.it
## Version: 0.1
##

Keybase proof

I hereby claim:

  • I am pandry on github.
  • I am pandry (https://keybase.io/pandry) on keybase.
  • I have a public key ASAfM4lvh7VvrqjiqUo41Z1kl9nulUMrmSlOYsqtE6cE3go

To claim this, I am signing this object: