Pages

Wednesday, 6 April 2016

Kobo Glo HD memory upgrade on Linux

Received my reader today and couldn't wait to upgrade memory and load all my stuff. Well tutorials which I saw were all for windows. I foung in gparted that my Kobo card in SD reader is SDE and 32GB card in USB reader is SDD. So I just used below command:

sudo dd if=/dev/sde of=/dev/sdd

7744512+0 read records
7744512+0 written records
copied 3965190144 bytes (4.0 GB), 3042.42 s, 1.3 MB/s


It took about 1 hour but worked ok, ereader booted and everything works so far. 29 GB left for my library. 
You can use sudo nmon to monitor activity.




#koboglohd #memoryupgrade

Sunday, 6 December 2015

SDR Realtek RTL2832U from Aliexpress

Installation Packages



Before we begin installing our decoding radio software we will need to install the following components. Simply issue the following command from the command line:

sudo apt-get install git cmake libboost-all-dev libusb-1.0-0-dev python-scitools portaudio19-dev -y



gqrx - Software Defined Radio



"gqrx" is a Software Defined Radio that supports a wide range of devices. In this example we will be using the low cost RTL2832U based DVB-T dongles.

gqrx has the following features:


  • Discover devices attached to the computer.
  • Process I/Q data from the supported devices.
  • Change frequency, gain and apply various corrections (frequency, I/Q balance).
  • AM, SSB, FM-N and FM-W (mono and stereo) demodulators.
  • Special FM mode for NOAA APT.
  • Variable band pass filter.
  • AGC, squelch and noise blankers.
  • FFT plot and waterfall.
  • Record and playback audio to / from WAV file.
  • Spectrum analyzer mode where all signal processing is disabled

Installing gqrx



To install "gqrx" we need to add a "ppa" (Personal Package Archive) to our system. To do this we simply issue the following commands:

sudo add-apt-repository ppa:gqrx/releases
sudo apt-get update
sudo apt-get install 
gqrx-sdr

Once the relevant packages/software have been installed, you now insert your USB dongle. You can run a quick test to confirm that your system can see the USB device. Issue the command :

rtl_test -t

If you see the statement "Kernel driver is active, or device is claimed by second instance of librtlsdr", then don't panic, simply issue the command:

sudo modprobe -r dvb_usb_rtl28xxu

Basically the newer kernel that comes with Ubuntu already contains a DVB driver, however, we do not want to use this. The above "modprobe -r" command unloads this from the kernel, however for a permanent solution you will need to create the following file:



$ cd /etc/modprobe.d/
$ vi ban-rtl.conf

Now add the following line:


blacklist dvb_usb_rtl28xxu

Save your changes.  This change will come into effect when the system is re-booted. The name of the ".conf" file is not important as long as the file ends with ".conf". 



The command  rtl_test -t should give similar output:

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6 
Sampling at 2048000 S/s.
No E4000 tuner found, aborting.
From the above we can see that our USB dongle has been recognised. (Found Rafael Micro R820T tuner)

Starting gqrx - Software Defined Radio

To start "gqrx" simply type gqrx at the command line. Hopefully now you should see a screen similar to the one below:

Wednesday, 26 August 2015

Radio Tray elementary os fix

To Install type this in the terminal:
sudo apt-get install radiotray

Then go to:
gedit /usr/lib/python2.7/dist-packages/radiotray/SysTray.py

Now find this line: gtk.gdk.threads_init()

Comment it with a pound sign in front of it:
# gtk.gdk.threads_init()

Save it and open it from the apps drawer.

Wednesday, 15 October 2014

Wifi and LAN at the same time - force using wifi to access internet

In order to play music from my NAS connected to router I must be connected to the same network. But I want to use wifi to browse internet on faster connection from different network. By default with wifi connected and lan cable simultaneously my elementary os was using lan network for all trafic.

Below command switched it to wifi:

sudo ip route replace default via 192.168.1.1 dev wlan0 proto static

IP 192.168.1.1 is the gateway from wifi network.

Saturday, 4 October 2014

Undelete files on Linux

I accidentally deleted pictures from SD Card from my tablet. Any android undelete applications failed to identify what I was looking for. I decided to try undelete on my elementary os and the choice was to use PhotoRec. That program recovers lost files by checking data blocks one by one against a signature database of different file types.


  • Supported file formats: video (avi, mov, mp3, mp4, mpg), image (jpg, gif, png), audio (mp3, ogg), document (doc(x), ppt(x), xls(x), html), archive (gz, zip) etc.
  • Supported file systems: EXT2, EXT3, EXT4, HFS+, FAT, NTFS, exFAT
Took most recent version:


For 32-bit Linux:

wget http://www.cgsecurity.org/testdisk-7.0-WIP.linux26.tar.bz2
tar xvfvj testdisk-7.0-WIP.linux26.tar.bz2

For 64-bit Linux:

wget http://www.cgsecurity.org/testdisk-7.0-WIP.linux26-x86_64.tar.bz2
tar xvfvj testdisk-7.0-WIP.linux26-x86_64.tar.bz2

The PhotoRec executable (photorec_static) is found in the extracted directory.

cd testdisk-7.0-WIP/
sudo ./photorec_static 

Next I selected default options. Next challenge was to find pictures that I was looking for among over 50 000 recovered files in multiple subfolders. Most of them were cached browser images and any android stuff. My pictures were large, more than 4 MB. I used find command to copy qualified files to another folder:

find . -type f -size +4M -name "*.jpg" -exec cp {} /home/lukasz/Downloads/testdisk-7.0-WIP/Recovered/Large \;

Finally all my files were in Large folder.





Monday, 29 September 2014

Elementary OS messed up resolution on logon screen

After connecting secondary monitor to my laptop the login screen looks like it lost display settings and got resolution changed. I was having trouble finding solution, following is what worked for me:


1. In terminal run xrandr -q to check monitor details.

Laptop display: LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 293mm x 164mm

External monitor: VGA1 connected 1280x1024+1366+33 (normal left inverted right x axis y axis) 376mm x 301mm

2. Create script txt file eg. loginScreenFix.sh with following content:

#!/bin/sh
xrandr --output LVDS1 --primary --mode 1366x768

3. Make it executable with: chmod a+rx loginScreenFix.sh

Can run it to test if worked but resolution should be changed to see difference

4. Copy this to shared folder:

sudo cp loginScreenFix.sh /usr/share/

5. To run it on logon screen I updated lightdm config:

sudo gedit /etc/lightdm/lightdm.conf

Add my fix script path at the end:

display-fix-script=/usr/share/loginScreenFix.sh

6. Reboot to check if it worked.