Posts

Showing posts with the label linux

The Ridiculous NTFS.3G and big file write

I started noticing this issue recently when I used Ubuntu to copy large files - anything more than 600-700MB. When the copy started, it would start with good speed of about 25-30 MB/S, but then after about 300MB it would slow down and soon go into single digits. Also System Monitor would show kswapd0 popping up and bogging one core so that system performance would take critical hit. This would happen only when the source/destination was ntfs partition. At first I thought kswapd0 to be the culprit since it was the one hogging the system. But after lots of google searches I found out ntfs.3g driver to be the culprit. What happens is that ntfs.3g driver - whatever version is available in kernel 4.4, allocates huge buffers and does not free them, so if you looked in top, you would see the buff/cache part of memory swelling to ridiculous sizes - in my case when copying 1GB file buff/cache swelled to 3.5GB (WTF!!!) from 500MB. Anyway after trying a number of solutions below one is the one th...

My thoughts about KDE Desktop and new Plasma shell

I have briefly used all KDE flavours from KDE 3.0 to 4.0 to latest plasma shell with KDE 5 series. But I could not get along with KDE for too long. I use it for few months and then get bored or just annoyed enough with the way many of the things are and hop to other distro.  My main gripes are below:  1. The themes and the overall widget animations: Animations are good and bright, catchy colors are good too - if used sparingly. But with KDE it's just too much. Every time I have used KDE I ended up disabling almost all animations, and switching to an easier on the eyes color theme. The various themes just don't look natural - they look like some snazzy designers dream. Rather take a look at the Mint themes, or Ubuntu themes - they are muted and not eye catchy. But that's something makes you forget about them and concentrate on the work. With KDE it's exactly opposite. The various colors, gradients, and changes keep grabbing at your focus. Add to that the various popups a...

How to enable SSH on Raspbian

Previously enabling raspbian, meant you have to boot to the card. Then enable and configure ssh service.  But with since 2016, there's a simple method. That is on the boot partition of your SD Card, create an empty file with name 'ssh' - without quotes - and when you boot from this SD Card, SSH services are auto-enabled. To create the file you can use following commands:  touch /media/user/boot/ssh sync Touch creates the file and sync ensures that it's written to the SD Card, flushing any pending write buffers for the SD Card. 

How to prepare an SD Card with Raspbian

I used Ubuntu for preparing the SD Card and it's really simple. You connect the SD Card using a card reader. If it's auto mounted, then un-mount it using sudo umount /dev/sdb1 assuming /dev/sdb is the SD Card with one partition. Next extract the Raspbian image from the ZIP file. Note, the zip file is about 1GB but the image is 4.4GB since it's compressed image.  Next use dd to put this image on the SD Card.  sudo dd bs=4M if=[image file path] of=/dev/sdb   This writes the image to the SD Card. Next pop the SD Card in the pi and power up! 

Raspberry Pi 3 Update - Raspbian working!!! Hurrah!!!

Image
So finally last night I spent some time plumbing the software stuff together and got Raspbian working on the Raspberry Pi 3 board. It needed some acrobatics but it did work. Below screenshot on my Ubuntu Laptop is the proof! J The setup:  Raspberry Pi 3 powered using Portronics 5v 2.3A power adapter connected to ethernet on  a Tenda N301 router. I don't have a HDMI display yet so I'm sort of using vnc for this. I'm using Raspbian on a 8GB SanDisk SD Card.  The things I had to do: 1. Prep SD Card with Raspbian - straight forward using standard instructions on Linux. - All OK. 2. Power up the Pi 3 and use ethernet to connect it to the Tenda. - All OK.   3. SSH to the Pi: Had to fumble a bit here but finally got around to it using a solution on Stackoverflow.com. - A bit iffy but Okayish. 4. VNC: Straight forward using inbuilt vncserver. Needed to install RealVNC client on Laptop. But then worked fine. - All OK with one download. And voilla I co...

Got the Raspberry Pi 3 Model B

Image
Update: Received Portronics 5V 2.3A power adapter and the case too on 9/1/2017. Got Raspberry Pi, Samsung Class 10 16GB sd card and a HDMI cable. Still waiting for the power adapter and pi case. Excited times ahead!!!

Git Proxy Settings

Command to use: git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080     change proxyuser to your proxy user     change proxypwd to your proxy password     change proxy.server.com to the URL of your proxy server     change 8080 to the proxy port configured on your proxy server If you decide at any time to reset this proxy and work without proxy: Command to use: git config --global --unset http.proxy Finally, to check the currently set proxy: git config --global --get http.proxy

A test of merging two big files in Linux

Update: "Beyond Compare" it is. Certainly for big files weighing in MBs it's the clear winner since meld just craaaaaawls. Unfortunately you get only 30 days of eval period with Beyond Compare and it's paid after that. But for anybody doing serious amount of compare and merge "Beyond Compare" may prove to e good investment. Otherwise for all us fellows who just occasionally merge things "Meld" it is! I contribute to Ubuntu Translations. Recently a curious thing happened. While going through some translations I noticed that there are some projects where upstream translations are available. But those are not yet imported in Ubuntu packages available on Launchpad. One such package was inkscape. When I checked the upstream website for inkscape I found that in trunk there's a translation available and there is a lot of work done. So I downloaded the po file from there and tried to upload it to Launchpad. Rosetta(Launchpad Translations Managem...

First try to port a Qt application to Sailfish

So last week I prepared v0.3 and put it to git. Yesterday I tried to port it to Sailfish as was the original plan. I went at it as below:  I used an existing test application to get the required files and project settings. I added them to my project. This part included copying various tidbits to the .pro file. Also included is copying over folders for RPM, translations, icons etc.  Then I went through the files and updated the file names wherever needed to reflect my app. This gave me a build which built successfully using the mer-arm toolchain. Now to get it running on the device. I plugged in the Aqua Fish to Laptop with microUSB cord, and enabled debugging. Then tried to debug-run the app. First problem - debug-run doesn't work. I got error as - gdbserver not found. On googling for this, found out I need gdbserver installed on device and it will probably take a while since I'm not familiar with this functionality of Sailfish. So I decided to skip debug-run, and go with only ...

Adventures trying to share Laptop/PC internet to Sailfish

Well, I got hold of a high speed USB Dongle which I could connect to my laptop/desktop. But I couldn't use it's internet with Aqua Fish. So I thought I would try to share the internet and see how it works out.  1. Make laptop WiFi hotspot - normally it's effortless with apps like Conenctify,but on this current laptop I don't have admin access. Which means I can't do this using windows. But I have Linux on this too. So I rebooted and googled about WiFi hotspot on Linux. Got some decent instructions too. But it wasn't working. So after changing the WiFi driver twice, following three different tutorials, and finally finding out that this laptop's WiFi doesn't have any driver that supports AP functionality, I was disappointed.  2. Try USB Reverse tether on Jolla: The instructions were there. But people threw a number of disclaimers so I thought my phone's brand new. Don't wanna break it so early. Which means this was also a no no.  3. Try USB tether ...

Intex aqua fish review

[Updates] --------------------------- 5-Oct: Just found out Sailfish doesn't support WPA Enterprise. So no office WiFi for me! Although it connects to plain WPA router. I checked this with my Tata DoCoMo WiFi dongle. --------------------------- Introduction Unboxing hardware The box looks good. Opening it you find a book like design which is delight to open. The box contains handset, 2500mAh battery, in ear type headphones, a power brick and a USB to micro-USB cable. It comes with an orange colored back plate which can be removed by lifting one corner. Intex has helpfully provided a sticker at the corner. The phone has quite a bit of footprint but is light in hand. Removing the backplate shows the dual Sim slots and the dedicated SD Card slot and battery slot. The battery is removable. But you need to remove the battery to insert SIM/SD cards. Display, connectivity, battery life The display is specified as an IPS HD display. It doesn't have any kind of glass pro...

Got Intex Aqua Fish!

Specs: Qualcomm Snapdragon 210 SOC 2 GB RAM | 16 GB ROM | Expandable Upto 32 GB Dual Standby SIM 2G/3G/4G connectivity 5 inch HD Display 8MP Primary Camera | 2MP Front 2500 mAh Li-Ion Battery Jolla Sailfish OS v2 Price:  Bought for 4499/- at Tata CliQ Online Store Will share detailed review soon.

Upgraded Ubuntu 12.04 to 14.04.5 and then 16.04

My desktop at office was stuck on 12.04 for last two years. Recently I got moved to another project and the then critical collection of software and tools on the desktop suddenly became non-critical. So I decided to upgrade it. For last two days I pushed it through two distro-upgrades. And it has survived them and I can now use latest 16.04 LTS. Ubuntu is great!!!

KDE Startup and AutoLogin

Image
Starting KDE from Command Line by startx By Zhiqiang Ma On Nov 29, 2012                 0 Keep updated Share on facebookFacebook Share on twitterTwitter Share on google_followGoogle Share on rssRSS I don't use xdm , gdm or kdm … I prefer my Linux booting to init 3 . I like logging in to the command-prompt and starting X manually with startx . In my Fedora Linux box, I always get to gnome even both gnome and KDE are installed. Actually the startx script is already written for most of the modern desktop environment. What we need to do is open the "trigger". The startx script in Fedora will read /etc/sysconfig/desktop for the "DESKTOP" variable (through /etc/X11/xinit/Xclients ) and starts the desktop environment depending on it. While the default value for "DESKTOP" is set to "GNOME" , we will get to gnome if we don't set the variable. When we want to startx to KDE we just need to add one line to /etc/sysconfig/desktop : DESK...

gSOAP on Linux and Windows

gsoap v2.7.16 ./configure su - make   make install Then into calc++ dir: soapcpp2 -i calc.h g++ -o calcclient++ calcclient.cpp ../../stdsoap2.cpp soapC.cpp soapcalcProxy.cpp g++ -o calcserver++ calcserver.cpp ../../stdsoap2.cpp soapC.cpp soapcalcService.cpp This compiles calc client app and calc server app. execute calcserver++ and after that execute calcclient as ./calcclient++ add 3 3 result = 6 Note: There's some delay observed. ---------------------------------------------------- with modifications to calc.h; calcclient.cpp and redoing all above steps from soapcpp2 -i calc.h; and running calcserver as #./calcserver++ 80 in one terminal and calcclient as $./calcclient++ add 5 6 gives correct output. So gsoap is working in Linux for both client and server. =========================================== Now to Windows *** using available binaries in C:\gsoap-2.7\gsoap\bin folder. Added soapcpp2 binary's path to PATH variable. Next using Visual Studio 2005 Command prompt; got to c...

A tryst with UDS Pt. 2

In Pt 1 we took a look at what is UDS. Lets see what it took me to integrate UDS with existing firmware. We got hold of readymade UDS library which contained partial implementation of UDS. So I had to import the C sources into existing firmware code. Then debug them. And integrate UDS transport layer with eCAN module. At the same time since we did not have any kind of tester available I ended up writing a small tester application in C++. This application would enable me to verify that the integration of UDS library is correct. One clever hack I did was get the integrated firmware running somewhat on desktop and then replaced eCAN code with VCAN code (Linux Virtual CAN - socketCAN ). This way I got rid of hardware dependency, or otherwise it would have taken me months to test everything. As it is with this desktop version I was able to speed up the integration and finished it up in about a fortnight. After I verified that the UDS transport layer is working fine and is indeed complete, I...

A tryst with UDS Pt 1

UDS stands for Unified Diagnostic Standard. It's a diagnostic standard used for Vehicle diagnostic and is part of both Autosar architecture and OBD(OnBoard Diagnostics). According to 7-layer ISO OSI networking stack, UDS application and transport layer is defined in ISO 14229 and 15765 documents. Integrating UDS in a firmware means you develop UDS transport and application layers over base transport layer like CAN/LIN/ FlexRay etc. The first part of all this is understanding UDS layers. Lets assume underlying transport is CAN bus. In UDS transport layer over CAN, ISO 15765 standard defines the CAN frame timing and structure. In ISO 14229, UDS application layer over CAN, the UDS services are defined. These are 30+ services that operate on request-response basis. The services are defined by a 1-byte identifier like 0x22 ReadIdentifierByID or 0x2E WriteIdentifierByID. A tyical UDS transaction looks like a request with service ID and respected data. To this request UDS server responds ...

Weird problem with Linux Mint - probably memory leak

I am back from a big vacation and so got tons of photos. While viewing them on mg laptop I saw some slowdowns after a while - usually after an hour of photo viewing. This was observed on Linux mint. On windows 10 there was no such problem. So I looked around and the system manager showed huge memory taken by cinnamon. I logged out and relogged in, and it would clean it up but after half an hour again we would be going back to the sluggish state. This has me irritated and I'm thinking  about changing back to Ubuntu. Let's see.

sudo apt-get remove linux-image-3.13.0-4*

Image
*update: It worked!!! In a hurry to remove multiple old linux kernel versions from my system I popped in above command. After a while I came back to the terminal to find all my kernels were un-installed!!! :J Well, thankfully I noticed what has happened and right away reinstalled the latest one with this command: sudo apt-get install linux-image-3.13.0-62-generic. Haven't rebooted yet. Let see!

Qt global thread pool max thread count

Recently I encountered that some threads are not launching in our application using QConcurrentRun. If you launched the same worker function over QThread it was working.   So digging into this gave us this problem with defaults for Qt's global threadpool. Basically Qt sets global threadpool's max thread count to the no of cores you have on your processor. We were easily running out of the default four max threads. So we upped the count to 32 using following function:  QThreadPool::globalInstance()->setMaxThreadCount(32); We set this at start of the program in main. Things have been fine since then!