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