Filter By Category - Linux


Here's some of my tips, tweaks and tuts, ranging from PHP, Linux, MySQL and more!

Snippets / Linux

Fix: Firewall is stopped (iptables) in linux

I came across this quick fix when trying to restart the firewall for my linux box. $ service iptables status Firewall is stopped. Trying to start it? The obvious solution was to just do service iptables start but this didnt do anything. Solution We just need to save the firewall rules before we start the service. ...

25th Apr, 2012 | » Read more Snippets like this | » Read More

Snippets / Linux

Copy files from one linux machine to another

It's fairly easy to transfer files from one Linux server to another using the scp command. An example scp -pv user@123.456.78:source-file.tar /home/user/source-file.tar Options -p Preserves the modification and access times, as well as the permissions of the source-file in the destination-file -q Do not display th...

4th Oct, 2011 | » Read more Snippets like this | » Read More

Snippets / Linux

Colour highlighting - grep search results

I always find it difficult scanning through hundreds of lines of search results trying to match the keyword you specified. By default linux doesn't colour code grep search results, but there's an option to change this. By saving some settings inside your .bash_profile (file that get's called upon your login, usually resides within /...

25th Sep, 2011 | » Read more Snippets like this | » Read More

Snippets / Linux

Securing Image Upload directories (777)

It is considered risky to leave directories in your website with the access permission 777, which allows anybody to upload files to this folder. However many PHP projects such as Wordpress require these folder permissions in order to function correctly. I find it helpful to create a .htaccess file to go inside the image upload director...

25th Sep, 2011 | » Read more Snippets like this | » Read More

Snippets / Linux

Send Email from Linux Command Line

Sending emails from the linux command line can be very useful when creating shell scripts to inform people of the completion of a scheduled crontab. Using Linux's "mail" command You can send emails by the following; mail -s "Subject of Message" your@emailaddress.co.uk < /dev/null This simplys sends a blank message to th...

24th Sep, 2011 | » Read more Snippets like this | » Read More

Snippets / Linux

Turn on syntax highlighting VIM

If you want to turn on syntax highlighting for vim editor on Ubuntu such edit the main config file here# open vim settings vim /etc/vim/vimrcThen uncomment " syntax on " around line 20# leave setting syntax onIf you just wanted to turn it on just while you were editing a file (not a permanent solution):syntax on The...

15th Jul, 2011 | » Read more Snippets like this | » Read More

Snippets / Linux

Remember Alias binds - Linux

Binding Aliases in linux is a very useful way shorten your workload and the amount you type!In order to save your alias binds you need to save them in the .profile file which should be in the login root directory.An Example# open file to edit vim .profile # add alias bind alias zf=/path/to/shell/script.sh Remember to save the file a...

15th Jul, 2011 | » Read more Snippets like this | » Read More