Bitcoin donations are welcome:14snQXeLcnJtWUduKZ6rC2MHdPYrYar1Tw

Sunday, April 29, 2012

Easy NFS howto for Ubuntu/Debian

This works wonders!

Source: http://ubuntuforums.org/showthread.php?t=249889


Install NFS Server Support
at the terminal type
sudo apt-get install nfs-kernel-server nfs-common portmap
When configuring portmap do =not= bind loopback. If you do you can either edit /etc/default/portmap by hand or run:
sudo dpkg-reconfigure portmap
sudo /etc/init.d/portmap restart


Editing /etc/exports
the /etc/exports file is used for creating a share on the NFS server

invoke your favorite text editor or
sudo vi /etc/exports

Here are some quick examples of what you could add to your /etc/exports

For Full Read Write Permissions allowing any computer from 192.168.1.1 through 192.168.1.255
  • /files 192.168.1.0/24(rw,no_root_squash,async)

Or for Read Only from a single machine
  • /files 192.168.1.2 (ro,async)
save this file and then in a terminal type
sudo /etc/init.d/nfs-kernel-server restart

Also aftter making changes to /etc/exports in a terminal you must type
sudo exportfs -a

Install NFS client support
sudo apt-get install portmap nfs-common

Mounting manually
Example to mount server.mydomain.com:/files to /files. In this example server.mydomain.com is the name of the server containing the nfs share, and files is the name of the share on the nfs server

The mount point /files must first exist on the client machine. 
cd /
sudo mkdir files


to mount the share from a terminal type

sudo mount server.mydomain.com:/files /files

Note you may need to restart above services:
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart


Mounting at boot using /etc/fstab
Invoke the text editor using your favorite editor, or
gksudo gedit /etc/fstab

In this example my /etc/fstab was like this:
  • server.mydomain.com:/files /files nfs rsize=8192,wsize=8192,timeo=14,intr
You could copy and paste my line, and change “servername.mydomain.com:/files”, and “/files” to match your server name:share name, and the name of the mount point you created.
It is a good idea to test this before a reboot in case a mistake was made. 
type
mount /files 
in a terminal, and the mount point /files will be mounted from the server.

Saturday, March 31, 2012

Auto enable numlock at ubuntu startup

Easy fix...

Just install numlockx.

apt-get install numlockx

Restart, DONE! :-)

Ubuntu Oneiric 11.10 60 second halt during startup

The error: "waiting for network configuration"


Well, I've been there, done that, fixed that.. Here it goes.


In my case I just updated to the latest version of ubuntu (11.10 oneiric). I am also using wicd-client for managing all my network connections, which works flawless. After the update I started getting these halt messages during startup. The problem is ubuntu's own network config files which has other expectations on how the network should act.


The fix:

root@System:/home/user# nano /etc/network/interfaces 


now # out all lines except "auto lo" and "iface lo inet loopback".
My file looks like this:


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp

Monday, September 5, 2011

Enable wakeup from suspend with usb keyboard or mouse in Linux Ubuntu

This guide is exactly what you need :)

In short;
1.) Enable it in your bios
2.) echo DEVNAME > /proc/acpi/wakeup
3.) Correct DEVNAME is found using the following script:

grep "USB.*pci" /proc/acpi/wakeup | cut -d ':' -f 2- | while read aaa; do find /dev/.udev -name "*$aaa*" -print -exec grep "$aaa" /proc/acpi/wakeup \; -exec echo \; ; done
4.) Add cmd(2.)) to /etc/init.d/wakeup


Your wakeup file should look something like this:

#!/bin/sh
# Set /proc/acpi/wakeup to allow devices to wake system
# sudo sh -c "echo USBX > /proc/acpi/wakeup"
echo USB4 > /proc/acpi/wakeup


5.) Enable wakeup to boot at startup:
update-rc.d wakeup defaults
6.) Done...


Ubuntu natty with xbmc dharma won't shut down from menu

Solved this by editing /var/lib/polkit-1/localauthority/50-local.d/custom-actions.pkla

and replacing it with the following. Just make sure "xbmc", marked red, is the correct user...

[Actions for xbmc user]
Identity=unix-user:xbmc
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*
ResultAny=yes
ResultInactive=no
ResultActive=yes

Thanks to
http://wiki.xbmc.org/index.php?title=Ubuntu_Suspend_/_Wake

Monday, August 1, 2011

Saved radio presets disappears on car stereo

Solution: You have probably just installed your car stereo wrong. Take a look at the wiring where you will have one red and one yellow cable. It should be possible to switch these around. Do that, and it should work.

Happened and solved with my Pioneer car stereo..

Wednesday, June 29, 2011

Mediakeys for spotify in Linux

There is two ways of doing this.

1.) Native Spotify player for Linux (requires Unlimited or Premium)
Create spotify-control containing this (credits go to this allenap):

#!/usr/bin/env python

import dbus
import sys

if __name__ == '__main__':
    session = dbus.SessionBus.get_session()
    spotify = session.get_object(
        "org.mpris.MediaPlayer2.spotify",
        "/org/mpris/MediaPlayer2")
    for command in sys.argv[1:]:
        getattr(spotify, command)()

su
chmod 755 spotify-control

Next, put the file into i.e. /usr/bin/
Now you got a cmd way of controling your spotify player.. spotify-control Previous, spotify-control Next and spotify-control PlayPause...

If you are using fluxbox as I am, add the following to your ~/.fluxbox/keys

# Spotify
Mod4 Right :Exec $(spotify-control Next)
Mod4 Left :Exec $(spotify-control Previous)
Mod4 space :Exec $(spotify-control PlayPause)

Save, "reconfigure" (or restart fluxbox), and you are done..
Now you can use your windows button + Right/Left for Next/Previous or Space to pause :)


2.) If you are using spotify via wine..
This way is a bit more "unslick" and nasty.. But it works..
You do it the same way, except you use the following script located here..