Skip to content

Instantly share code, notes, and snippets.

@pierew
pierew / post-receive
Last active August 29, 2015 14:00
That is a Gitolite post-receive Hook Script that can Optional upload the Repository to an FTP Server or copy it to an Directory, more Features are following.
#!/bin/bash
# General Settings
REPONAME='example.git'
BRANCH='public' # Branch you want to be public
MODE='FTP' # 'FTP' = Upload to FTP Server / 'DIRECTORY' = Copy to Directory.
# DIRECTORY MODE SECTION
DIRECTORY='/var/www/'
EXCLUDELIST_DIR='' # Do '--exclude=Folder1 --exlude=Folder2'
@pierew
pierew / blogtk-install.sh
Created May 20, 2014 15:13
blogtk-install.sh
#!/bin/bash
echo "Getting Root Access"
sudo -i
echo "Install Dependencies"
apt-get install python python-gtk2 python-gnome2 python-gtkspell python-gtksourceview2 python-feedparser python-gdata python-webkit -y
echo "Download Tarball"
wget https://launchpad.net/blogtk/2.0/2.0/+download/blogtk-2.0.tar.gz ~/blogtk.tar.gz
tar xvfz ~/blogtk.tar.gz ~/blogtk
cd ~/blogtk
make
@pierew
pierew / ddpvdd.sh
Last active August 29, 2015 14:06
ddpvdd - A DD and PV Integration to use DD with Progress Bar
#!/bin/bash
echo "Input: $1"
size=$(du -k "$1" | cut -f 1)
size=$(($size/1024))
echo "Output: $2"
echo "Size: $size MB"
dd if="$1" | pv --size="$size"M | dd of="$2"
@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:

@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 / 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 / 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 / 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 / .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}')
}
#!/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