To find a text string within files in all sub-directories: find . -type f | xargs -r0 grep -F ‘dodgystring’ or find . -type f -exec grep -l “dodgystring” {} \; To replace a string within files in all sub-directories: find ./ -type f -exec sed -i ‘s#fromstring#tostring#’ {} \; From within vi replacing all… Read more »
Posts By: jonny
VirtualBox: Cloning a VM
My Virtual Machine was named http1 so I cloned the vdi as http2.vdi using the VBoxManage command: VBoxManage clonevdi http1.vdi ../pathtonewlocation/http2.vdi The output was: 0%…10%…20%…30%…40%…50%…60%…70%…80%…90%…100%Clone hard disk created in format ‘VDI’. UUID: 9e65bd30-663e-4bf8-acd2-3120d1f41fec Then create the new Virtual Machine in the VirtualBox GUI: Machine > New On the third step for ‘Virtual Hard Disk’ choose… Read more »
Uptime
Uptime of 1214 days on an internal email scanning server running Red Hat Linux 4.
SNMP with Nagios
I thought I would jot down a few notes about today’s adventures with SNMP. Specifically using SNMP with Nagios mostly on Red Hat/CentOS. I have an appliance from a third-party from which I would like to monitor and graph performance. So view this as a beginner howto for future reference. There is good info here… Read more »
Uptime
1084 days on this internal monitoring machine. Unfortunately I had to take the machine down as I was replacing it.
Linux Find Not Owner
In Linux to find files not owned by user using the ‘find’ command we negate with the exclamation mark so rather than: find . -user jonny we use: find . ! -user jonny Where: find <dir> ! -user <username>
VirtualBox 4.0 on Ubuntu 10.10 Maverick
Add the following to /etc/apt/sources.list deb http://download.virtualbox.org/virtualbox/debian maverick contrib Then run: wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add –sudo apt-get updatesudo apt-get install virtualbox-4.0 After running VirtualBox download the extension pack: wget http://download.virtualbox.org/virtualbox/4.0.0/Oracle_VM_VirtualBox_Extension_Pack-4.0.0-69151.vbox-extpack Visit File > Preferences > ExtensionsClick the icon to add an extension and choose the extension pack you downloaded.
msconfig Startup Programs
This searchable list if programs could come in useful when disabling programs from starting on slow windows machines.
MySQL: Too Many Connections
On a shared server with MySQL and Apache the MySQL server was periodically disallowing connections as there were already too many connections. The default is 150+1 so I added the following to /etc/my.cnf max_connections=200 To increase the maximum number of connections to 200+1
Clamd and Iptables
Running Clam on a separate machine to our Mail Transfer Agent we needed to configure iptables to allow access to clam from those machines. Clamd listens for connections on port 3310 by default but appears to hand off to other ‘passive’ ports for each stream to scan. So allowing access to port 3310 was not… Read more »