Ubuntu: Fix "An error occurred while installing pg"
If you get an error like this:
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure thatgem install pg -v '0.17.1'
succeeds before bundling.
Then do this:
sudo apt-get install libpq-dev
... and run Bundler again.
When Nautilus/Thunar file manager sorts case-sensitively
When your file manager sorts file case-sensitively after a distribution upgrade, you probably need to reconfigure your locale settings as described here.
Move a Gnome panel to another monitor in Ubuntu
In older Ubuntu releases you could ALT+drag any panel bar to another position and/or monitor. In Ubuntu 11.04 Natty you need to perform the steps from the attached article instead:
- Right-click on the panel to access the panel properties
- Uncheck "Expand"
- Move the panel by dragging the grip areas that now appear on the panel edges
- Check "Expand" again in the panel properties
How to install GNOME classic desktop in ubuntu 12.04
Run
sudo apt-get install gnome-session-fallback
or (alias)
sudo apt-get install gnome-panel
from a terminal.
Then logout to reach the logon screen and click on the options button next to you name.
Select Gnome Classic
, log in et voilà.
Ubuntu MATE: Fixing ALT + TAB being really slow
On my Ubuntu MATE machine, switching applications with ALT + TAB was impossible, because it took nearly 2 seconds. The culprit appears to be an "UX improvement" gone bad: MATE renders a live screenshot of each running application inside the application switcher.
Fixing this is simple:
- Open "Window Preferences"
- Either uncheck "Enable software compositing window manager" or check "Disable thumbnails in Alt-Tab"
Line wrap text from a Ubuntu Linux terminal
You can use fold
:
fold -sw 60
You can now paste your texts. fold
will echo them back, word-wrapped after 60 columns. Exit with Ctrl+C
or Ctrl+D
.
You can also use files for input and output:
fold -sw 60 input.txt > output.txt
How to install the `xelatex` binary on Ubuntu 14.04
Just install the texlive-xetex
package:
sudo apt-get install texlive-xetex
Running integration tests without texlive-xetex
will produce an error during xelatex
execution:
RTeX::Document::ExecutableNotFoundError
Enable or disable Gnome desktop icons
When doing a presentation you may want to hide your desktop icons.
You can switch them off (or back on) like this:
- Open up
gconf-editor
- Navigate to apps -> nautilus -> preferences
- (Un)check "show_desktop"
How to install fonts in Ubuntu
- Put the font files (e.g.
ttf
) into ~/.fonts - Run
fc-cache -v
Or, if you prefer to use the GUI, open each font file and click the "Install" button in the top right of the preview window.
Thinkpad: Disable Bluetooth on start-up
Add the following to /etc/rc.local:
(sleep 3 && echo disable > /proc/acpi/ibm/bluetooth)&
Bluetooth icon will be active for a few seconds, then turn gray.
Dragging a file into your terminal pastes the file path
When you drag a file from a Nautilus window into a terminal window, the file's path will be pasted into the terminal. This also works with multiple files.
Enable debugging for BIND 9 on Ubuntu
Edit /etc/default/bind9
and change
OPTIONS="-u bind"
to
OPTIONS="-u bind -d 50 -g"
Restart BIND and you'll see debug log on your console.
Bash: How to generate a random number within given boundaries
$RANDOM
on bash returns a random integer between 0 and 32767.
echo $RANDOM
9816
echo $RANDOM
30922
If you want to limit that to a certain maximum, you can just compare against the modulus of that maximum + 1. \
For example, the following will yield results between 0 and 9:
echo $(($RANDOM % 10))
5
echo $(($RANDOM % 10))
9
Note that this skews random numbers to the lower regions of your boundaries in most cases.
Printing to PDF files on Ubuntu
This will install a printer called "PDF":
sudo apt-get install cups-pdf
Files will be put into ~/PDF/
without any questions asked.
Install the Paperclip gem on Ubuntu servers
You need to install the following packages before you can build the Paperclip gem:
sudo apt-get install imagemagick librmagick-ruby
Install the Nokogiri gem on Ubuntu servers
You need to install the following packages before you can build the Nokogiri gem:
sudo apt-get install libxml2-dev libxslt1-dev
How to use your iPhone's internet connection on your Ubuntu machine via USB
Luckily, this is simple. Just install three packages:
sudo apt install ipheth-utils libimobiledevice-dev libimobiledevice-utils
Then turn on the "Personal Hotspot" in iPhone settings, connect it to your Ubuntu machine via USB and you should be up and running.
Updated: Puppet 2.6.x on Ubuntu lucid 10.04
New way to install an actual puppet version on ubuntu
Solve Flash performance issues in Ubuntu
The linked article describes how to use a Firefox addon "Flash-Aid" to install a better build of Flash and apply some optimizations.
With this I can now properly watch fullscreen HD videos under Ubuntu.
How to: Classic scrollbars in Ubuntu 11.04
Ubuntu natty introduced new "invisible" scrollbars for GTK programs such as gEdit or Nautilus.
If you do not like them:
sudo apt-get purge liboverlay-scrollbar-*
In order to have a tool recognize the changes you have to quit all its instances. Or just log out and back in.
Generate Puppet or Chef recipes from a Ubuntu system state
blueprint is DevStructure’s workhorse tool that looks inside popular package managers, finds changes you made to configuration files, and archives software you built from source to generate Puppet, Chef, or shell code. Everything blueprint sees is stored in Git to be diffed and pushed. It runs on Ubuntu Linux 10.04 and newer.