dimitris kalamaras

math, social network analysis, web dev, free software…

Tag: Bash

Bash scripting

A simple Bash script to clamdscan your /var/www files

Here’s a very simple Bash script that scans for viruses in files inside all folders in /var/www. I use it primarily to scan uploaded files on websites hosted there.

Read More

An apache monitoring script

One of the daily routines administrators do is to monitor their web server logs for various interesting things: response codes (i.e. 500), attempts to access restricted pages, user-agents, ips, popular pages, even image hotlinking from other sites. In Linux servers, this can be easily done through shell one-liners involving various tools (tail, awk, sort, cut etc). Here is a bash script I use which automates apache monitoring for a given website.

Read More

top: Πόση μνήμη καταναλώνει κάθε process στο Linux

Θέλετε να δείτε που καταναλώνεται η μνήμη RAM του υπολογιστή σας και ποια διεργασία ή εφαρμογή σας τρώει συστηματικά τους πόρους; Υπάρχουν διάφορες λύσεις είτε από το γραφικό περιβάλλον είτε από τη γραμμή εντολών (bash) αλλά δεν συγκρίνονται μπροστά στο πανταχού παρών top.

Το table oprocesses είναι πολύ περισσότερα από ένας απλός πίνακας των προγραμμάτων που τρέχουμε. Ανανεώνεται συνεχώς και μας δείχνει uptime, κατανάλωση μνήμης, cpu load, αριθμό διεργασιών, κατανάλωση swap και αναλυτική περιγραφή κάθε διεργασίας που τρέχουμε (μνήμη, %cpu, share, niceness, user, pid, πόση ώρα τρέχει και ποια εντολή είναι!). Και όλα αυτά sortable. Για παράδειγμα για να σορτάρετε τις διεργασίες που σας δείχνει ώστε να εμφανίζονται ανάλογα με την κατανάλωση μνήμης πατάτε το πλήκτρο Μ.

To top εν δράσει!

Read More

melux: a custom ubuntu iso creation script!

When I was working for the Greek Linux Format, I was making special editions of Ubuntu for the magazine’s DVD. Those were the same distro of course, but with a lot more packages preinstalled. For that purpose, I had written all the useful info and relevant commands inside a text file. Of course, that wasn’t highly efficient, since I had to manually run through (read: copy/paste) all the commands again and again for every new custom Ubuntu image. So, I was always thinking that I should assemble and automate all those commands in a nice Bash script, but I never really tried it. This week, I finally decided to build that script and share it with everyone. So, I hereby give you Melux 1.0 (see full code below).

Read More

Powered by WordPress & Theme by Anders Norén