uShare UPnP Media Server

http://ushare.geexbox.org/

http://ubuntuforums.org/archive/index.php/t-165288.html

http://cotton5415.wordpress.com/2007/07/05/upnp-av-media-server-on-ubuntu/

taisto@edubuntu:~$ cd /home/taisto/Videoita/Twonkymedia
taisto@edubuntu:~/Videoita/Twonkymedia$ sudo route add -net 10.0.0.0 netmask 255.0.0.0 dev eth0
[sudo] password for taisto:
taisto@edubuntu:~/Videoita/Twonkymedia$ sudo ushare -c ./ -i eth0uShare (version 1.0), a lightweight UPnP Media Server.
Benjamin Zores (C) 2005-2007, for GeeXboX Team.
See http://ushare.geexbox.org/ for updates.
Initializing UPnP subsystem …
UPnP MediaServer listening on 10.0.0.1:49152
Sending UPnP advertisement for device …
Listening for control point connections …
Building Metadata List …
Looking for files in content directory : ./
Found 561 files and subdirectories.

Virtualbox ja USB

By default, USB support doesn’t work in Gutsy even if you download the latest and greatest here.

To remedy this:

  1. alt+f2, gksudo gedit /etc/init.d/mountdevsubfs.sh
  2. Look for the part about magic and make it say this:
  3. #
    # Magic to make /proc/bus/usb work
    #
    mkdir -p /dev/bus/usb/.usbfs
    domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
    ln -s .usbfs/devices /dev/bus/usb/devices
    mount --rbind /dev/bus/usb /proc/bus/usb

  4. Save the file and run the script via alt+f2, gksudo /etc/init.d/mountdevsubfs.sh
  5. Restart VirtualBox and bask in the glory of a USB icon under Settings for your virtual machine

Globesurfer Icon / Ubuntu Gutsy

taisto@edubuntu:~/Asennuspaketit/umtsmon-0.7$ lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 004: ID 05c6:1000 Qualcomm, Inc.
Bus 001 Device 003: ID 05d8:4003 Ultima Electronics Corp. Artec E+ 48U
Bus 001 Device 001: ID 0000:0000
taisto@edubuntu:~/Asennuspaketit/umtsmon-0.7$ sudo ./icon_switch

* icon_switch: tool for changing USB mode of Option Icon 3G+ box
* (C) Josua Dietze 2006
* Works with libusb 0.1.12 and probably other versions

Looking for Option Icon USB 3G+ box …
Found box in storage mode. Preparing for switching …
Looking for active storage driver …
OK, driver found (”usb-storage”), attempting to detach it …
OK, driver “usb-storage” successfully detached
icon_switch: icon_switch.c:126: main: Assertion `ret == 0′ failed.
Device change command returned error -19Aborted (core dumped)
taisto@edubuntu:~/Asennuspaketit/umtsmon-0.7$ lsusb
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 005: ID 0af0:6600 Option
Bus 001 Device 003: ID 05d8:4003 Ultima Electronics Corp. Artec E+ 48U
Bus 001 Device 001: ID 0000:0000
taisto@edubuntu:~/Asennuspaketit/umtsmon-0.7$ ./umtsmon
X Error: BadDevice, invalid or uninitialized input device 178
Major opcode:  147
Minor opcode:  3
Resource id:  0×0
Failed to open device
X Error: BadDevice, invalid or uninitialized input device 178
Major opcode:  147
Minor opcode:  3
Resource id:  0×0
Failed to open device
umtsmon version 0.7 .
installing GUI SIGABRT handler
##P1 t=247: binary ‘/sbin/pccardctl’ is not SUID -> needs fixing
##P1 t=247: binary ‘./icon_switch’ is not SUID -> needs fixing

Artec e48u+ skannerin asennus Ubuntu Gutsyyn

Tämä olikin helppoa:

  1. Tiedoston /etc/sane.d/artec_eplus48u.conf mukaan skannerin firmware tiedosto pitää olla kansiossa

    /usr/share/sane/artec_eplus48u/Artec48.usb

  2. Tee kansio:

    sudo mkdir /usr/share/sane/artec_eplus48u

  3. Kopioi tiedosto ko. kansioon:

    sudo cp /home/taisto/Artec48.usb /usr/share/sane/artec_eplus48u/Artec48.usb

NUT

Network UPS Tools (NUT) on Ubuntu

September 25th, 2006

NUT is a handy system for monitoring almost any UPS. Unfortunately the configuration process is tweaky and the included documentation is minimal and cryptic.

Here is a process that worked for me:

(Adapted from Engadget)

Open the Synaptic Package Manager (under the System->Administration menu) and search for ‘nut’. Select the package for installation and click on Apply.
Now log in as the superuser, then create and edit five configuration files:

sudo su

1: /etc/default/nut

nano /etc/default/nut

Change this:

# start upsd
START_UPSD=no

# start upsmon
START_UPSMON=no
to this:

# start upsd
START_UPSD=yes

# start upsmon
START_UPSMON=yes
(Ctrl-x, then y to exit and save)

2: /etc/nut/ups.conf

nano /etc/nut/ups.conf

The configuration is pretty simple. Check the compatibility list to find out what driver/upstype to specify. For my APC SmartUPS, I used the apcsmart driver, and serial port ttyS0:

[ups1]
driver=apcsmart
port=/dev/ttyS0

(Ctrl-x, then y to exit and save)
to test:

upsdrvctl start

I got this message:

Unable to open /dev/ttyS0: Permission denied

Current user id: nut (120)
Serial port owner: root (0)
Serial port group: dialout (20)
Mode of port: 0660

To resolve it permanently, a quick workaround is to add nut to the dialout group in Users and Groups (under the System->Administration menu).

Now test again:

upsdrvctl start

and I got:

Detected SMART-UPS 1000 [WS9730021313] on /dev/ttyS0

now stop upsdrvctl:

upsdrvctl stop

Done with that!

3: /etc/nut/upsd.conf

nano /etc/nut/upsd.conf

If you want to allow your local network, put in the network address (i.e. 10.0.1.0/24)

ACL all 0.0.0.0/0ACL remote 10.0.1.0/24

ACL localhost 127.0.0.1/32ACCEPT localhost

ACCEPT remote

REJECT all

(Ctrl-x, then y to exit and save)

4: /etc/nut/upsd.users

nano /etc/nut/upsd.users

Add the following:

[monuser]

password = changeme

allowfrom = local

upsmon master

(replace changeme with a good password)

5: /etc/nut/upsmon.conf

nano /etc/nut/upsmon.conf

Add the following:

MONITOR ups1@localhost 1 monuser changeme master
SHUTDOWNCMD "/sbin/shutdown -h +0"

(replace changeme with the good password you used in step 4)

Now start the service:

 /etc/init.d/nut start

and test the settings:

upsc ups1@localhost

You should get a slew of readings and settings from the ups:

battery.alarm.threshold: 0
battery.charge: 100.0
battery.charge.restart: 00
battery.date: 07/24/97
battery.packs: 000
battery.runtime: 2640
battery.runtime.low: 120
battery.voltage: 27.74
battery.voltage.nominal: 024
driver.name: apcsmart
driver.parameter.port: /dev/ttyS0
driver.version: 2.0.3
driver.version.internal: 1.99.7
input.frequency: 60.00
input.quality: FF
input.sensitivity: H
input.transfer.high: 132
input.transfer.low: 103
input.transfer.reason: S
input.voltage: 119.6
input.voltage.maximum: 120.2
input.voltage.minimum: 119.6
output.voltage: 119.6
output.voltage.target.battery: 115
ups.delay.shutdown: 020
ups.delay.start: 000
ups.firmware: 60.9.D
ups.id: UPS_IDEN
ups.load: 033.2
ups.mfr: APC
ups.mfr.date: 07/24/97
ups.model: SMART-UPS 1000
ups.serial: WS9730021313
ups.status: OL
ups.temperature: 029.7
ups.test.interval: 0
ups.test.result: NO
root@ubuntusrv:/etc# upsc ups1@localhost
battery.alarm.threshold: 0
battery.charge: 100.0
battery.charge.restart: 00
battery.date: 07/24/97
battery.packs: 000
battery.runtime: 2700
battery.runtime.low: 120
battery.voltage: 27.74
battery.voltage.nominal: 024
driver.name: apcsmart
driver.parameter.port: /dev/ttyS0
driver.version: 2.0.3
driver.version.internal: 1.99.7
input.frequency: 60.00
input.quality: FF
input.sensitivity: H
input.transfer.high: 132
input.transfer.low: 103
input.transfer.reason: S
input.voltage: 120.2
input.voltage.maximum: 120.2
input.voltage.minimum: 119.6
output.voltage: 120.2
output.voltage.target.battery: 115
ups.delay.shutdown: 020
ups.delay.start: 000
ups.firmware: 60.9.D
ups.id: UPS_IDEN
ups.load: 033.2
ups.mfr: APC
ups.mfr.date: 07/24/97
ups.model: SMART-UPS 1000
ups.serial: WS9730021313
ups.status: OL
ups.temperature: 029.7
ups.test.interval: 0
ups.test.result: NO

Another test: Push and hold the test button on the smartups, or briefly unplug the ups from the wall. You should see messages pop up in the terminal window:

Broadcast Message from nut@ubuntusrv
(somewhere) at 13:58 …

UPS ups1@localhost on battery

Broadcast Message from nut@ubuntusrv
(somewhere) at 13:58 …

UPS ups1@localhost on line power

It is working!

To add a windows client, download and install WinNUT.

At the configuration tool,you can leave everything at the defaults. All you need to do is edit the configuration file. (Click the Edit button to the right of the Configuration File Path).

Enter the same line as in upsmon.conf, changing localhost to the actual IP address of the ubuntu machine, and use ’slave’ instead of ‘master’:

MONITOR ups1@10.0.1.105 1 monuser changeme slave

(replace changeme with the good password you used in step 4)

You should be good to go.

Viallisen levyn korvaaminen Linux softaraidissa

  1. Varmista että vanha levy on REMOVED tilassa:

    sudo mdadm -d /dev/md2
  2. Asenna uusi levy fyysisesti.
  3. Kopioi vanhan (vastaavan)  levyn osiotaulu uudelle esimerkiksi livecd avulla:

    sudo sfdisk /dev/sdb > osiot

    sudo sfdisk /dev/sda < osiot

  4. Lisää levyn osiot uudelleenkäynnistyksen jälkeen

    sudo mdadm -a /dev/md0 /dev/sda1
    sudo mdadm -a /dev/md1 /dev/sda2
    sudo mdadm -a /dev/md2 /dev/sda3

  5. Uudelleensynkronointi alkaa automaattisesti

Flash streamin kaappaus FFMPEG ohjelmalla

mplayer -dumpstream http://195.248.86.140/areena_fi/81/84/818496_638193.wmv -dumpfile testifile.wmv

Grub asennus Linuxin softaraidia käytettäessä

To fix a non-bootable system and ensure GRUB is installed on both drives, manually install GRUB as follows:

  • Reboot the server from the original Ubuntu Server CDROM
  • From the Ubuntu boot menu, select “Rescue a broken system”
  • Continue through the prompts until the screen “Device to use as a root file system” appears
  • Press Alt-F2 to switch to a second console screen then press Enter to activate it.
  • Mount the md0 RAID device and use chroot and grub to install the bootloader onto both sda and sdb using the following commands

mount /dev/md0 /mnt
chroot /mnt
grub
device (hd0) /dev/sda
root (hd0,0)
setup (hd0)
device (hd1) /dev/sdb
root (hd1,0)
setup (hd1)
quit

(many thanks to BigDiver for the above)

  • Reboot the system with command “shutdown -r now”, remove the CDROM and allow the system to boot from the hard drive.

VLC scripti Topfieldin .rec-tiedostojen muunnokseen

/usr/bin/vlc -vvv /home/taisto/test_in.rec –sub-track=1 –sout=”#transcode{vcodec=mp2v,vb=3072,acodec=mpga,ab=128,soverlay}:standard{dst=/home/taisto/muunnettu11.mpg,access=file}”