Dienstag, 31. Mai 2011

How to play Minecraft with a Wiimote


How to set up Bluetooth correctly

  1. sudo apt-get install bluez-utils libopenobex1 wmgui wminput
  2. sudo /etc/init.d/bluetooth restart
  3. sudo modprobe uinput
  4. sudo su
    echo "uinput" >> /etc/modules

Edit the file /etc/cwiid/wminput/minecraft eg. with sudo gedit /etc/cwiid/wminput/minecraft and copy and paste the code below. You could also save this file as /etc/cwiid/wminput/minecraft
Now start wminput: sudo wminput -c minecraft -w

Pointing does not work but I'm figuring it out ;)
I think the key assignment is self-explanatory.
#Head Movement
Plugin.acc.X = REL_X
Plugin.acc.Y = REL_Y
#Body Movement
Plugin.nunchuk_stick2btn.Up = KEY_W
Plugin.nunchuk_stick2btn.Down = KEY_S
Plugin.nunchuk_stick2btn.Left = KEY_A
Plugin.nunchuk_stick2btn.Right = KEY_D
#Left Mouse Button, Right Mouse Button and Space
Wiimote.B = BTN_LEFT
Nunchuk.Z = BTN_RIGHT
Wiimote.A = KEY_SPACE
Wiimote.Home = KEY_E
Wiimote.2 = KEY_ESC


[Tutorial] Minecraft mit Wiimote und Nunchuk spielen


Falls Bluetooth noch nicht läuft

Hier habe ich eine Anleitung geschrieben um Bluetooth zum laufen zu bekommen.
  1. sudo apt-get install bluez-utils libopenobex1 wmgui wminput
  2. sudo /etc/init.d/bluetooth restart
  3. sudo modprobe uinput
  4. sudo su
    echo "uinput" >> /etc/modules

Bearbeite die Datei /etc/cwiid/wminput/minecraft z.B. mit sudo gedit /etc/cwiid/wminput/minecraft und füge den Code von unten ein. Du kannst auch diese Datei als /etc/cwiid/wminput/minecraft speichern.
Dann wminput per sudo wminput -c minecraft -w starten.

Die Maus wird dann durch Kippen des Wiimote gesteuern, WASD liegt auf dem Stick den Nunchuk. Die B-Taste ist die Linke Mausstaste, Z (Nunchuk) die Rechte, mit A hüpft man (Leertaste), mit der Home-Taste öffnet man das Inventar (E) und mit Taste 2 drückt man Escape. Ich bin gerade dabei, eine Config zu machen, mit der man Minecraft mit dem Infrarotsensor, also wirklich durch zielen auf den Bildschirm und nicht nur durch kippen
#Head Movement
Plugin.acc.X = REL_X
Plugin.acc.Y = REL_Y
#Body Movement
Plugin.nunchuk_stick2btn.Up = KEY_W
Plugin.nunchuk_stick2btn.Down = KEY_S
Plugin.nunchuk_stick2btn.Left = KEY_A
Plugin.nunchuk_stick2btn.Right = KEY_D
#Left Mouse Button, Right Mouse Button and Space
Wiimote.B = BTN_LEFT
Nunchuk.Z = BTN_RIGHT
Wiimote.A = KEY_SPACE
Wiimote.Home = KEY_E
Wiimote.2 = KEY_ESC


Sonntag, 29. Mai 2011

A fast and easy way to install the Minecraft server in Ubuntu Linux

All you've got to do in order to install the minecraft server is follow these instructions.
Or you can use a shell script i wrote:
  1. download
  2. make it executable ( chmod a+x minecraft_server_setup.sh )
  3. execute it( ./minecraft_server_setup.sh )
show me the magic
#!/bin/bash
echo -n 'Do you want to (i)nstall or (s)tart the minecraft server?'
read watdo
startit(){ 
 if [ -d ~/.minecraft\ server/ ]; then
  cd ~/.minecraft\ server/
  echo -n "Do you have more than 1024MB of RAM?
  (y)es or (n)o"
  read watram
  echo -n "Do you want to start the server with a GUI?
   (y)es or (n)o"
  read watgui
  case "$watram" in 
   y|Y|Yes)
    case "$watgui" in
     y|Y|Yes)
      java -jar minecraft_server.jar
     ;;
     n|N|no|No)
      java -jar minecraft_server.jar nogui
     ;;
     *) echo "Unknown Parameter"
     read ''
     ;;
    esac 
   ;;
   n|N|no|No)
    case "$watgui" in
     y|Y|Yes)
      java -Xmx1024M -Xms1024M -jar minecraft_server.jar
     ;;
     n|N|no|No)
      java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
     ;;
     *) echo "Unknown Parameter" 
     read ''
     ;;
    esac 
   ;;
   *) echo "Unknown Parameter" 
   read ''
   ;;
  esac
 else
  echo "You don't seem to have the Minecraft server installed.
Do you want to install it now?
(y)es or (n)o"
  read watdo
  installit
 fi
 
}
installit(){
 case "$watdo" in
 y|Y|yes|Yes|i|I|install|Install) 
 if [ ! -d ~/.minecraft\ server/ ]; then
  mkdir ~/.minecraft\ server
  cd ~/.minecraft\ server/
  wget http://www.minecraft.net/download/minecraft_server.jar
  chmod a+x minecraft_server.jar
  echo -n "Do you want to start the server now?
   (y)es or (n)o"
  read startnow
  case "$startnow" in
  y|Y|Yes)
   startit
  ;;
  *)  
  ;;
  esac
 else
  echo "The Minecraft Server seems to be installed.
Do you want to start it now?
(y)es or (n)o"
  read watnowdo
  case "$watnowdo" in
  y|Y|yes|Yes)
   startit
  ;;
  *)
  ;;
  esac
 fi
 ;;
 s|S|start|Start)
  startit
 ;;
 n|N|no|No)
  exit 0
 ;;
 *) 
  echo "Unknown Parameter" 
  read ''
 ;;
esac
}
installit
exit 0

I know the code is pretty messy, but it's the first shell script i've written so I'm OK with it ;)

Minecraft Server unter Ubuntu Linux installieren

Um Minecraft auf Ubuntu zu installieren muss man nur diesen Anweisungen folgen.
Noch einfacher gehts mit einem Script, dass ich geschrieben habe.
  1. Downloaden
  2. Ausführbar machen ( chmod a+x minecraft_server_setup.sh )
  3. Ausführen ( ./minecraft_server_setup.sh )
Klick mich um Code anzuzeigen
#!/bin/bash
echo -n 'Do you want to (i)nstall or (s)tart the minecraft server?'
read watdo
startit(){ 
 if [ -d ~/.minecraft\ server/ ]; then
  cd ~/.minecraft\ server/
  echo -n "Do you have more than 1024MB of RAM?
  (y)es or (n)o"
  read watram
  echo -n "Do you want to start the server with a GUI?
   (y)es or (n)o"
  read watgui
  case "$watram" in 
   y|Y|Yes)
    case "$watgui" in
     y|Y|Yes)
      java -jar minecraft_server.jar
     ;;
     n|N|no|No)
      java -jar minecraft_server.jar nogui
     ;;
     *) echo "Unknown Parameter"
     read ''
     ;;
    esac 
   ;;
   n|N|no|No)
    case "$watgui" in
     y|Y|Yes)
      java -Xmx1024M -Xms1024M -jar minecraft_server.jar
     ;;
     n|N|no|No)
      java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui
     ;;
     *) echo "Unknown Parameter" 
     read ''
     ;;
    esac 
   ;;
   *) echo "Unknown Parameter" 
   read ''
   ;;
  esac
 else
  echo "You don't seem to have the Minecraft server installed.
Do you want to install it now?
(y)es or (n)o"
  read watdo
  installit
 fi
 
}
installit(){
 case "$watdo" in
 y|Y|yes|Yes|i|I|install|Install) 
 if [ ! -d ~/.minecraft\ server/ ]; then
  mkdir ~/.minecraft\ server
  cd ~/.minecraft\ server/
  wget http://www.minecraft.net/download/minecraft_server.jar
  chmod a+x minecraft_server.jar
  echo -n "Do you want to start the server now?
   (y)es or (n)o"
  read startnow
  case "$startnow" in
  y|Y|Yes)
   startit
  ;;
  *)  
  ;;
  esac
 else
  echo "The Minecraft Server seems to be installed.
Do you want to start it now?
(y)es or (n)o"
  read watnowdo
  case "$watnowdo" in
  y|Y|yes|Yes)
   startit
  ;;
  *)
  ;;
  esac
 fi
 ;;
 s|S|start|Start)
  startit
 ;;
 n|N|no|No)
  exit 0
 ;;
 *) 
  echo "Unknown Parameter" 
  read ''
 ;;
esac
}
installit
exit 0

Der Code ist deshalb so chaotisch, weil es mein erstes Shell-Script ist ;)

Donnerstag, 26. Mai 2011

How to turn off the log in sound in Ubuntu

If you are like me, and often switch between different OS, you will get annoyed by login sounds easily. I tried to turn the Ubuntu login sound off, but the option to do so is somewhat hidden.


The Ubuntu login sound.


The settings in gdmsetup, didnt change anything

gdmsetup in german Unity options for gdmsetup in german
In order to turn off the login sounds you have to start gnome-session-properties:
gnome-session-properties in Unity Remove this check mark

In the gnome-session-properties search for "GNOME Login Sound" and remove the check mark
When you log in the next time, no login sound will be played :)


Here you can compare the Windows 7 login sound to the Ubuntu one
What do you think, which one sounds better?
And if you have a custom login sound for Windows or Ubuntu, leave a comment and let us know!

Anmeldemelodie bzw. Loginsound deaktivieren.

Da mich die Anmeldemelodie von Ubuntu ziemlich nervt, vor allem wenn der Sound aus versehen auf voller Lautstärke ist, habe ich versucht den Loginsound auszustellen.


Der Ubuntu Login Sound.


Die Einstellung im gdmsetup ( in Unity Anmeldebildschirm genannt ) bringt jedoch keine Veränderung.

gdmsetup in Unity Optionen von gdmsetup
Abhilfe schafft das Bearbeiten der Startprogramme (gnome-session-properties):
gnome-session-properties in Unity Das Häkchen entfernen

Dort nach "GNOME Login Sound" suchen und den Haken entfernen.
schon kann man Ubuntu starten ohne von der Startmelodie begrüßt zu werden.


PS Trotz aller Nervigkeit gefällt mir der Login Sound von Ubuntu beser als der von Windows ;)

Donnerstag, 19. Mai 2011

4 different wallpapers in Ubuntu 11.04 with Compiz

You want to have a different wallpaper on each workspace? Take a look at my screencast




The commands i used:

sagi compizconfig-settings-manager // installs the compiz settings manager

ccsm // starts the settings manager
gconf-editor // starts the gnome configuration tool
In the compizconfig-settings-manager search the wallpaper plugin, add the 4 wallpapers you want and then activate it.

Then start the gconf-editor and remove the check mark at apps>nautilus>preferences>show_desktop .

Your 4 workspace should now have different wallpapers.
If Unity displays the menubar or the dock incorrectly just log out and then log in again.

4 verschiedene Wallpaper in Ubuntu 11.04 mit Compiz

Die willst für jede der 4 Arbeitsflächen in Ubuntu 11.04 ein eigenes Hintergrundbild?
Wie das geht zeige ich hier in einem Screencast:




Die Befehle, die ich benutze:

sagi compizconfig-settings-manager // Installiert den Einstellungs-Manager von Compiz

ccsm // Startet  den Einstellungs-Manager

gconf-editor // Started das Gnome Konfigurations-Programm
Im Einstellungs-Manager von Compiz sucht man das Wallpaper-Plugin, stellt dort vier gewünschte Hintergrundbilder ein und aktiviert das Plugin dann.

Dann startet man den gconf-editor und entfernt das Häkchen unter apps>nautilus>preferences>show_desktop .

Eure 4 Workspaces sollten jetzt die verschiedenen Wallpaper anzeigen.
Wenn es, wie bei mir im Video auch, zu Darstellungsfehlern in Unity, z.B. in der Menüleiste kommt, einfach ab- und wieder anmelden.

Montag, 16. Mai 2011

how to replace the sudo apt-get install command with sagi

Installing applications with terminal commads is pretty easy and often faster than opening up the software center and searching the application in there.
sudo apt-get install $PACKETNAME
The only hard part is typing sudo apt-get install again and again ;)
If you want to replace sudo apt-get install with a shorter command like "sagi" you have got to download  this script . Now open up a terminal and move the script to your home folder and make it invisible using this command.
mv ~/downloads/pastie-1907126.sh ~/.sagi
Open the file ~/.bashrc with this command:

gedit ~/.bashrc

Add this line to the end of the file:
source ~/.sagi

Restart the terminal and you are good to go! You can now use sagi instead of sudo apt-get install, with tab-completion for package names!

Source

Sonntag, 15. Mai 2011

Sudo apt-get install mit sagi ersetzen

Wenn man Ubuntu schon etwas länger benutzt wird man feststellen, dass die Installation von Programmen per Terminal eigentlich sehr einfach und praktisch ist.
sudo apt-get install $PAKETNAME
Das einzige schwierige daran ist, jedes mal sudo apt-get install zu tippen ;)
Doch dem Abhilfe zu verschaffen ist wirklich einfach. Man lädt sich dieses Skript herunter. Dann öffnet man ein Terminal und verschiebt das Skript in den persönliche Ordner und macht es unsichtbar.
mv ~/Downloads/pastie-1907126.sh ~/.sagi
Ich gehe davon aus das sich das heruntergeladene Skript im standardmäßigen Downloadsordner befindet. Dann fügt man der Datei .bashrc aus dem persönlichen Ordner folgende Zeile ans Ende hinzu:
source ~/.sagi
Da die .bashrc-Datei unsichtbar ist muss man in der Ordneransicht unsichtbare Dateien erst per [Strg]+[H] sichtbar machen um sie zu bearbeiten. Oder man bearbeitet sie per Terminalbefehl:
gedit ~/.bashrc
Wenn man jetzt das Terminal neu startet kann man sich das Tippen von sudo apt-get install sparen und hat auch mit dem sagi Befehl noch Tab-Komplettierung für Paketnamen!

Hier ist der Originalbeitrag auf englisch:
http://ubuntuforums.org/showthread.php?t=392508

Donnerstag, 5. Mai 2011

Ubuntu Natty Narwhal install - now with Youtube and HTML5 !

When you install a new OS like Windows, you will spend a lot of time just looking at the slowly moving progress bar. But not in Ubuntu!

Watch Youtube while installing Ubuntu Natty Narwhal!
I'm installing Ubuntu 11.04 right now on my Acer ASPIRE 5742G. But even the Ubuntu installation takes some time, so I opened up Firefox and visited my Homepage.

And I was pretty surprised when I was perfectly able to watch the Family Guy Dubstep Video i uploaded a week ago. The Adobe Flash player was not even installed. Seems like Ubuntu 11.04 and the shipped Firefox 4 browser support HTML5 videos Out Of The Box.

Good job Canoncial and the Ubuntu Community! And thank you Youtube for enabling HTML5 embedded Videos!

Ubuntu Natty Narwhal Installation - Mit Youtube und HTML5 !

Wenn man ein neues Betriebssystem wie Windows installiert verbringt man viel Zeit damit, einfach auf den Fortschrittsbalken zu gucken. "Da er hat sich bewegt - Nein doch nicht :( "
Nicht aber auf Ubuntu!

Youtube-Videos während der Installation von Ubuntu angucken!
Ich verfasse diesen Artikel gerade auf meinem Acer ASPIRE 5742G - und zwar während Ubuntu 11.04 installiert! Da aber auch die Installation von Ubuntu halt ihre Zeit braucht wollte ich mal schnell meine Homepage checken und -

- wurde ziemlich überrascht als ich ohne Probleme das Family Guy Dubstep Video anschauen konnte, das ich letzte Woche hochgeladen habe. Dabei habe ich nicht einmal den Adobe Flash Player installiert! Sieht so aus als unterstütze Ubuntu mit dem mitgelieferten Firefox 4 HTML5 Videos out of the box.

Hut ab Canoncial und an die Ubuntu Community! Und Dankeschön an Youtube, dafür dass ihr eingebette Videos auch in HTML5 unterstützt!