torsdag 14 november 2013

Fixing strange apt-get update error in xubuntu


I got this strange error when trying to do apt-get update on my xubuntu:

W:Failed to fetch http://archive.ubuntu.com/ubuntu/dists/saucy/Release Unable to find expected entry 'universedeb/source/Sources' in Release file (Wrong sources.list entry or malformed file)


Or in swedish:
Hämtade 13,0 kB på 17s (750 B/s)
W: Misslyckades med att hämta http://archive.ubuntu.com/ubuntu/dists/saucy/Release  Kunde inte hitta förväntad post "universedeb/source/Sources" i Release-filen (Felaktig post i sources.list eller felformulerad fil)

E: Några indexfiler gick inte att hämta. De kommer att ignoreras eller så används de gamla istället.

So after searching the web: i got the idea to inactivate random repositories in my /etc/apt/sources.list file.

I found that by deactivating part of this section this :
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu saucy universe
deb-src http://archive.ubuntu.com/ubuntu saucy universedeb http://se.archive.ubuntu.com/ubuntu/ saucy-updates universe
deb-src http://archive.ubuntu.com/ubuntu saucy-updates universe


by commenting (putting # before)
deb-src http://se.archive.ubuntu.com/ubuntu/ saucy universedeb http://se.archive.ubuntu.com/ubuntu/ saucy-updates universe
The problem disappeared.

Still dont krow what's behind the strange error.. but now I can at least use my computer as normal.

torsdag 17 oktober 2013

Extract clips of a video and put them together in a single video in terminal

So during a group assignment i needed to clip some videos of youtube. This is how I did it:

First i got the file from youtube using the download helper. Excellent tool by the way. (I downloaded the videos as flv, when downloading them as avi, i got some strange audio synching issues.)

Then I wrote a script to extract my clips from the video. (That was after trying every gui based solution to extract clips)

#!/bin/bash

declare -a startt=(
2:24
5:22
10:32
16:04
16:53
20:00
22:18
);

declare -a lent=(
02:57
03:33
00:46
00:15
02:03
01:45
00:57
);


for I in 0 1 2 3 4 5 6
do
avconv -i Presentationsfilmer/edge.flv -ss 00:${startt[$I]} -t 00:${lent[$I]} -vcodec  copy -acodec copy "clip$I.flv"
done


I got the start and the end times by watching the videos. Then i calculated the length, as needed by the script using Libre Office Calc.. I did not want to do it in my head.

And then for putting it all together... I never did it.. It seamed impossible to find a tool to just merge the different clips.. So I just made a playlist in totem instead. I guess that that gives the video editing in Linux a Failed grade, unfortunately....

So the result.. I still hate to edit movies in Linux, it took much more time than I possibly could imagine. In the future i would probably just use Youtubes video editing tool... That's it for today. So long!

tisdag 15 oktober 2013

How to use a laptop with no screen

My laptop broke. So i thought of throwing it away before I realized the obvious in making a simple server from it. The most usable reason for me to turn it into a server was to be able to use the computational power to run synthesizers wich my secondary computer could not manage. This is the two steps i made.

install ssh

Since i already had ubuntu installed from the beginning. The only thing i really needed to do to convert it to some kind of server was to install ssh:

sudo apt-get install openssh-server

Then to use the computer all I needed to do on the client side was

ssh (ip to the computer) -X

(-X is to be able to run graphical applications as nautilus, gedit, och google-chrome [but to be onest, to run google chrome over forwarded x is a bit overkill] )

wake on lan

It would be possible to keep the computer turned on all the time, but because my computer makes a lot of noise i rather turn it off sporadically. Since my laptop has its powerbutton under the lid, I figured out that it would be most practical to be able to boot it from somewere else. And thats how i came up with the wake up on lan. For my lenovo T61 the wake on lan feature was enabled by default. I got the network card name from my router.. (format 00:00:00:00:00 something) and then i use the awesome command powerwake when i need to start the computer. Works like magic

powerwake (mac-addr)


måndag 7 oktober 2013

Archlinux

My first try to install archlinux. (On virtual box)

This is problems I came across

Keyboard layout:

Since i use the swedish-dvorak layout-that was the first thing I had to get fixed...

The archwiki had instructions to change the layout... locked at that.. Seems like the dvorak layout is installed by deafult

localectl list-keymaps
...

localectl set-keymap --no-convert dvorak-sv-a5

...seems to do kind of the job.. not the same layout for special characters as i am used to but it will work..

in the beginning it looks like you can do 
loadkeys layout


Changing keyboardlayout in x
setxkb -layout se -variant dvorak

then change the xorg.conf (add)

Mounting disk

(assuming the disks are already formated in some fancy fashion) 
In order to install you must mount the hard drive


Working network in fresh install

For some reason my network didn't seem to work on the fresh install. I found this page with the solution in the end. Just run
dhcpcd
and it worked 

Sudo

To be able to install programs with your user it can be convenient to install sudo.

first: $pacman -S sudo

$export VISUAL=   (standard is vi)

use $visudo

add 
ALL = (ALL) ALL

somwhere or

% ALL = (ALL) ALL

Miscellaneous

autocompletion: bash-autocompleton

 

... For this time i gave up... I couldn't get the wireless card to work on my laptop, and on my raspberry pi complation took to much time or did not work at all. I learned a lot about how linux works however so I recomend anybody interested to do the same journey. I have allready used my knowledge on my debian-based linux computers.

Running fluidsynth in my raspberry pi

I must publish this so i can remember it. I had som trouble to start fluidsynth in the background when i did.

fluidsynth -a oss /usr/share/sounds/sf2/FluidR3_GM.sf2 &

however after finding this post i solved it by using

 fluidsynth -a oss -s -i /usr/share/sounds/sf2/FluidR3_GM.sf2 &

and everything works like a charm. Next step is to start fluidsynth with a init.d script.. but that is for tomorrow...

I havent figured out how to change instrumment though (within the same sound-font file)

Good night

söndag 21 juli 2013

How I finally managed to install jack on my raspberry pi


To make jack audio work on the raspberry pi you need to have a patched version of jack audio installed. On the linux audio page there was some information of how to add repository lists. How ever i never succeeded to install those, but found on link to deb-files to the patched versions of jackd and libjack2.

Since i already had jackd and libjack installed i used

dpkg -r --force-depends jackd libjack0

to remove the version of jack I already had installed, without removing programs depending on jack, followed by

dpkg -i *.deb
sudo apt-get -f install


And at last.. The command that finally got jack running on my usb-card for me was : jackd -P84 -p8 -t3500 -d alsa -dhw:Set -p128 -n3 -r48000 -s &



Of course that was before i killed my raspberry by plugging in to much stuff in the usb-port and installing packages at the same time.. 

-- note: --
As an alternative i found that using the oss emulation was not that bad for ordinary synths, as amsynth. Before i got jack up and running I used this method temporarily. Now when I know how to get jack running i hope i will not have to use it again, but here it is for reference usage:

The natural alternative was portaudio, but after some research i found out that more synths were made to rely solely on jack or oss (/dev/dsp). So I decided to install the oss compatibility layer for alsa.

sudo apt-get install alsa-oss
sudo modprobe snd_pcm_oss


the "modprobe" part makes the /dev/dsp file appear, and can be inserted into /etc/rc.local to have it loaded on startup



torsdag 23 maj 2013

Swedish letters and dvorak-layout on usb-keyboard on the Nexus 7

I've finaly got some routine on changing the keyboard layout on my Nexus 7 (and what i know the procedure is the same for all android devices) This is a notice for future use, and if somebody has the same issues.

1. Get files from the device


adb pull /system/usr/keychars/Generic.kcm Generic.kcm
adb pull /system/usr/keylayout/Generic.kl Generic.kl

the kcm-file to set the swedish signs, and the kl-file to change layout. If you only want the swedish letters then you only need to change the kcm file and only the kl-file if you only want to change the layout (location of the keys). Notice that the device sometimes automaticaly changes to swedish letters, so the kcm-change is not always nessesary.

Rembemer to save backups!

2. Change the files

I found a reference to a file that got the swedish (and finish) letters of the alphabet. Especialy the parts in the kcm-file saying

key APOSTROPHE {
    label, number:                      '\''
    base:                               '\u00e4'
    shift:                              '\u00c4'
    ctrl, alt, meta:                    none
}


key SEMICOLON {
    label, number:                      ';'
    base:                               '\u00f6'
    shift:                              '\u00d6'
    ctrl, alt, meta:                    none
}

and

key LEFT_BRACKET {
    label, number:                      '['
    base:                               '\u00e5'
    shift:                              '\u00c5'
    ctrl, alt, meta:                    none
}



And of course bocause i use dvorak, i also has the appropiate dvorak Generik.kl-file


key 1     ESCAPE
key 2     1
key 3     2
key 4     3
key 5     4
key 6     5
key 7     6
key 8     7
key 9     8
key 10    9
key 11    0
key 12    GRAVE
key 13    EQUALS
key 14    DEL
key 15    TAB
key 16    LEFT_BRACKET
key 17    APOSTROPHE
key 18    SEMICOLON
key 19    P
key 20    Y
key 21    F
key 22    G
key 23    C
key 24    R
key 25    L
key 26    COMMA
key 27    RIGHT_BRACKET
key 28    ENTER
key 29    CTRL_LEFT
key 30    A
key 31    O
key 32    E
key 33    U
key 34    I
key 35    D
key 36    H
key 37    T
key 38    N
key 39    S
key 40    MINUS
key 41    APOSTROPHE
key 42    SHIFT_LEFT
key 43    BACKSLASH
key 44    PERIOD
key 45    COMMA
key 46    J
key 47    K
key 48    X
key 49    B
key 50    M
key 51    W
key 52    V
key 53    Z



Push files to the device


And when you are ready, use some useful tool to push the files back again (remount to make the system writable)

adb remount /system/usr/keychars 
adb remount /system/usr/keylayout
adb push Generic.kcm /system/usr/keychars
adb push Generic.kl /system/usr/keylayout



4. Debug

Something can easily go wrong. If so make sure to change the logcat print. Write in terminal

su
logcat

In worst case.. Push the backup-files back again.

Prroblems that i had:

  • I wrote the kcm-file wrong. You cannot make up new letters, that will cause a error.
  • I got the wrong user access set on the files. I sudoed in the files so the system could not use the files. Fixed with chmod.
  • I cannot write z... Not fixed. Don not know any workaroud...




Hope it helps! Post a comment if it doesnt.
Cheers!

fredag 29 mars 2013

The perfect ubuntu/linux jack audio setup

Ok. So I will share my current top notch setup of my Ubuntu audio processing laptop. It consist mostly of free opensource programs

Here is what I got:

Sequencer: seq24/seq42

There is some different sequencers to choose from. You can (I rather don't) use Rosegarden, Qtractor, or some other very ambitious software as sequencer. But to me the best alternative is the simple seq24 sequencer, and alternative the fork project seq42. The difference is that seq24 is specialised more to live performance but seq42 is specialized for making non live tracks. seq24 is in the standard ubuntu repository:

sudo apt-get install seq24

 If you wan't the seq42 however, you need to compile it for your self. (It is not very difficult. There is instructions in the code folder)

Synths

I havent decided wich synths to use yet. But I have tried these with good result:
Pianoteq - i looked for a long time for a good piano synth. This is what I got. I runs both on windows and linux I've heard. But the application I have seen is using the vsthost on the windows version. Note that it is not free like the other applications

vsthost

For running vsti:s in ubuntu. Works well, but as far as I know it does not save the state of the vsti-plugin. If you need something 

sudo apt-get install vsthost

Qjackctl

It is kind of a basic application for jack audio. Actualy I am not very found with the interface, but if you need to change some connection it is allways there for you.

sudo apt-get install qjackctl

Hydrogen

A very nice drum machine.  The best I have tested. There is not much to say. It works! And I prefer the standard drumset so much so I do not even have to configure it to start playing.

sudo apt-get install hydrogen

Gladish

This is what makes it all fit together. Gladish is a graphical interface for the ladi session manager (ladish), that handles. It took me a while to find this blog, that explains how ladish works and how to use it. It was the piece i was looking for for so long. Finaly, I did not have to launch all the programs manualy but could save it an launch it with a simple command. Wonderful

sudo apt-get install gladish

Timemachine

For recording. Can be reset to automatically record when you start playing.

sudo apt-get install timemachine

Fast install

If you just want a lots of cool programs. Just run

sudo apt-get install amsynth gladish qjackctl hydrogen timemachine vsthost seq24

And you are ready to go!



If you have any questions of how to use any of it, please write me a comment.

onsdag 27 mars 2013

Fixing dbus related problems in jack [Solved] :)

I finally found it! I had a lots of annoying problems with jack (the performance audio system for linux) when it had crashed. It did not want to start again. The only informative i found in the error message was that there was some problem with the "dbus" (I still don't know what the dbus is doing, but it must be something important). Then i found this article.

The solution was so simple: you just go

killall -9 jackdbus

in your terminal and then its only to restart the jack daemon again. Perfect

--Edit a bit later--

Okay, that was not the solution to everything apparently. After a while the sound stopped work any way (for all other programs than jack-programs). So i wanted to restart the audio in some way. I found this article. Naming a way to find witch programs that used the audio:


lsof | grep pcm


Witch listed all programs using the audio. To my surprise it was jackd. (I didn't think i had started it at all!) so i just did

killall jackd

And everything worked again. Magic!

About Openbox - the winner of it all (I really hope i don't have to write anything more about this)

So. I thought i liked Cinnamon better than dash. Apparently I was wrong. Cinnamon was also very slow.

Anyway. I tested Openbox for performance. I noticed that there was nothing. (No panels no way to start up programs) And i realized that I liked it. I always uses gnome-do to start programs, guake to do terminal stuff, and some random method to see witch programs are open. For the latest problem i found that docky was the right solution. And then with autohide i didn't have to see anything of it when i do not use it. The best of all: It is fast. Very fast compared to gnome, or Cinnamon (maybe cinnamon is using gnome, i don't know).

Worth noting is that you need xcompmgr to enable compositing.



My desktop, showing docky and guake

I noticed that you need to make your own ~/.config/openbox/autostart.sh script. Here is mine


#För att starta effekter
xcompmgr -cfF -t-9 -l-11 -r9 -o.95 -D6 &

#För att knappar och sånt ska se ut som ambiance
gnome-settings-daemon &


#För att byta plats på copslock och escape
setxkbmap -option caps:escape &


gnome-panel &




And then you need the programs installed. To install them run this in your terminal

sudo apt-get install gnome-do xcompmgr gnome-panel docky guake
Now i hope this is the last time I ever have to write anything about my desktop configuration... Please write a comment if you have any thoughts about improving performance or usability

onsdag 20 februari 2013

Why I use Mint and not Unity

I just reinstalled my computer an had once again have to re-evaluate what desktop appearance I wanted. It was not a very easy choice to make.

I like the Idea of the Unity desktop, so I used it the first couple of days. However I could not stand the dash-launcher to take more than 2 seconds to start when I wanted a program. So I switched to Gnome-shell for a while (again, I hoped that the issues I had before would be gone). But Gnome-shell crashed all the time, so I tried Mint for the first time. And here I am.

I've noticed some people think of Mint being to slow, and using Unity because of that. Strange however that my experience is the opposite. Maybe that has to to do with what hardware you use, I do not know...

Mint running on my Ubuntu desktop

Here is how to install Mint on your Ubuntu computer :). The only thing to do is to run:

sudo apt-add-repository ppa:gwendal-lebihan-dev/cinnamon-stable

then

sudo apt-get install cinnamon

And you have Mint installed. It is only to change session next time you log in.

--Edit 2013-03-20--

I finaly realised Mint is to slow to. So it now seems like I am using openbox for a while

Remote desktop on my Raspberry Pi

Since I don't have a screen a hdmi-cable and no TV I've used to just acces my Pi from an ssh shell in my terminal. I don't have any practical use of accessing my raspberry visually, when all functionality I need can be used through the terminal. When I first started my Pi i disabled the X-system so it should not use unnecessary resources.

I did it anyway, just for fun. Here's how:

First i installed a vnc-server on the raspberry pi according to this tutorial (on my Raspberry Pi).
sudo apt-get install tightvncserver

Then to run the server i simpli ran
vncserver :1 -geometry 640x480 -depth 24

That was not according to the video but it worked anyway. It started a x-server on :1 with the given dimensions and a color depth of 24 bits. Now with the server up and running all I had to do was to connect to it from my laptop.

To get the ip-adress from my Pi i used ifconfig.

ifconfig

According to this link, the standard vnc-server for Ubuntu (that I use) is vinagre. So I installed it (on my desktop computer):

sudo apt-get install vinagre

And then start it. Configurations was quite self-explainatory. Here's how it looks

 And tataaaa! A running vnc-client on my desktop.