in order to run 7zip on the command line with maximum compression use the following command:
7z a -t7z -mx9 (ARCHIVE NAME) (FILE/FOLDER TO COMPRESS)
Life around technology
by sudo
in order to run 7zip on the command line with maximum compression use the following command:
7z a -t7z -mx9 (ARCHIVE NAME) (FILE/FOLDER TO COMPRESS)
by sudo
These are my recommended hosting providers of 2014, all of whom offer Linux machines running Ubuntu or Debian:
Linode offer a wide range of VPS solutions in multiple locations. They have a good community behind them with some great tutorials. Their control panel makes things easy to manage too. There are pay-more additions like load balancers so if you think you’re going to grow your sites quickly or get lots of traffic it’s worth going with them as a more mature hosting provider.
Digital Ocean have been making a big name for themselves in the past year. Their machines are much faster than a traditional VPS as they’re an SSD only hosting provider, so no old spinning disks to slow things down. They have a wide range of tutorials and Q&A sections on their site which are growing rapidly. The web interface is easy to use, but I’m not too keen on the spin-up process yet as they insist on providing you a password via email.
Bytemark offer a cloud platform similar to both Linode and Digital Ocean. They’re a smaller team based in the UK and the platform is still maturing, but Bytemark are always my first port of call for hosting services. They sponsor many open source events and projects, and even offer hosting to the Debian project.
by sudo
Page speed can be a big issue for site owners, developers and systems administrators alike. There are many things you can do at an application level to improve performance, but that takes a long time to review, write, test and implement. What about the quick gains, the things you can do quite easily that will improve performance? Well it turns out that you can speed up an Apache based webserver by simply enabling a module: expires headers.
Expires headers are part of the the computer code that gets exchanged when you access a page. You browser requests a page by sending a request to it, and the server responds with information indicating what it is that has been returned. As part of this response there’s a section called “Expires”. This indicates when the content that has been accessed on the website is going to “expire”. To understand this a bit better, you need to know that when a website’s content is loaded, it’s downloaded to your computer to be rendered in your browser. Once the site is on your screen, if expires headers are not set, each time you load the site it’s going to be downloaded again. This is a performace hit to you, your internet connection and your computer. Expires headers tell the computer to store content temporarily (“Cache” the content) on your computer. When you visit the site again in 5 minutes, if expires headers are set correctly, you’ll only download part of the information on the page.
So what should be cached? Well, here’s what content types I tend to set expires headers on:
How do you do it? You can Speed up websites that operate on Apache using mod_expires. This is really simple to setup and configure if you know how to configure sites on the command line.
Enable the module
a2enmod expires
Edit the configuration file. This can be done in either /etc/apache2/sites-enabled/mysite.conf or /etc/apache2/mods-enabled/expires.conf. The virtualhost configuration file will enable it for a single site, the mods-enabled configuration file will enable it for all sites. Choose one and edit it with a command line text editor like nano. Enter the following:
ExpiresActive on
ExpiresByType image/jpg "access plus 30 days"
ExpiresByType image/png "access plus 30 days"
ExpiresByType image/gif "access plus 30 days"
ExpiresByType image/jpeg "access plus 30 days"
ExpiresByType text/css "access plus 7 days"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType application/pdf "access plus 1 day"
ExpiresByType audio/x-wav "access plus 1 month"
ExpiresByType audio/mpeg "access plus 1 month"
ExpiresByType video/mpeg "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/quicktime "access plus 1 month"
ExpiresByType video/x-ms-wmv "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType text/javascript "access plus 1 week"
ExpiresByType application/x-javascript "access plus 1 week"
ExpiresByType application/javascript "access plus 1 week"
Now restart or reload apache to apply the configuration
service apache2 restart
You can see from the code that the expires time has been set by content type. Each is different, depending on how often it’s expected to change and how big the file types are going to be. For example – a movie file is unlikely to change frequently, but is likely to be large, so if it’s got an expires header telling the browser to store it locally for up to 1 month after the date on which it was first accessed it. This makes the site faster to load. Now when someone loads a site on your server, it will store content after the initial page load and reduce subsequent loading time.
For further information on improving page speed you can check out Yahoo’s excellent article here: https://developer.yahoo.com/performance/rules.html
Why not checkout the Firefox and Chrome plugin “YSlow” which checks a range of potential speed issues and offers solutions:
Google also has some useful tools and guides which can be found here: https://developers.google.com/speed/
Moz also has a brief article on the subject here: http://moz.com/blog/15-tips-to-speed-up-your-website
by sudo
I hold no love for NAS drives, often with very specific software and hardware setups. One just device – a Netgear Nas – died in the office. Instead of pulling the data from the backup, I thought it was worth trying to get the drives working in an old PC to recover the latest data.
This particular model of NAS uses EXT3 LVM as a file system. Great news if you’ve got a Linux live DVD lying around (almost). So Netgear Nas boxes tend to run on non-standard hardware, making the block sizes 16 instead of 4. This means it won’t mount without some extra hacking.
sudo su
apt-get install fuseext2
apt-get install lvm2
modprobe fuse
vgscanvgchange -ay c
mkdir /mnt/nas
fuseext2 -o ro -o sync_read /dev/c/c /mnt/nas
Tra da! you should be able to navigate to the directory and pull the data off. Alternatively you could install linux onto a spare PC and mount this drive, setting it up as a samba share to replace the nasty NAS.
by sudo
This article will cover installing Vagrant on Linux Mint, but what is Vagrant? Vagrant is a useful tool for setting up testing and development virtual machines on Linux. Setting it up on Debian and Ubuntu based distributions like Linux Mint is quite straight forward and the following guide will go over the main steps. For further information, Vagrant itself has some great docs http://docs.vagrantup.com/v2/. It covers installation of Vagrant on various Linux distros as well as more advanced management and configuration, but here’s a quick start:
First, open up a terminal and install virtual box, the kernel sources and vagrant all in one neat step:
sudo apt-get install virtualbox virtualbox-dkms vagrant
Please note that the version in Mint/Ubuntu’s repositories is not the latest one. If you’ve using tools such as PuPHPet you’ll need to grab the latest version of Vagrant from the Vagrant downloads page.
Make a new sub directory in your home folder for your Vagrant machines files to be stored in:
mkdir ~/vagrant
Now lets get create a VM. Pick what machine you want from the Vagrant Boxes (http://www.vagrantbox.es/). I’m going to use Debian 7.3. You need to copy the box URL.
Make sure you’re in your vagrant directory:
cd ~/vagrant
Initialise the vagrant box. This creates a configuration file for it which you can use to change key settings before you start it up
vagrant init debs http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box
Make configuration changes if you want to. I like to set a hostname and have the machine appear on my main network so I can access it from other computers
nano Vagrantfile
These are the additional lines I put in:
# Set the machines hostname
config .vm.hostname = "debs7"
# Setup a network bridge
config.vm.network :public_network
Now you can start the vagrant box. It’ll download the image first time so it might be a little slow to get going.
vagrant up
Once done, you can access it using
vagrant ssh