Varnish is a web application accelerator. You install it in front of your web application and it will speed it up significantly.
Installation on Ubuntu
Varnish is distributed in the Ubuntu package repositories, but the version there might be out of date, and we generally recommend using the packages provided by varnish-cache.org. Please be advised that we only provide packages for Ubuntu's LTS releases, not all the intermediate releases. Note that the packages might still work fine on newer releases.
To use the varnish-cache.org repository, do the following
curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add -
echo "deb http://repo.varnish-cache.org/ubuntu/ precise varnish-3.0" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install varnish
If you want to install the older 2.1 version, replace varnish-3.0 with varnish-2.1 in the command above.
https://www.varnish-cache.org
How to auto-close the terminal after a certain period of inactivity
I will show you a little trick to close the terminal automatically after
a certain period of inactivity. The trick is very simple, just use any
text editor ( as root) to open the file /etc/profile, in Ubuntu or Linux
Mint Cinnamon, the command will be:
sudo gedit /etc/profile
Once the file is open, just append the following lines to the end of the file:
TMOUT=seconds
export TMOUT
Change the "seconds" in the variable part of TMOUT to any number you prefer, this is the maximum idling time the terminal can last before getting closed. I will use 200 as the example here, just add the lines into the end of the file /etc/profile like this:
Then save the file and close the text editor. After that, run the following command to apply the new change and your terminal will be automatically closed after 200 seconds of inactivity:
source /etc/profile
sudo gedit /etc/profile
Once the file is open, just append the following lines to the end of the file:
TMOUT=seconds
export TMOUT
Change the "seconds" in the variable part of TMOUT to any number you prefer, this is the maximum idling time the terminal can last before getting closed. I will use 200 as the example here, just add the lines into the end of the file /etc/profile like this:
Then save the file and close the text editor. After that, run the following command to apply the new change and your terminal will be automatically closed after 200 seconds of inactivity:
source /etc/profile
Ubuntu Dark Themes Fixs For Mozilla Firefox
Here is a userstyle for Stylish that implements the CSS fix.
Install both of it.
Open Firefox --> Tools ---> Adds-on ---> User Styles ----> High Contrast Inverse Google Fix ----> Edit
Replace content
@-moz-document domain(google.com)
{ input { -moz-appearance: none !important; color: #000000 !important; } }
with this
Install both of it.
Open Firefox --> Tools ---> Adds-on ---> User Styles ----> High Contrast Inverse Google Fix ----> Edit
Replace content
@-moz-document domain(google.com)
{ input { -moz-appearance: none !important; color: #000000 !important; } }
with this
input[type="text"],
input[type="password"],
textarea
{
-moz-appearance: none !important;
background: white;
color: black;
border-radius: 5px;
border: 1px solid #BBB;
background-color: white;
padding: 3px;
color: black;
}
Save.
Enjoy the new look.
source
Make Your PDF File Smaller
Shrinkpdf: shrink PDF files with Ghostscript
The simplest shell script in the world to shrink your PDFs (as in reduce filesize) under Linux with Ghostscript. Inspired by some code I found in an OpenOffice Python script (I think). It feeds an existing PDF through Ghostscript, downsamples the images to 72dpi, and does some other stuff. Pretty straightforward.
shrinkpdf.sh
Download the script by clicking the filename at the top of the box. #!/bin/sh
gs -q -dNOPAUSE -dBATCH -dSAFER \
-sDEVICE=pdfwrite \
-dCompatibilityLevel=1.3 \
-dPDFSETTINGS=/screen \
-dEmbedAllFonts=true \
-dSubsetFonts=true \
-dColorImageDownsampleType=/Bicubic \
-dColorImageResolution=72 \
-dGrayImageDownsampleType=/Bicubic \
-dGrayImageResolution=72 \
-dMonoImageDownsampleType=/Bicubic \
-dMonoImageResolution=72 \
-sOutputFile=out.pdf \
$1
UsageIf it's not downloading just right click and 'save link as', make sure the file are in 'home' folder.
Then run:
sh shrinkpdf.sh yourfile.pdf
This produces a shrunken file named out.pdf
in the current directory.Sorry, Windows users; this one is Linux only. Ghostscript does run under Windows, but I don't know much about Windows scripting. You could try typing all these parameters on the commandline by hand.
You can increase the quality by changing the '72' number in the script to what ever number you want (ex: 120) for better image quality.
Good Luck.
Credit goes to http://www.alfredklomp.com/programming/shrinkpdf/
Faster Boot Time Ubuntu 12.04
1)Remove unwanted Startup Application
(most of info recomend this)
make hidden startup applications visible in the manager
Click Startup Applications...
Uncheck any unwanted application
2)Speed Up Ubuntu Booting Time via Grub
(Source = Ubuntubuzz)
here's to do it, open your grub configuration file (/etc/default/grub) and find this line GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”, do as follows :
Grub does a search for all the necessary drivers to load, Instead of making Grub search for required drivers, the profiling actually makes Grub remember every necessary driver to work, This action will cutting down all of the driver load times.
after your system up, edit /etc/default/grub and remove some option which we have added before.
3)Disabling Hibernation Option
(source=ossdoc)
To disable Hibernation menu type this command:
Before:
4) Disabling Grub Menu
Disabling grub menu will speed up your computer. You have to set grub time out value as 0. Type this command on Your terminal:
Adjust Your Swappiness
open your editor and edit the value. try this command to edit:
That's it. Good luck.
(most of info recomend this)
make hidden startup applications visible in the manager
sudo sed -i ‘s/NoDisplay=true/NoDisplay=false/g’ /etc/xdg/autostart/*.desktop
Click the Start Menu.Click Startup Applications...
Uncheck any unwanted application
2)Speed Up Ubuntu Booting Time via Grub
(Source = Ubuntubuzz)
here's to do it, open your grub configuration file (/etc/default/grub) and find this line GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”, do as follows :
sudo gedit /etc/default/grub
replace GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
with GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash profile”
save and exitsudo update-grub2
sudo reboot
Grub does a search for all the necessary drivers to load, Instead of making Grub search for required drivers, the profiling actually makes Grub remember every necessary driver to work, This action will cutting down all of the driver load times.
after your system up, edit /etc/default/grub and remove some option which we have added before.
sudo gedit /etc/default/grub
replace GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash profile”
withGRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
save and exitsudo update-grub2
3)Disabling Hibernation Option
(source=ossdoc)
To disable Hibernation menu type this command:
sudo gedit /etc/initramfs-tools/conf.d/resume
it will open the editor. Disable hibernation by adding hastag (#) before the line. See this sample:Before:
RESUME=UUID=7c53534d-2a6f-49de-b825-74106a681594
After:#RESUME=UUID=7c53534d-2a6f-49de-b825-74106a681594
Close and save the editor. Hibernation is disabled.4) Disabling Grub Menu
Disabling grub menu will speed up your computer. You have to set grub time out value as 0. Type this command on Your terminal:
sudo gedit /etc/default/grub
when the editor opened, set GRUB_TIMEOUT value as 0. Close and save.
Adjust Your Swappiness
First, chek your swappinnes. The default value is 60. check it using this command:
cat /proc/sys/vm/swappiness
sudo gedit /etc/sysctl.conf
add this line to into the file:
vm.swappiness=10
That's it. Good luck.
Subscribe to:
Posts (Atom)