Quantcast
Channel: S.G. Vulcan » Bash scripting
Browsing latest articles
Browse All 12 View Live

Add a logging function to your bash script

I write a lot of scripts that do various jobs and most of the time I’d like to have some log of what happened. So for most of them I add a function that helps logging. View Code BASH1 2 3 4 5 6 7 8 9...

View Article


Open a magnet link on a remote (or local) transmission server.

One of the services I run on my home server is a transmission daemon. I use it mainly to download images for my Raspberry PI, new distro iso’s to play with in Virtualbox and so on. Recently there’s...

View Article


Remove duplicates from the current folder

I needed today to remove duplicate files from a big folder (8Gb+, 10000+ files). I use the nice fdupes program written by Adrian Lopez fdupes -rdN . Note the point after the parameters. That means to...

View Article

Image may be NSFW.
Clik here to view.

Email a list of updates from a Debian server.

Do you run remote servers? Me too. It’s a good ideea to keep them up to date. On the other hand I don’t like automatic updates, something might break when you least want or expect it. So I prefer to be...

View Article

Handy onliner: what packages use the most diskspace on Slackware

I was configuring a small openvpn system (on a VIA epia based system with a 2Gb CF card as disk) and I wanted to free some space since the install left very little free. Change head -nxx to show as...

View Article


Useful oneliner: check the memory usage of apache / httpd processes

This is a handy one liner that reports the usage of the apache processes (apache2 on debian/ubunto or httpd in slackware, centos, etc) 1ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory...

View Article

Simple script to add multiple trackers to a torrent downloading in transmission

Sometime you might want to download some old or obscure distro that was once packaged as a torrent. But many times the tracker embeded in the torrent file has long been abandoned or it has no peers....

View Article

mysqldump: Got error 28 from storage engine

This is a new one for me. I was dumping some databases on a server when I got this: View Code BASH1 2 mysqldump: Error: 'Got error 28 from storage engine' when trying to dump tablespaces mysqldump:...

View Article


Apache IP based restrictions based on a text list. No restart required.

I run a few services on a remote host that I want to restrict access to. For that I use both a password and IP based restrictions. The issue is that for example at home I have a dynamic allocated IP....

View Article


Count traffic from an apache log file

I had to count traffic made by a resource from the apache log files. If awstats had been installed it would have been an easy job, but it wasn’t hard without it either. I used hints from here to build...

View Article
Browsing latest articles
Browse All 12 View Live