Skip to content

Instantly share code, notes, and snippets.

@pierew
pierew / screenLoader.sh
Last active August 29, 2015 14:21
Start Screen at every start of your favourite shell
checkofscreen=$(ps aux | grep /usr/bin/screen | grep -v grep)
if [ -z "$checkofscreen" ]
then
screen
fi
@pierew
pierew / database.php
Last active August 2, 2016 18:20
PHP Toolkit
<?php
/**
* @author Piere Woehl <[email protected]>
*/
$connection
function queryDB($SQL,$FIELD) {
initDB(); // Abstract Function, you have to create yourself
global $connection;
$result = mysqli_fetch_assoc($connection->query($SQL, MYSQLI_USE_RESULT));
@pierew
pierew / arp-to-ip-lookup-powershell.ps1
Created October 21, 2016 17:59 — forked from mikebranstein/arp-to-ip-lookup-powershell.ps1
ARP to IP lookup PowerShell script
# Gets the IP address of a computer via the MAC address. This will only work on LAN
# segments. By default we'll scan the ARP table, but then defer to an IP scan to
# as needed.
#
# Usage: $returnIpAddress = GetIPFromMAC "12-43-de-52-a9-99" "192.168.10."
# Pass in the mac address with dashes (-) as the first parameter
# Pass in an IP address with the last number missing, be sure to include the trailing "."
# Be sure to check the value if $returnIpAddress -eq $null to see if a value was actually returned
#
function GetIPFromMAC {
@pierew
pierew / mirror-raspberrypi-archive.sh
Created October 31, 2016 22:21
How To Mirror archive.raspberrypi.org - Define which folders by changing and Adding Lines, it will add recursive
#!/bin/bash
cd <INSERT FOLDER TO DOWNLOAD TO>
# LOAD GPG KEY
echo "Loading GPG Key..."
wget http://archive.raspberrypi.org/debian/raspberrypi.gpg.key
# LOAD JESSIE
echo "Loading dists/jessie..."
wget -nv --progress=bar -N -m --no-parent --cut-dirs=1 --reject "*.html*" http://archive.raspberrypi.org/debian/dists/jessie/
@pierew
pierew / smb.conf
Created January 23, 2017 20:02 — forked from skarllot/smb.conf
Linux Samba access-based enumeration
. . .
[Share]
. . .
hide unreadable = yes
hide unwriteable files = yes
. . .
@pierew
pierew / Generate-PanDoc.ps1
Created August 20, 2017 20:39
Generating PanDoc HTML Conversion in actual Directory
If (Test-Path "$(Get-Location)\pandoc_html") {
Remove-Item -Recurse "$(Get-Location)\pandoc_html" -Force
}
New-Item -Path "$(Get-Location)\pandoc_html" -ItemType directory
Get-ChildItem "$(Get-Location)\*.md" | ForEach-Object {
pandoc $_ -f markdown -t html -s -o "$(Get-Location)\pandoc_html\$($_.BaseName).html" | Out-Null
}
@pierew
pierew / dockerconnect
Last active October 17, 2018 19:20
Docker in Docker Isolation for cheap
if [[ $(docker inspect -f {{.State.Running}} $USER 2>/dev/null) ]]; then
docker exec -it $USER /bin/sh
else
echo "Initializing your Docker Environment..."
docker run --name $USER --privileged -d docker:dind
sleep 1
docker exec -it $USER /bin/sh
fi
@pierew
pierew / sentry-cron.service
Last active November 1, 2018 21:24
Sentry Active-Passive HA on Linux CentOS 7
[Unit]
Description=Sentry Cron Container
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a sentry-cron
ExecStop=/usr/bin/docker stop sentry-cron
[Install]
@pierew
pierew / pvenode-rename
Created February 18, 2019 19:07
Changing a Proxmox VE Nodes name when it is not in a cluster
OLDNAME=$(hostname)
hostnamectl set-hostname ${1}
mkdir -p /etc/pve/nodes/${1}
cp -a /etc/pve/nodes/${OLDNAME} /etc/pve/nodes/${1}
echo 'A reboot is required, Exit with CTRL-C'
read
@pierew
pierew / haproxy.conf
Created August 8, 2020 08:20
TCP Mode port-forwarding
frontend private-tcp
bind 10.147.17.42:80
mode tcp
default_backend private-pfsense
frontend private-tcp-ssl
bind 10.147.17.42:443
mode tcp
default_backend private-pfsense-ssl