Finding text in files in a folder
Quite often I find myself looking for files which contain the same text. Mainly config settings, etc. On linux you can use this: find ./ -type f -exec grep -l…
A bunch of ramblings about PHP programming, JQuery, MySQL and other 'stuff'
Quite often I find myself looking for files which contain the same text. Mainly config settings, etc. On linux you can use this: find ./ -type f -exec grep -l…
I’ve used openvpn on Mac (using Tunnelblick) for a few years for a home->work VPN connection with no issues, and suddenly today, it would disconnect me every two minutes. This…
If you need to backup your SVN repositories, then you can use this bash script to do so: #!/bin/bash DATE=`date +"%Y-%m-%d"` BACKUP_DIR=/home/user/svn/backup/${DATE} mkdir -p $BACKUP_DIR for dir in `ls /var/svn/`;…
There is a very useful command in Linux, called grep. It is a utility for searching plain text files using regular expressions. You can either search files and folders as…
To run a scan on the port status on a Linux box, you can use the Nmap tool: nmap -sT -O localhost Obviously localhost can be a fully qualified domain…
I use the openvpn command line to connect to a certain VPN site, and I get annoyed at having to find the password everytime So, in the .ovpn file, there…
So you want to have your password remembered by a remote SSH connection? Easy, following these steps On your local machine, create a new SSH key: ssh-keygen It will ask…
I have a particular Linux set up I need to test something on, but I use a Mac, so I use VirtualBox with a Linux VM for the testing. So,…
For a nice VM I needed a Linux server, but no need for a GUI, so went for CentOS. Installed fine, but no networking. How do I install that? Turns…
I found that a script I was running was calling some linux functions using exec() but they weren’t always successful and I couldn’t tell why. exec('command to run'); This would…