Category: Unix

  • map server shares over sshfs

    map server shares over sshfs

    Installation on Debian apt-get install sshfs mkdir /media/xxx ssh-keygen ssh-copy-id -i ~/.ssh/id_rsa.pub username@xxx.com vi /etc/rc.local (this file will execute after network is enabled) sshfs -o allow_other xxx@xxx:/var/www/ /media/xxx sshfs -o allow_other xxx@xxx:/var/www/ /media/xxx1

  • Backup Linux Server

    First you must boot a System-Rescue-Disk -> LINK fdisk -l mkdir /mnt/sda1 mount /dev/sda1 /mnt/sda1/ cd /mnt/sda1 tar -cvpf backups/fullbackup.tardirectory=/exclude=procexclude=sysexclude=dev/ptsexclude=backups .  

  • Create a Public Key Infrastructure Using the easy-rsa Scripts

    The first step when setting up OpenVPN is to create a Public Key Infrastructure (PKI). The PKI consists of: A public master Certificate Authority (THAT) certificate and a private key. A separate public certificate and private key pair (hereafter referred to as a certificate) for each server and each client. To facilitate the certificate creation

  • login over ssh key

    login over ssh key

    Debian ssh-keygen ssh-copy-id -i ~/.ssh/id_rsa.pub username@servername OSX ssh-keygen ssh-add ~/.ssh/id_rsa cat ~/.ssh/id_rsa.pub | ssh servername -l username ‘mkdir .ssh ; cat >>.ssh/authorized_keysbackup RSA key over rsync rsync -avzdeletesparse ~/.ssh/id_rsa.pub /target/target

  • sql cluster generator

    sql cluster generator

    here you can find a very good one with script for sql cluster generation http://www.severalnines.com/

  • Configure sendmail as a smart host

    Smart host is very handy if you are on dial up network or sometimes a host finds mail that it is unable to deliver directly to the desired remote host. In large network, it is good idea to have a single host/mail server acting as MTA. Smart hosts are usually used when all other methods

  • Shell backup script – Windows SMB / Linux Server

    Shell backup script – Windows SMB / Linux Server

    prepare copy all files in one folder modify backup-start.sh with your path and configs make a btrfs partition create a subvolume for the backup path create a cronjob start backup-start.sh daily backup-start.sh weekly backup modes smb sshs sshnosymlink sshsudoftp backup-start.sh #!/bin/bash # check the backup script if its running and if yes then calc for a snapshot

  • sysprep for mac osx

    The IT industry is changing. Where many of us historically dealt almost exclusively with Windows-centric environments, we are now seeing environments with more and more Mac’s. Which means as system admins we now need to look at ways to streamline Mac imaging like we do with Windows. Although Mac’s are not nearly as finicky when

  • Copy files over ssh and rsync

    to copy files over ssh and rsync, makes life much easier. Man muss nicht keine verzeichnisse mappen Man muss nicht meher alle Dateien kopieren, sondern nur ein diff deswegen habe ich eine Codeline geschrieben, in welcher ein solver kopiervorgang beschrieben ist rsync -chavzPstats username@remote-server:/path/to/the/folder/ /local/path/

  • check files bigger then 2GB

    Hear i have an intresting codeline to find all files bigger then 2 GB for linux find /var/ -type f -size +20000k -exec ls -lh {} ; 2> /dev/null | awk ‘{ print $NF “: ” $5 }’ | sort -nrk 2,2   du -a /var | sort -n -r | head -n 10  …