Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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
#!/bin/bash
if [ -z "$1" ]; then
echo "No Domain specified"
echo "Usage: uber-add-domain <domain.tld>"
else
uberspace-add-domain -w -d $1
echo "CREATE Webserver Folder @ /var/www/virtual/$USER/$1"
mkdir /var/www/virtual/$USER/$1
echo "[OK]"
fi
@pierew
pierew / .bash_aliases
Last active August 29, 2015 14:19
vzenter - A little Script to enter a openVZ CT by use Hostname
# As Bash Alias
function vzenter() {
vzctl enter $(vzlist | egrep "$1" | awk '{print $1}')
}
@pierew
pierew / iarchwiki
Created April 22, 2015 12:04
iarchwiki - Please install to /usr/local/bin/
#!/bin/bash
function dependencies() {
echo "Check for dependencies"
echo "Check: w3m"
if [[ "" =~ "$(which w3m)" ]]; then
echo "w3m [Install]"
sudo pacman -Sy --noconfirm w3m
fi
echo "w3m [OK]"
echo "Check: arch-wiki-lite"
@pierew
pierew / fedoraBootToCockpit.sh
Last active August 29, 2015 14:17
A Script to Install Minimal X server and open Cockpit on Boot
echo "Install Minimal X Environment & Midori & PWGen"
yum groups install -y base-x
yum install -y unclutter openbox lightdm midori xterm
clear
echo "Configure RC.Local"
touch /etc/rc.d/rc.local
echo '#!/bin/bash' >> /etc/rc.d/rc.local
echo 'lightdm' >> /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
echo "Configure LightDM"
@pierew
pierew / avahi-discovery.sh
Last active May 11, 2024 10:58
A Little script that to the Avahi Discovery and put into /etc/hosts. Because my Avahi don't works well
#!/bin/bash
# Required Stuff
# * sed
# * grep
# * egrep
# * avahi-browse
# * cut
# * sort
# * awk
#
@pierew
pierew / arrayConvertMySQLToPHP.php
Last active August 29, 2015 14:14
PHP Mysql -> PHP Array Converter Function
/*
* You need to set the Parameter $ResultSet to your Direct Result From $db->query("Select ...", MYSQLI_USE_RESULT)
*
*
*/
function arrayConvertMySQLToPHP($ResultSet) {
$phparray = array();
while($row = mysqli_fetch_assoc($ResultSet)){
array_push($phparray, $row);
}
@pierew
pierew / keybase.md
Created January 12, 2015 19:43
keybase.md

Keybase proof

I hereby claim:

  • I am pierew on github.
  • I am pierewoehl (https://keybase.io/pierewoehl) on keybase.
  • I have a public key whose fingerprint is EC1E 3F6F 8DF2 997B A76E F342 4210 2485 ABC5 2826

To claim this, I am signing this object: