Categories
Linux Ubuntu Uncategorized

Linux Mint: “Could not download all repository indexes”

When running

sudo apt-get update

or attempting to update via the Update Manager in Linux Mint (13), I was fronted with the following error:

Failed to fetch http://packages.linuxmint.com/dists/deb ... tion-en_US Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... slation-en Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... tion-en_US Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... slation-en Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... tion-en_US Unable to connect to packages.linuxmint.com:http:
Failed to fetch http://packages.linuxmint.com/dists/deb ... slation-en Unable to connect to packages.linuxmint.com:http:
Some index files failed to download. They have been ignored, or old ones used instead.

This is caused by missing repositories which are either old, broken or currently down. In order to fix it, simply run:

sudo apt-get update fix-missing

If this option doesn’t work, try changing the repository mirrors with the following guide.

Categories
HowTo Linux Raspberry Pi Ubuntu

Unknown encoder ‘libx264’

If you encounter a problem similar to the following, where you’re missing the libx264 codec try this solution.

avconv -r 10 -i image%06d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 timelapse1.mp4

avconv version 0.8.6-6:0.8.6-0ubuntu0.12.10.1, Copyright (c) 2000-2013 the Libav developers
built on Apr 2 2013 17:02:16 with gcc 4.7.2
Input #0, image2, from 'image%06d.jpg':
Duration: 00:02:21.20, start: 0.000000, bitrate: N/A
Stream #0.0: Video: mjpeg, yuvj420p, 2592x1944, 10 fps, 10 tbr, 10 tbn, 10 tbc
Unknown encoder 'libx264'

In order to acquire libx264, on Debian based distros (Ubuntu, Mint, Raspbian) install the following package:

 sudo apt-get install libavcodec-extra-53
Categories
Arch Linux Fedora HowTo Linux Ubuntu

Heat Management in Linux

When you first switch from Windows or OSX to Linux, one of the things you’ll probably first notice (especially if you’re using a laptop) is that it can run considerably hotter than the alternatives. There are a few things you can do to remedy this, however. The following software packages help you keep track of and cool down your laptop/netbook, how much will depend per machine but my HP Pavilion dm1 goes from around 60-70degrees without these tools installed to around 50-60degrees and the same goes for my older Acer Travelmate which dropped from 70-80degrees to 60-70degrees. Hopefully this information will help you shave off 10degrees from your laptop, making it cooler, easier to use and hopefully extending its life a little too!

lm-sensors

First thing that you’re going to want to do is be able to see what the temperature readings of the components (that have temperature sensors) inside your computer/laptop. This can be done by installing lm-sensors:

sudo apt-get install lm-sensors

Now you’ll want to run the script which probes all the possible sensors in your laptop:

sudo sensors-detect

You’ll be asked if you want to scan for sensors and what not, follow the on-screen instructions, mostly just pressing enter, if YES is written in capitals this is the default answer and it will scan. After several times it’ll ask you if you want to save the changes, make sure you do and then you’re done.

Now you can see the temperature the sensors are reading by using the following command:

sensors
cpufreq

cpufreq is a utility which scales the frequency of the CPU, either by monitoring the systems status (if it needs more, it’ll get more) or by user controlled settings. This essentially underclocks the CPU while it isn’t in use, reducing power usage and thus heat.

Installation:

sudo apt-get install cpufreq

The best choice would be to set cpufreq to on-demand (default) or to power-saving. Alternatively, if you’re using a laptop or netbook let jupiter take care of it for you:

jupiter

Jupiter is a light weight power and hardware control applet for Linux. It is designed to improve battery life of a portable Linux computer by integrating with the operating system and changing parameters of the computer based on battery or powered connection.

Additionally, Jupiter provides quick access to some of the commonly needed hardware controls like screen output and resolution, WIFI, and bluetooth.

If you use Linux on a portable computer, let Jupiter take the effort out of going mobile.

By using this to intelligently control the CPU frequency when on battery and AC along with the tuning to the kernel and hardware, it can make a huge difference to the temperature expelled by your laptop.

Ubuntu 11:10 installation instructions: here

Graphics Card Drivers

If you have a dedicated graphics card in your laptop, you’ll also be better off installing the proprietary graphics drivers provided by the hardware vendor. While the open source ones do an awesome job of getting the card to work, more often than not they don’t include any control over the frequency scaling and keep the card running at max, along with all those other little features the card has, they’ll probably all always be running.

Nvidia : Link
ATI/AMD : Link

Categories
Arch Linux Fedora HowTo Linux Posts Ubuntu

Linux Media Players And Flash Not Stopping The Screensaver

It’s a pretty common problem, one which could be solved by pretty much the following sentence: ‘[Insert Linux Distro], [Insert Media Player] not stopping screen saver when playing videos.’ And, yeah, it’s very annoying. Something that should have been fixed thousands of releases ago, just like most common Linux problems. Luckily though there is a fix, it’s easy and it’s awesome.

Introducing: Caffeine, “An application to temporarily prevent the activation of both the screen saver and the “sleep” powersaving mode.” – https://launchpad.net/caffeine

Essentially what this program does is look for processes running on your machine (you can do this too, just run ‘ps -A’ in a terminal emulator to see a list of everything), so you set process names which the program should look out for, for example ‘vlc’ and when there is a process with this name Caffeine disables the screensaver, when the process stops the screensaver is re-enabled. It even comes with a little tray icon which allows you to manual enable or disable the screensaver/power management with a single click.

Installation (Ubuntu):
sudo add-apt-repository ppa:caffeine-developers/ppa
sudo apt-get update
sudo apt-get install caffeine
Usage:

You’ll be able to see if caffeine is running by the tray icon the first time you use it (this can be disabled in the settings).

Caffeine Running (Screensaver / Power Management Enabled)
Caffeine Running (Right Click Settings)
Caffeine Running (Screensaver / Power Management Disabled)
Adding Processes:

To add a process which will disable the screensaver from being activated, for example VLC so we can watch a movie without constantly having to wiggle the mouse:

First, run VLC (or whatever other media player you wish and just replace VLC for that for the other few steps)

Next, right click on the Caffeine tray icon and select “Preference”.

Click the “Add” button.

List of processes already disabling the screensaver, note Totem is added here.

You should be greeted by a list of the running processes, select the name of the media player (this case, vlc) if it isn’t there check under the “Recent Processes” tab or alternatively just write the command you would use to run this program from the command line.

Adding VLC to processes to disable the screensaver.

Finally click the “Add” button and close the preferences window, that pesky screensaver should no longer be bothering you!

Stopping Flash from enabling the screensaver:

Okay, this is actually really easy, if you’re using Chromium or Google Chrome or Firefox, you’ll just want to add the processes ‘npviewer.bin’ to list, you can use the above instructions to do so.

Categories
Arch Linux Blog Command Line Fedora Linux Posts Ubuntu

Switching Between Two Resolutions in Linux

I have a TV and my monitor connected to my PC by a VGA switch box but what’s annoying is they aren’t the same resolution. This causes problems because I can’t see what I’m doing when I have switched to TV and usually have to leave the setting manager open so that when I change between them I just have to hit return and the resolution changes. That’s great and all but it’s far more effort than I want for something I do fairly often.

My plan was initially to create two xorg.conf files and switch between them using a script, I figured this would be the easiest way even though I haven’t messed around with xorg stuff for a few years ever since things just started working better in Linux. Turns out I couldn’t even find where they keep the xorg.conf file, it sure isn’t in /etc/X11 where it was the last time I looked..

On the search for this file though I came across another useful tool called xrandr, which essentially allows you to change the resolution from the command line.

Xrandr is used to set the size, orientation and/or reflection of the outputs for a
screen. It can also set the screen size.

If invoked without any option, it will dump the state of the outputs, showing the
existing modes for each of them, with a ‘+’ after the preferred mode and a ‘*’
after the current mode.

There are a few global options. Other options modify the last output that is spec‐
ified in earlier parameters in the command line. Multiple outputs may be modified
at the same time by passing multiple –output options followed immediately by
their corresponding modifying options.

For more information on xrandr check out the manual page (or type man xrandr in terminal).

It turns out it’s an extremely easy tool to use, with a command as simple as the following changing the resolution:

xrandr --output VGA1 --mode 1440x900

So the next thing I did was create the following script which allows the resolution to switch between 1440×900 and 1360×768 (my monitor and my TV native resolutions).

#!/bin/bash

TV="1360 x 768"
MONITOR="1440 x 900"

TEST="$(xrandr | grep current | sed -e 's/.*current //;s/, maximum.*//')"

#echo $TEST

if [ "$TEST" == "$MONITOR" ]
        then
                xrandr --output VGA1 --mode 1360x768

elif [ "$TEST" == "$TV" ]
        then
                xrandr --output VGA1 --mode 1440x900

else

        exit

fi

This script simply checks what the current resolution is being used and then toggles between the two set resolutions.

Categories
Command Line Linux Posts Ubuntu

Xfce4 Installed on Ubuntu 11.10, Global Menu Remains.

After installing Ubuntu 11.10 I headed straight for an install of gnome-shell, I’ve been using it for a couple of months without any issue and got used to it enough that it wouldn’t impede on my workflow. That was until this release, when it was officially supported by Canonical and all of a sudden it’s broken and mostly useless. So off to Xfce I go, it’s like gnome2 but way more customisable and actually pretty sweet.

However because I installed from a clean Ubuntu install rather than an xubuntu install I noticed that I still have the global menu (or appmenu-*) floating at the top under the default panel. To remove it, since it’s doing nothing and it looks plain stupid with transparency added to the panel.

It’s pretty simple to uninstall, just open up a terminal window and use the following command:

sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt

Now just re-start X (log out and in again, restart the computer) and when you return, it should be gone.

And if you ever feel the need to want it back, maybe you want to give unity another try then use the following command:

sudo apt-get install appmenu-gtk3 appmenu-gtk appmenu-qt

Source: http://www.addictivetips.com/ubuntu-linux-tips/how-to-disable-global-menu-in-ubuntu-11-10-tip/

Categories
Linux Posts Ubuntu

How to Install the ‘gnome-shell-extensions-mediaplayer’ Extension

The mediaplayer widget found on github, created by eonpatapon – (https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer).

I’ve been searching for a while for a good, solid widget style thing that’ll sit in the top of the gnome-shell panel which can control the music that’s playing in banshee, rhythmbox or whatever else you want to use to play your tunes.

 

Installation:

1. First you’ll need to grab some dependencies:
sudo apt-get install git gnome-common gnome-tweak-tool
2. Next download the files from the git repository as below (this will download the folder to whatever directory you’re currently in, in terminal):
git clone https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer.git
3. Once it’s finished download (it shouldn’t take too long it’s only about 2.30MB as of writing this guide), you’ll want to install using the following commands:
cd gnome-shell-extensions-mediaplayer
./autogen.sh --prefix=/usr
make
sudo make install
4. That’s it, it’s installed. Next you’re going to want to enable it, run gnome-tweak-tool and under extensions slide the newly installed extension to ON and it should appear next to the “Universal Access Settings” in the top right.

Categories
Linux Posts Ubuntu

Steam in Wine, Repeated Windows

After installing Steam on my linux machine in wine I noticed a really annoy bug, the windows of steam are tiled across my screen as shown in the screenshot below.

Fix:

I managed to fix this by opening up the ‘Configure Wine’ program that comes with wine and under the Applications tab switching from Windows XP mode to Windows 7, this fixed this bug and I now also have system borders on the steam windows.

Installing Wine:

If you’re interested in getting steam installed I used this guide – https://wiki.ubuntu.com/UbuntuMagazine/HowTo/InstallingSteam – It’s pretty simple and only takes a few minutes to do. Below is a quick, simple breakdown of what that guide says to do.

Download wine:

sudo apt-get install wine

Download the steam installer from here:

http://www.steampowered.com/v/index.php

Copy over the tahoma.ttf font from a Windows install (or Download it here – http://source.winehq.org/source/fonts/tahoma.ttf ). Do this command from the folder you downloaded the font to.

 cp tahoma.ttf ~/.wine/drive_c/windows/fonts/

(If it doesn’t work and says the folder is missing or somthing like that do the following and then re-do the cp)

 mkdir ~/.wine/drive_c/windows/fonts/

Finally install Steam (Do this command in the directory you downloaded the Steam installer to):

msiexec /i SteamInstall.msi
Categories
Android Linux Posts Ubuntu

Flashing Samsung Galaxy S (I9000) ROMs with Heimdall

This Tutorial is just a documentation of how I flashed my Samsung Galaxy S (I9000) using heimdall with Darky’s Rom v10.1, follow the steps at your own risk. I am in no way liable for any damage caused to your phone following these steps. I would advise reading up on flashing before proceeding along with pre-reading the guide first.

If you don’t know what you’re doing, you should probably not do it.

For more information, help and most anything check out xdadevelopers forum and DarkysRom.com

This guide is using a fresh install of Ubuntu 11.04 on a memory stick, I was unable to get heimdall installed on Fedora 15 or Ubuntu 10.04.
For this guide I will use Darkys Rom v10.1, however it should work for all ROMs that come with the correct files, as shown below.

Installing Heimdall

First install the Qt Gui libraries:

 sudo apt-get install libqtgui4

Once that’s installed head over to the heimdall website and download heimdall and the frontend for it, here I went for version 1.1.1 as the latest version (as of writing this guide 1.2.0 does not have a frontend).

Here simply download the .deb file and run it once it’s downloaded, you should be able to install them no problem.

(direct links for the version used in this guide)
Heimdall – https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall_1.1.1-1_i386.deb
Heimdall-frontend – https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall-frontend_1.1.1-1_i386.deb

Getting The Files

Download the ROM you wish to flash your phone with, for example download Darky’s Ressurection v10.1.

Extract Darky_Resurrection_10.1_i9000.zip
Inside also extract Darky_Resurrection_10.1.tar

You should have the following files:

Darky_Resurrection_10.1_i9000 (folder)

  • Darky_Resurrection_10.1 (folder)
    • boot.bin
    • cache.rfs
    • dbdata.rfs
    • factoryfs.rfs
    • modem.bin
    • param.lfs
    • Sbl.bin
    • zImage
  • Odin3 v1.3,exe
  • Odin3 v1.7.exe
  • s1_odin_20100512.pit

Preparing Your Phone

Make sure you have full battery and disabled all lagfixes.

Flashing The Phone

Press Alt+F2 and then type “heimdall-frontend” and hit enter.

Add the files to the correct heidmall options as so:

Repartition

PIT : s1_odin_20100512.pit

PDA/Code

FactoryFS : factoryfs.rfs
Kernel(zImage) : zImage
Param.lfs : param.lfs
Primary BootLoader : boot.bin
Secondary Bootloader : Sbl.bin

CSC

Cache : cache.rfs
Database Data : dbdata.rfs

Other

Modem : modem.bin
Recovery :

Finally put your phone into download mode.

Once your phone is in downloadd mode, make sure it’s connected via USB and then press start on Heimdall.

After a few minutes your Heimdall will say Finished. Boom you’re done. Just wait for your phone to finish doing whatever it’s doing and you should end up back at the home screen soon enough.

Categories
Fedora Linux Posts

GNOME 3 – Delete Key Not Deleting/Working in Nautilus

In GNOME 3 it seems that the keyboard shortcut to delete a file in Nautilus is actually Ctrl+Delete, this is fine I guess if it’s trying to stop people accidentally deleting files or something but it’s pretty annoying.

To change the keyboard shortcut from Ctrl+Delete back to the usual Delete do the following:

Open a terminal and type:

dconf-editor

If you don’t have it, install it the usual way.

In the application that just opened, on the sidebar click:

org > gnome > desktop > interface

And check the box entitled: can-change-accels.

Now, leave this window open and open up Nautilus.

Select a file that you want deleting and then click on Edit in the Nautilus menu, hover over the Move To Trash button and here press the button you wish to assign to the action, so for example Delete. You may have to press it twice (the first time it will remove the old key-binding and the second will assign it the new one.)

Go back to dconf-editor and uncheck the can-change-accels option to stop any other keyboard shortcuts being changed and you’re all done!