Ecommerce, SEO, Gadgets, Mac und Internet Themen

Eine Datei unter Linux finden

Kategorie: Linux (Ubuntu)

Syntax:
find {dir-name} -name {file-name}

Beispiel:

find / -name foo.txt

List Files Newer Than 10 Days

Kategorie: Linux (Ubuntu)

How to List Files Newer Than 10 Days using ls:

find . -mtime -10

aliases in der .bashrc

Kategorie: Linux (Ubuntu)

Alias für ein besseres ls.

alias ls='ls -lsah'

-l use a long listing format

-s print size of each file

-a do not ignore entries starting with .

-h print sizes in human readable format (e.g., 1K 234M 2G)

Neustarten der .bashrc

. ~/.bashrc

aktive TCP Verbindungen anzeigen

Kategorie: Linux (Ubuntu)

Um eine Liste aktiver TCP-Verbindungen –bspw. auf dem Server — angezeigt zu bekommen, lässt sich netstat prima verwenden:

netstat -a | grep ESTABLISHED

Suchen mit Linux

Kategorie: Linux (Ubuntu)

Suchen mit Linux ist eigentlich ganz einfach! Am häufigsten wird man wohl grep gebrauchen. grep durchsucht bspw. Dateien nach einem angegebenem String.

grep 'Linux' *

sucht dabei in allen Dateien des Verzeichnisses nach dem String ‘Linux’

mehr dazu in dieser ausführlichen Anleitung zur Suche unter Linux

Mehrere Domains auf einer IP hosten (bspw. auf einem Hetzner Root Server)

Kategorie: Internet, Linux (Ubuntu)

Wer z.B. bei Hetzner einen Rootserver hat, der hat auch gleich mehrere IPs. Wem diese dennoch nicht ausreichen, oder wenn ein anderer Rootserver mit nur einer IP für Dich ackert, Du aber mehrere Domains darauf hosten möchtest, dann kannst Du Virtuelle Server in Betracht ziehen.

Virtuelle Server

Mit Apache2 lassen sich ziemlich einfach Virtuelle Server aufsetzen. Dazu bedarf es nicht einer virtuellen Maschine oder ähnlichem. Die komplette Verwaltung übernimmt ausschließlich der Apache.

Hierzu muss als aller erstes Apache mitgeteilt werden, welche IP ein virtueller Host sein soll. Das geschieht in der /etc/apache2/ports.conf. Syntax: NameVirtualHost IP:Port

NameVirtualHost 88.xxx.153.10:80
Listen 80

Die eingetragene IP ist jetzt also ein virtueller Host und lauscht auf verschiedene DNS Aufrufe.

Zudem muss in der /etc/apache2/sites-available/default die Vhost Beschreibung für diese IP hinterlegt werden. In dem folgendem Beispiel laufen (www.)domain1.com und (www.)domain2.com auf der gleichen IP. Je nach DNS wird dann entweder der ein oder der andere DocumentRoot aufgerufen:

<VirtualHost 88.xxx.153.10:80>
        ServerAdmin dite@domain1.com
        ServerName www.domain1.com
        DocumentRoot /var/www/domain1.com/
        <Directory />
               ...
        </Directory>
</VirtualHost>
<VirtualHost 88.xxx.153.10:80>
        ServerAdmin dite@domain1.com
        ServerName domain1.com
        DocumentRoot /var/www/domain1.com/
        <Directory />
               ...
        </Directory>
</VirtualHost>
<VirtualHost 88.xxx.153.10:80>
        ServerAdmin dite@domain2.com
        ServerName www.domain2.com
        DocumentRoot /var/www/domain2.com/
        <Directory />
               ...
        </Directory>
</VirtualHost>
<VirtualHost 88.xxx.153.10:80>
        ServerAdmin dite@domain2.com
        ServerName domain2.com
        DocumentRoot /var/www/domain2.com/
        <Directory />
               ...
        </Directory>
</VirtualHost>

List all Users

Kategorie: Linux (Ubuntu)

cat /etc/passwd

Edit: Probleme mit PHP und Apache2

Kategorie: Internet, Linux (Ubuntu)

EDIT: Lösung des Problems

Warum auch immer war meine php5.conf komplett falsch!
Sie müsste nämlich wie folgt aussehen:

<ifmodule mod_php5.c>
    <filesmatch "\.ph(p3?|tml)$">
        SetHandler application/x-httpd-php
    </filesmatch>
    <filesmatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </filesmatch>
</ifmodule> 

Vielen Dank an BlackFate vom irc.debian.org !

Weiterlesen: Edit: Probleme mit PHP und Apache2 »

what you should have done if you are a MyBook-World owner

Kategorie: Internet, Linux (Ubuntu)

The WD MyBook World Edition Drives are smart and cheap, but strongly slow an noisy!! BUT you are able to change it!

The speed of the filetransfer is just low as about 4MB/s, no matter if 100Mbit or 1GBit conected. If you’ll have a look at the cpu usage, you’ll know why. Further the mybook has all RAM in use, so it has to swap all the time. This causes high CPU temp and noisy fan running and not spinning down the hdds.

so what to do?

  • Install Patch for activating SSH. The whole process doesn’t require hard drive disassembly. It does not even require physical access to the drive. It works fine on every WD MyBook WE models (both I and II, capacities from 320GB to 2TB).
  • Reducing disk usage by turning unnecessary stuff off. There are many running services in your MBWE that access the disks, thus making it spin up when it really shouldn’t. I addition, they are using memory, which the MBWE doesn’t have to spare. Here we’ll turn some of them off.
  • Install NFS Server for getting more speed for filetransfer. Get the files, unzip them to /sbin (portmap) and /usr/sbin (all the other) and follow this instructions
  • for unzip i.E. you need to install optware

thanks to Tim!


wpSEO optimiert Blogs für Suchmaschinen - automatisch und effizient.
Viktor Dite Mizine on Twitter