Guide

Prey!

I feel a bit bad for not have been writing this earlier - but in Sweden we have a saying: "Bättre sent än aldrig", which translates to something like "It's better to be late then never do it."

Anyway, I'd like to represent to you: Prey!

Prey is a must have application on every and all of your electronic devices. Do you have a tablet, computer (desktop or laptop) or a phone (one of them or all, no matter), you should absolutely have this installed and configured!

It is an application that will help you if the unspeakable would happend: you're device gets stolen or lost. If that would happend, you can easly login on Prey's website and set your device to missing and then it'll start sending reports back to the Prey Dashboard, which includes, position data, (in some cases) pictures, Facebook accounts that the "new" user uses and much, much more stuff. Data that you could give to the authorities! Data that will help you get your device back!

The installation varies from Android, to iPhone, from Linux, to Windows, to Mac OS X, but it pretty alike and very easy and straight forward.

  • Install the application on your device.
  • Follow the installation instructions.
  • Confirm your account.
  • Finalize the device settings on your Prey Dashboard.
  • Add another device (up to three for free).

Now you are good to go! Which in Prey's case is nothing more. You won't have to do anything more (unless you're device get lost). Prey just sits in the background and doesn't at all give itself up.

What are you waiting for?! Install it!

http://preyproject.com/

The first 10 things I do when I get a new Android phone.

I just got my Samsung Galaxy SIII today and have been playing around with it, and setting it up for a few hours now. I thought that I would share how I like to get a new phone running.

  1. Login to my Google Account so that I can get my WLAN key.
  2. Access my WLAN using the key.
  3. Set up audio and display settings along with security settings.
  4. Installing Firefox from Google Play and ownCloud client from apk.
    (Set up Firefox Sync and login to ownCloud)
  5. Remove some of the bloatware.
  6. Install the rest of the applications that I need, and want.
    Prey(!), Ultimate Guitar Tab, Google Reader, Wunderlist, bank app, Wikipedia, transit app, ConnectBot, Fing, Scrobbler, and much more.
  7. Setting up all my other accounts (e-mail, calendar, Twitter, and so on).
  8. Set up Prey!
  9. Root!
  10. Remove the rest of the bloat and apply some nice tweaks.

Gör din egna laddare till en Asus TF101.

Laddaren till min Asus TF101 Android-tablet gick sönder och jag hade ingen lust att kosta på pengar för en ny, när man kan göra en egen mycket billigare och snabbare.

Jag gick därmed till Clas Ohlson och köpte en spänningsomvandlare (aka. universalladdare eller batterieliminator) och en USB-kabel med en hona i ena änden (datakabeln till taben var fortfarande hel), sedan satte jag helt enkelt ihop dem.

Taben behöver minst 11V för att ladda (räcker alltså inte med en vanlig USB-port), så det man ska söka efter i butiken är en laddare med en ut-spänning på minst 11V. Det är i princip det du ska leta efter. Jag köpte denna: http://www.clasohlson.com/se/Batterieliminator-20-W/Pr364219000

Denna spänningsomvandlare kostade 149 kr och hade en ut-spänning på 13,5V/1,5A, vilket var perfekt!

Skalade sedan kablarna för både spänningsomvandlaren och USB-kabeln och kopplade ihop dem med varandra. I USB-kabeln ska du använda den vita/svarta och röda kabeln (minus, resp. plus). I spänningsomvandlaren finns bara plus och minus, så du kopplar bara ihop den metallen som är runt den vita kabeln i den skalade kabeln med minus på USB-kabeln, och den vita kabeln (som är plus) med röd i USB-kabeln.

Sedan lödar du fast dem, och skyddar metallen för att komma i kontakt med varandra.

Ställ in spänningsadaptern att ge högsta spänning.

Klart!

Ta bort program installerat från källkod.

Ibland blir man tvungen/sugen, att installera ett program/bibliotek från dess direkta källkod - det hela är oftast rätt enkelt (förutsatt att du har alla beroenden) och så är det färdigt.

Att installera är oftast det som man är intresserad av, men ibland måste man faktiskt ta bort det man har installerat, och det är här som det ibland kan bli lite knepigt.

Det är nämnligen så att man ibland glömmer/hoppar över att lägga till en "uninstall"-regel i make, vilket då resulterar i att du är rätt fast. Du kan ta bort filerna för hand, men det är ofta bökigt.

Istället kan du använda dig av Checkinstall - som egentligen är ett strålande verktyg för att skapa kompletta installerbara paket för ditt system (kan användas på andras datorer med).
Med hjälp av detta kan du även ta bort det som du har installerat:

1. Gå in i den mappen som du har byggt källkoden i.

2. Kör $ checkinstall och följ instruktionerna.

3. När det är klart så kör du bara:
$ sudo dpkg -r <paketnamnet>

<paketnamnet> är oftast namnet på mappen som du körde checkinstall i, och dpkg -r står i slutet av processen.

Nu är allt borta.

Läs mer om checkinstall i ett gammalt inlägg: http://www.danielholm.se/dagens-kommando-checkinstall

Set up OpenWRT to connect and use a PPTP VPN.

Running Linux on a router is just like magic, wouldn't you agree? If not - try it!

The other day I wanted to set up a VPN connection for some of my devices at home. And since I only could have one device connected at the time, I figured it would be simpler to connect my router and then have the VPN connected on any of my connected devices at home.

I run OpenWRT on my TP-Link WR1043ND and i found it to be really easy to set up a VPN connection, and use it to tunnel all of the data by default. Here's how:

(To begin with, you need a router running OpenWRT, a VPN account somewhere (your own server, IPredator, whatever) that has support for PPTP, and access to your router.)

  1. Login to your router.
  2. Click System > Software > Update lists.
  3. Press "Avaliable packages" and search for PPTP.
  4. Install these packages: (you might have to do the search again in avaliable packages, for each package)
    luci-proto-pptp, kmod-pptp and pptp
  5. Once these packages are installed, move on to Network and click "Add new interface".
  6. Give it a name, perhaps the name of the service.
    Set the protocol to PPtP and click Submit.
  7. Fill in the form using the info and credentials from your VPN service. Then press Save.
  8. It is a good idea to let the VPN connection to be set up immediately, so set it to connect during book in Advanced settings. Save.
  9. The new VPN interface should now connect itself, but there is still one thing left to do: add it to a Firewall Zone.
    Editing your VPN interface, click on Firewall Settings and add it to WAN.
  10. Surf! To doubble check if the connection is working you could try a site like this one: ipaddresslocation.org

3G modem not re-connecting in OpenWRT?

Since I reflashed my router (TP-Link WR1043ND) I found out that I didn't have to use my own usb_serial script to get my Huwaei E182e modem to work in OpenWRT (still running RC5) - it just worked out of the box!

The thing was though, that the modem sometimes would disconnect, and would not re-connect using "ifup wan" anymore. After authentication, the modem would hangup and I had to reboot the whole router - which could get rather irritating.

Today, I gave myself time to explore this issue, instead of using a ping script that rebooted the router if not answering, and I found this thread:
https://forum.openwrt.org/viewtopic.php?pid=159749#p159749

The user, mforkel had a solution that I think would resolve my issue (I'm actually posting this before I've tried it, since I'm not at home at the moment).

  1. Logon to your router using SSH or Telnet.
  2. Edit /etc/config/network. eg:
    $ nano /etc/config/network
  3. Now locate the wan interface, which is using your modem:
    config 'interface' 'wan'
            option 'ifname' 'ppp0'
            option 'proto' '3g'
            option 'service' 'umts'
            option 'apn' 'data.cell.com'
            option 'pincode' '1234'
            option 'device' '/dev/ttyUSB0'
            option 'username' 'danielholm'
            option 'password' 'inspire;)'
  4. Now add this row:
    option 'pppd_options' 'debug noipdefault'
  5. Save and reboot. Good to go!

Dagens Kommando: Hantera skärmar enkelt med Disper Indicator.

För ett par år sedan skrev jag om Disper, som jag använde för att få igång min HDMI port på min gamla laptop, och hur man enkelt kunde hoppa mellan skärmar med ett skript jag skrev som använde Disper: Enkelt skärmbyte med Disper + ett tillhörande skript.

Sedan dess har Ubuntu lagt på sig en hel del sk. Indicator applets, och tanken slog mig att jag skulle vilja hoppa mellan skärmar igenom att ha en sådan applet. Men man ska gärna inte återuppfinna hjulet, därför tog jag mig en titt på the internets och fann att det, inte helt oväntat, fanns. Och vet ni vad? Den använder Disper.
Not: Initalt användes bara Disper dör nVidia-kort. Det ska dock funka på flera kort och det funkar med min Intel-grafik.
Såhär lägger du till den:

Vi behöver lägga till två PPAs (förråd) och sedan installera två paket:

$ sudo add-apt-repository ppa:disper-dev/ppa
$ sudo add-apt-repository ppa:nmellegard/disper-indicator-ppa

$ sudo apt-get update
$ sudo apt-get install disper disper-indicator

Kör nu Disper Indicator och där är den nu i indicatorfältet.

Thanks to Ubuntu Vibes for the info!

Howto: Re-connect 3G modem automatically using Cron.

I love GNU/Linux and what you could to with it - run it almost everywhere. I'm running GNU/Linux on my router (OpenWRT), which has a USB port and connected to it, a 3G modem.
Using that I share my internet connection with all my devices and it works great - except when it disconnects by itself.

Thats why I wanted to create a simple script that Cron could run and get the connection up again, without me having to do it, or even be at home.

Here's how you do it!
( I want to thank Ubot @ Ubuntu-se.org forums for the help )

This scipt pings Google four (4) times, and if it recives less then four of the pings (or, most probably: none) it re-connects the interface.
My interface' name is wan and I'm using the command ifup to get the interface back up. You should edit this based on your own system.

Copy the text below into a text document - its the script that we'll use:

#!/bin/sh
# 111204 - Daniel Holm <admin@danielholm.se>

# Ping set host too see if there is an internet connection or not. If not, do command
count=$(ping -c 4 google.se | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')

if [ "$count" != "4" ]; then
        # 100% failed
        echo "Connection down, setting up."
        ifup wan
else
        echo "Already up."
fi

exit 0

After that, save the file and add a new row to Cron.

If you, like me, are adding this to a router, or alike, and are just using the command line, here's how you do it: (as root)

  1. Create the file you'll be using:
    $ touch check-if.sh
  2. Edit the file and paste the script's code from above:
    $ nano check-if.sh
  3. Now make it executable:
    $ chmod +x check-if.sh
  4. We'll be adding it to Cron using crontab and it'll be run on the hour, every hour:
    $ crontab -e
    Add this row:
    0 */1 * * * /root/./check-if.sh
  5. Enjoy!

 

EDIT: Updated script coming up!

Multimediaknappar och Notifiering till Spotify i Ubuntu.

Spotify LinuxJag kör numera med bara Spotify på både mobil och på datorn (i Ubuntu) - tycker att deras Linux Preview funkar riktigt bra. Med nyare Ubuntu så finns även support för ljudmenyn så att man kan byta låt eller pausa i såväl Spotify som Banshee eller dyl. Däremot saknas support för multimediaknapparna och att man faktiskt inte får någon notifiering vid låtskifte - så nu fixar vi det!

Det enda som behövs är faktiskt ett pythonskript (och ett python-paket för notifiering, men den torde vara installerad som standard) Spotify-Notify.

  1. Ladda ned senaste versionen av Spotify-Notify här: http://code.google.com/p/spotify-notify/
  2. Packa upp mappen innehållande pythonskriptet och en ikon till valfri plats. Jag packade upp till Program i min hemmapp.
  3. Spotify-Notify startar automatiskt Spotify om det inte redan körs, och eftersom jag vill att multimediaknapparna och notifierin ska fungera utan att behöva göra mer än att bara starta Spotify, så redigerar vi startfilen så att det kör skriptet istället för Spotify, så startar skripet i sin tur Spotify.
    Öppna en terminal och kör dessa två kommandon: (det ena gör en backup av startfilen, sen öppnar vi den riktiga för redigering)
    $ sudo cp /usr/share/applications/spotify.desktop /usr/share/applications/spotify.desktop.bak
    $ sudo nano /usr/share/applications/spotify.desktop
  4. Redigera där raden "Exec" på detta vis:
    Ifrån: Exec=spotify
    Till: Exec=/home/namn/Program/spotify-notify/spotify-notify.py
  5. Ifall du har Spotify igång, stäng det. Annars så testar du nu att starta det på normalt sätt.
    Nu ska det funka att använda datorns multimediaknappar och dessutom få en notifiering för vilken låt som spelas.

Guide: Google integration i Mozilla Thunderbird (7).

Thunderbird iconUbuntu har tagit steget ifrån GNOMEs tidigare trotjänare Evolution som mailklient, och istället bytt till Mozilla Thunderbird.
Det finns givetvis både för- och nackdelar och lika perspektiv. Tex. så finns det bättre standardstöd för det mesta i Evolution, medan det inte är lika modulärt. Å andra sidan finns det saker som är lättare med Thunderbird (som att lägga till sin GMail) och att det är just modulärt med något tusental av tillägg.

I denna lilla guide vill jag berätta och vägleda er hur ni får igång er Gmail i Thunderbird, med integration.
Jag kör för tillfället Ubuntu 11.10 och Thunderbird 7, men använde mig av precis samma tillägg och tillvägagångsätt som i Ubuntu 11.04 och Thunderbird 3.

Du behöver en webbläsare och Thunderbird installerat.

Gmail:

  1. I Thunderbird - om du inte har startat det och lagt till ett konto innan - klicka på Arkiv -> Nytt -> Nytt E-postkonto.
  2. Följ instruktionerna och fyll helt enkelt i, bla., din mail. Thunderbird ställer automatiskt in alla inställningar för Gmail.
    Tips: Använd IMAP. Om du inte redan gjort det; gå in i Gmail inställningarna och aktivera det.
  3. Klicka på Skapa konto.
    Klart!

Google Calendar:

  1. Ladda ner tillägget för Thunderbird: Provider for Google Calendar
    Välj att Spara till disk.
  2. Gå in i Tillägg i Thunderbird, klicka på verktygsikonen och välj att installera ifrån fil. Välj då nedladdad fil ifrån förra steget.
  3. Gå in på Google Calendar via din webbläsare.
  4. Inställningar för kalender -> Kalendrar-fliken
  5. Välj kalendern du vill använda.
  6. Klicka på XML för aktuell kalender och spara den länken till den via kopiera.
  7. Tillbaka till Thunderbird; Arkiv -> Nytt -> Calender.
  8. Välj att kalendern är på nätverket, klicka i Google och klistra in adressen du precis kopierade.
  9. Klicka på nästa så kommer en inloggningsruta upp (om du valde den privata XML-länken) - fyll i ditt lösenord.
  10. Välj ett namn på din nya kalender (och färg).
    Obs! Ifall du klickat i att få alarm så kommer i princip alla dina alarm som du har i kalendern att dyka upp i ett fönster. Den kommer att ticka ned och du kan klicka på Dissmiss all en gång och sedan OK på felmeddelandet när väl den listan är tömd.

Mer hjälp för Google Calender pluginet finner du här: https://wiki.mozilla.org/Calendar:GDATA_Provider

Google Contacts

För Thunderbird 7 finns ingen stabil utgåva ännu, utan då får man köra en beta, som jag fann här:
http://hogi.sakura.ne.jp/xpi/gmcont0637b2_TB3.1.x-7.x.xpi

I andra fall återfinns den stabila utgåvan här: https://addons.mozilla.org/en-US/thunderbird/addon/google-contacts/

  1. Spara filen.
  2. Gå in i tillägg i Thunderbird, klicka på verktygsikonen och välj att installera ifrån fil.
  3. Välj filen som du nyss laddade ned.
  4. Bekräfta och Installera tillägget
  5. Starta sedan om Thunderbird så kommer alla adressböcker för de Googlekonton som du angett, att bli tillagda i Thunderbirds adressbok.

Sidor

Subscribe to Guide