Sep 3

by cyberciti.biz, post by Vivek Git
———————————

#!/bin/bash
# Shell script to backup MySql database
# To backup Nysql databases file to /backup dir and later pick up by your
# script. You can skip few databases from backup too.
# For more info please see (Installation info):
# http://www.cyberciti.biz/nixcraft/vivek/blogger/2005/01/mysql-backup-script.html
# Last updated: Aug - 2005
# --------------------------------------------------------------------
# This is a free shell script under GNU GPL version 2.0 or above
# Copyright (C) 2004, 2005 nixCraft project
# Feedback/comment/suggestions : http://cyberciti.biz/fb/
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------

MyUSER="SET-MYSQL-USER-NAME"     # USERNAME
MyPASS="SET-PASSWORD"       # PASSWORD
MyHOST="localhost"          # Hostname

# Linux bin paths, change this if it can not be autodetected via which command
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
CHOWN="$(which chown)"
CHMOD="$(which chmod)"
GZIP="$(which gzip)"

# Backup Dest directory, change this if you have someother location
DEST="/backup"

# Main directory where backup will be stored
MBD="$DEST/mysql"

# Get hostname
HOST="$(hostname)"

# Get data in dd-mm-yyyy format
NOW="$(date +"%d-%m-%Y")"

# File to store current backup file
FILE=""
# Store list of databases
DBS=""

# DO NOT BACKUP these databases
IGGY="test"

[ ! -d $MBD ] && mkdir -p $MBD || :

# Only root can access it!
$CHOWN 0.0 -R $DEST
$CHMOD 0600 $DEST

# Get all database list first
DBS="$($MYSQL -u $MyUSER -h $MyHOST -p$MyPASS -Bse 'show databases')"

for db in $DBS
do
    skipdb=-1
    if [ "$IGGY" != "" ];
    then
	for i in $IGGY
	do
	    [ "$db" == "$i" ] && skipdb=1 || :
	done
    fi

    if [ "$skipdb" == "-1" ] ; then
	FILE="$MBD/$db.$HOST.$NOW.gz"
	# do all inone job in pipe,
	# connect to mysql using mysqldump for select mysql database
	# and pipe it out to gz file in backup dir :)
        $MYSQLDUMP -u $MyUSER -h $MyHOST -p$MyPASS $db | $GZIP -9 > $FILE
    fi
done

Cronjob:

crontab -e
@daily /path/to/yourmysql.sh
Aug 30

Add in httpd.conf (of the Virtual Host!)

#Rewrite to port 443 (https) added by WJ
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
#END

http://www.cyberciti.biz/tips/howto-apache-force-https-secure-connections.html

Aug 30
Stupid htaccess Tricks
icon1 weberj | icon2 apache | icon4 08 30th, 2010| icon3No Comments »

Ein kleine Sammlung von Tricks im Zusammenhang mit Apache

http://perishablepress.com

Jul 22

Hab ich mal im Netz entdeckt .. noch praktisch um Applikationen im Autostart zu verzögern..

@echo off
REM sleep.vbs wird im Batch-File generiert, ausgeführt und am Ende wieder gelöscht
set sleep=%temp%\sleep.vbs

echo Option Explicit > %sleep%
echo dim WshShell, timer >> %sleep%
echo Set WshShell = WScript.CreateObject^("WScript.Shell"^) >> %sleep%
echo if Wscript.Arguments.Count ^> 0 then >> %sleep%
echo   timer = ^( WScript.Arguments^(0^) * 1000 ^) - 200 >> %sleep%
echo else >> %sleep%
echo   timer = 800 >> %sleep%
echo end if >> %sleep%
echo wscript.sleep timer >> %sleep%

%sleep% %1

if exist %sleep% del %sleep%
Jul 13
Directory Listing Script
icon1 weberj | icon2 PHP | icon4 07 13th, 2010| icon3No Comments »

Oft möchte man Dateien, z.B. Protokolle auf einer Website bereitstellen, doch es braucht immer viel Zeit wenn man das auf einfachste Weise tut. Um diese Zeit einzusparen und die Files einfach aufzulisten gibt sog. Directory Listing Scripts. Eines das mir sehr gefällt : http://www.evoluted.net/community/code/directorylisting.php

Jun 30

http://www.windowsecurity.com/articles/PowerShell-Security.html

Jun 29

Zufällig bei Administrator.de gefunden: Noch gut zum merken ;-)

Authentifizierte Benutzer mit anderen Worten:

Du bist Besucher in einer großen Firma, am Empfang musst du deine Personalien angeben und bekommst danach eine Besucherkarte ausgehändigt. Damit bist du authentifziert.

Autorisierung mit anderen Worten:
Welche Räumlichkeiten du nun in dieser Firma betreten kannst hat der Besitzer der jeweiligen Räumlichkeiten in dieser Firma zu entscheiden. Es wird vor jeder Räumlichkeit überprüft, ob du autorisiert bist, diese zu betreten.

Allerdings musst du dich als Besucher nicht wieder neu authentifzieren, weil jeder in dieser Firma weiß, dass du ein Besucher bist.

In der Praxis:
Dein Client weißt zwar mit Hilfe der “SID” seine Identität nach, dennoch ist unklar, welcher Benutzer vor diesem Client sitzt.
Deswegen muss sich dieser mit Hilfe von “Benutzername” und “Passwort” authentifizieren.

Jetzt merkst du vielleicht, dass es nötig ist, dass sich Benutzer “authentifizieren” und Clients jediglich ihre Indentität nachweißen müssen.
Deshalb heißt es auch “Authentifzierte Benutzer” !

Jun 25

Hier findet sich eine Liste mit den gängigsten Failure Codes welche im SCCM Umfeld auftreten können:
http://technet.microsoft.com/en-us/library/bb632794.aspx

Hier eine Übersicht über die wichtigsten Logfiles im SCCM:
http://technet.microsoft.com/en-us/library/bb892800.aspx

Andere Error Codes abrufen mit:
net helpmsg [errorcode]

May 18
Phusion Passenger
icon1 weberj | icon2 Uncategorized | icon4 05 18th, 2010| icon3No Comments »

Um eine Rails App fürs Web zu nutzen braucht man bekanntlich Phusion Passenger (auch mod_rails genannt) oder Mongrel. Ich benutze Passenger, da mir dies einfacher erscheint.

Developer site:

http://modrails.com

a good tutorial:

http://benr75.com/2008/04/12/setup-mod_rails-phusion-mac-os-x-leopard

If you have mysql gem problems?!:

http://www.techskater.com/ruby-on-rails/problems-with-mysql-gem-and-rake-on-snow-leopard/

Achtung das Mysql gem braucht auf dem OSX Server noch eine zusätzliche Lib da die Client headers nicht mitgeliefert werden! (bei Apple Downloaden)

May 18
Thinking Sphinx
icon1 weberj | icon2 Uncategorized | icon4 05 18th, 2010| icon3No Comments »

Developer site:

http://freelancing-god.github.com/ts/en/indexing.html

Just a good blog:

http://rhnh.net/sphinx

« Previous Entries