Tips and Tricks

Rails console crash on Model.connection

bin/spring stop



Add "Open in SublimeText" to Nautilus Folders (Ubuntu 14.04 LTS)


This is a quick method to add a Nautilus Action to open Folders with SublimeText:
  1. Install SublimeText and find the command to open it by terminal (here is $/usr/bin/subl )
  2. Install Nautilus Actions: $sudo apt-get install nautilus-actions
  3. Open Nautilus Actions: $sudo nautilus-actions-config-tool
  4. In Nautilus Actions, create a New Action (File>>New Action or CTRL+N)
  5. ..At "Action" tab, set Context Label to "Open in SublimeText"
  6. ..Check "Display Item in selection context menu" and "Display Item in location context menu"
  7. ..At "Command" tab set Label to default
  8. ..Set path to /usr/bin/subl (or your Sublime executable path)
  9. ..Set parameters to %b
  10. ..Set Working Directory to %d
  11. ..Save and quit Nautilus Actions
  12. In the terminal type $sudo killall nautilus
  13. Now you'll be able to open folders direct to SublimeText

Extra tip: avoid Sublime Text to re-open last files/folders
  1. In Sublime Text go to Preferences >> Seetings - User
  2. Add the following param to the file: "hot_exit": false, e.g:
    {
"font_size": 9,
"hot_exit": false,
    }   



Adjust Screen Brightness for Ubuntu (14.04) Startup

$ sudo gedit /etc/default/grub

replace:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
with:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor"

$ sudo update-grub
$ sudo reboot


Configuring Kile and Latex under Kubuntu 12.04 (Msc.)

sudo apt-get install kile
sudo apt-get install texlive-latex-extra


How to save an entire website with Wget - Linux


Update 2016: wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://ionicframework.com/docs


This is a very useful resource i found in http://www.linuxjournal.com/.

----------------------------------

If you ever need to download an entire Web site, perhaps for off-line viewing, wget can do the
job—for example:

--no-clobber: don't overwrite any existing files (used in case the download is interrupted and
resumed).


$ wget \
     --recursive \
     --no-clobber \
     --page-requisites \
     --html-extension \
     --convert-links \
     --restrict-file-names=windows \
     --domains andresjesse.com \
     --no-parent \
         http://www.andresjesse.com/graduation/

This command downloads the Web site andresjesse.com/graduation

The options are:

  • --recursive: download the entire Web site.

  • --domains website.org: don't follow links outside website.org.

  • --no-parent: don't follow links outside the directory graduation/.

  • --page-requisites: get all the elements that compose the page (images, CSS and so on).

  • --html-extension: save files with the .html extension.

  • --convert-links: convert links so that they work locally, off-line.

  • --restrict-file-names=windows: modify filenames so that they will work in Windows as well.


Reference: 
http://www.linuxjournal.com/content/downloading-entire-web-site-wget
Comments