Monday, December 24, 2018

low cost desktops for billing counter etc

An idea for low cost desktops for applications like billing counter etc - Found this,
https://eltechs.com/product/exagear-desktop/
for running Windows software on the Pi.

Cost of full fledged Pi system would be < Rs. 4000 including software and HDMI to VGA convertor which would enable use of old monitors.

Sunday, December 23, 2018

building Matlab-like gui programs on GNU Octave

I did not know about the gui capabilities of Octave - some old gui programs I had made with GUIDE on Matlab more than a decade ago had refused to run, so I thought it did not have that capability. But now I see that I only have to avoid nested functions - ie. sub-functions inside another function.

https://stackoverflow.com/questions/47298509/how-to-manually-convert-matlab-guide-gui-code-to-octave-ui-components

https://stackoverflow.com/questions/43519040/how-to-code-a-slider-in-octave-to-have-interactive-plot/43536882#43536882

A nice example -
https://github.com/octave-de/macgyver_utils/blob/master/demo_uicontrol.m

On Matlab, gui creation guide,
https://in.mathworks.com/videos/creating-a-gui-with-guide-68979.html



Tuesday, December 18, 2018

issue with server-hosted mp3 played on Android app

There was a query from one of our sister institutions about their Android app having issues playing audio from server1 but playing audio from server2 without problems.

For Audio files that are present in server2 we are able to download/stream, for all the android devices (including Android 4.4 version devices also) . But Audio files present in server1 is not downloading/streaming for few android devices (like Android 4.4 version devices etc). 

Links from both the servers are mentioned for your reference.
http://server1/path/1.mp3 (not working in all the devices) Same links we have tested for https also. 
http://server2/path/1.mp3  (working in all the devices)
Kindly suggest us how to go about this issue.

Excerpts from my reply:

The only difference I can see is that server1 is auto-redirecting to https
So, if the devices are not capable of handling https, [Edit: or http to https redirects] they will fail with server1.
 
server2 is not doing the auto-redirect to https - so, http works as-is on that server.

If the devices are capable of https, perhaps you can just give the https link instead of http link, so that the redirection is not required - in case the redirection is what is causing the failure.

Saturday, December 15, 2018

incomplete instructions - SBI debit card

SBI is updating their debit cards as per RBI mandate to chip-based cards, and I received a mailer with my updated card. Getting it to work was a bit of a struggle. 

1. First tried the 'send SMS, get one time PIN' method. Did not get any response. So, tried the next - Netbanking method. 

2. Set the first two digits of the PIN, AA, and then the next two digits BB are sent via SMS. Then AABB would be the PIN. 

Then, I received the one time PIN from step 1. So, that was probably the reason the card was declined when I tried to use it at the Canara bank ATM. 

Then, tried

3. Changing the PIN from SBI ATM - went to the SBI ATM early in the morning to avoid crowds. Used the Generate PIN from the first screen. That sent me a one time PIN. But apparently, that was for one-time use only. "You must change the PIN before use." But the change PIN menu item is not immediately obvious. For that,

4. Again swiped the card, used the one time PIN, went into Banking menu, and there, found the Change PIN option. Changed, now the card works. 

OpenCV CUDA performance comparisons

This query thread about slow CUDA performance
had an answer pointing to this interesting speed comparison post -


Wednesday, October 31, 2018

Google Apps error report and workaround

S sent me the following:

FYI, for future reference. 

Was trying to create a new email Id in Google Apps. 

Clicking on the 'Users' menu item in the Admin panel of Google Apps, repeatedly gave "Error 400, URL is not available error" described here. Tried the steps described there.  

Finally, I could get there and create the same only through the Plain-HTML Gmail interface. Nothing else worked.

Friday, October 26, 2018

google group permissions for Google Apps domain

Reply to a query from one of my colleagues, who had an issue with some users on a domain getting the message: "You only have read-only access to groups outside of your domain. Contact your domain administrator for more information."

(The actual domain names have been changed :)

Whoever is the admin for your whateveritwas.extension domain in Google Apps, has to enable access.

I believe that whateveritwas.extension was set as a domain alias for anotherdomain.com in Google Apps? I see an email thread where I suggested that this was a possibility. In that case, webmaster@anotherdomain.com would be the admin.

After logging on to webmaster@anotherdomain.com , go to the administrative console at
https://admin.google.com/Dashboard

According to this page,
https://productforums.google.com/forum/#!msg/apps/6wYszBdjuaI/W1cJcvxAf50J

"From the administrative console select the Organizations& Users tab, then click on Services. Scroll down to Google Groups and turn it on."

Wednesday, October 24, 2018

install EOS utility without CD

I seem to have misplaced the EOS Utility CD for the Canon 1100D camera I used in the lab. Tried this method to install for a student -

https://www.youtube.com/watch?v=VTLISryqbSc

Creating a registry key under
HKEY_LOCAL_MACHINE ->  Software ->  WOW6432Node
(Right-click, New -> Key)
Canon
(Right-click, New -> Key)
EOS Utility

This did not work for the latest version of EOS Utility, but did work for an earlier version. 

Thursday, October 04, 2018

flashing a custom ROM on a Samsung Galaxy Grand Quattro - i8552

A gave me a Samsung Galaxy Grand Quattro - model i8552, also known by many other names like Win Duos and so on -
https://www.gsmarena.com/samsung_galaxy_win_i8550-5392.php

This was for use at our exhibit of Universe2go.

The stock Samsung had Android 4.1, and Universe2go needed at least 4.2. So, I started on the journey to flash a custom ROM on the device. It took me 3-5 hours over 3-5 days because of conflicting instructions and things not going as planned. The things which delayed me turned out to be

  1. loose USB cable. A good fit for the USB cable, and a good cable, is a must before doing any flashing.
  2. lack of clear instructions on how exactly the buttons need to be pressed to go into download mode on this particular model, and terribly written instructions in general,
  3. and many broken links and links to paid file hosts. Downloaded files from androidfilehost.com instead, using the filenames given. 
Finally after I finished the process, found that universe2go is laggy on this device, so I won't be using this device after all. Documenting the method which worked - took less than fifteen minutes excluding time taken to download the ROM images - 

1. Downloaded TWRP recovery image,    

2. Downloaded the custom ROM, saved on the phone's SD card by moved it to the phone SD card using Airdroid. Can be either internal memory or extra SD card, doesn't matter. Could have downloaded on the phone directly also. (I tried these ROMs below - 
https://forum.xda-developers.com/grand-quattro/development/rom-trans-k-rom-transwin-v4-rom-t2912032
which is actually just a skin on the existing 4.1 kernel and wrongly reports as 4.4 - so universe2go does not run ...
and also lineageOS 13,
https://forum.xda-developers.com/grand-quattro/orig-development/rom-lineage-os-13-grand-quattro-t3541777
which crashes a lot. This one ran universe2go, but the screen refreshes were at 5 fps or so, not usable. Also tried this one,
https://forum.xda-developers.com/grand-quattro/orig-development/rom-carbon-rom-gt-i8552-delos3geur-t3628076
which says that the sensors work. But installing GApps causes crashes. GApps is supposed to be the version of the OS and ARM pico version - ie ARM 4.4 pico for this carbon, etc from opengapps.org . Also, it does not shut down cleanly. And universe2go crashes.)


3. Installed heimdall with
sudo apt-get install heimdall-flash heimdall-flash-frontend
On Windows, Odin is supposed to do the job, but was stumped by not seeing the device. Probably some driver install issue. 

4. Download the PIT file from the phone using heimdall, following the instructions at

Utilities tab, Download PIT, choose save as destination, Download. 

5. Power down the phone, wait 10-15 seconds to allow it to power down completely. Then boot into Download mode by continuously pressing Home + Vol Down + Power buttons, and when the phone vibrates, after it finishes vibrating, releasing the Power button, keeping the other two buttons pressed until the warning screen appears. (This part in bold is the technique which stumped me.) As the warning screen says, press Vol Up to go into Download mode. 

6.  Following the instructions in this link,
flash the TWRP img file downloaded in step 1 - 
Flash tab - choose the PIT file downloaded in the previous step - click Add - choose Recovery in the dropdown menu, choose No Reboot. Then start. 

7. A blue progress bar on the phone shows when the flashing is done - should take only 10 seconds or so once it starts. Then remove the battery, put it back. This would have installed the TWRP - Team Win Recovery Project - custom recovery software which would allow the flashing of custom (unsigned) ROMs. 

8. Now boot into Recovery by continuously pressing Home + Vol Up + Power buttons, and when the phone vibrates, after it finishes vibrating, releasing the Power button, keeping the other two buttons pressed until the TWRP screen appears. TWRP is easy to use, and has a touch interface.

9. Choose to Wipe (factory reset - this is generally safer, though not always necessary) and then Install - choosing the ROM downloaded in step 2. After the installer says it is done, remove the battery, put it back, and reboot. Done.

Will try to restore the stock ROM -
https://forum.xda-developers.com/showthread.php?t=2433941
and then maybe unroot etc,
https://forum.xda-developers.com/showthread.php?t=2494471

Edit: Finally restored stock ROM from

TransK ROM had play store and other apps crashes, maybe since it reports it is Android 4.4 in spite of being 4.1.

The actual sequence of steps I followed, with many missteps, was something like this -

(Samsung Galaxy Quattro 18552

1. Root with Framaroot

2. Update downloaded from

3. ADB all in one from

4. TWRP install via 

5. TWRP via recovery flashable link at

6. Installed TWRP Manager, then copied over recovery.img using airdroid, then using TWRP Manager, "recovered". 

7. Manager did not install TWRP, so using Flashify,
But Flashify not responding.

8. Installed CWM instead

9. Downloaded files from androidhost via google instead of the links in above.

10. (I was continuing to press the vol + power + home buttons after the vibrate also, hence phone was booting into normal mode)

11. Finally entered download mode with adb

12. Loose contact USB, problems. 

13. Driver issues on Windows with fastboot, so Linux.

14. just sudo apt-get install android-tools-adb android-tools-fastboot

15. lsusb shows Samsung

16.  adb devices showed
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
71ba1f19    device

17. Then did via
adb method.
But again, waiting for device at fastboot flash

18. So, trying 

lsusb gave
Bus 002 Device 008: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy (MTP)

But still no fastboot.

19, Tried adding as per

adb works, fastboot waiting for device.

20. Try with android sdk install. Downloaded tools.

21. Trying this, 

lsusb in download mode gave different id
Bus 002 Device 011: ID 04e8:685d Samsung Electronics Co., Ltd GT-I9100 Phone [Galaxy S II] (Download mode)
Bus 002 Device 003: ID 046

Apparently, Samsung devices need heimdall and do not work with the fastboot tool.  

method worked to get into download mode, and get pit file.

23. heimdall

24. To boot into recovery, vol up + pow + home, leave pow when vibrates

25. from Twrp, selected install, and chose the trans-k rom. 

26/. Wipe cache/dalvik, as per

27. pull out battery, put it back, boot as normal. )

Edit: Some more trial and error in getting back to Stock ROM. See main section above for
assert error

downloaded stock from
But did not work with TWRP. Will probably need to use an external removable sdcard since I formatted the system partition and the device does not boot. 


Wednesday, August 29, 2018

correcting browser fonts on Ubuntu and related distros

On Linux Mint, Hindi fonts were not being displayed correctly by Chrome as well as Firefox. Apparently this was the solution -

https://askubuntu.com/questions/1008661/incorrect-rendering-display-of-devanagari-fonts-in-browsers-chrome-firefox-etc

On Firefox, in Preferences, Language and Appearance, changed default font to Lohit Devanagari

Friday, August 03, 2018

ease of use of Word vs LaTEX

I am now officially a convert to LaTEX. Using overleaf in particular. Pretty equations, citation management and changing of templates is really easy using bibtex.
https://blog.mendeley.com/2012/03/24/how-to-series-generate-bibtex-files-for-your-collections-for-use-in-latex-part-3-of-12/

Can easily get bibtex entries using Google scholar too.
https://texblog.org/2014/04/22/using-google-scholar-to-download-bibtex-citations/

Some manual corrections are needed.

With Microsoft Word, equations, citations, and almost everything else needs tweaks. There is a tendency to get mangled as the document goes from one collaborator to another with different versions of Word. For example, here is the long procedure for copy-pasting an equation!
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other-mso_2010/copy-and-pasting-equations-between-word-2010-files/d3b3ab43-886b-e011-8dfc-68b599b31bf5

1. Select the equation > click on the dark bar on the right side with the little down-arrow at the bottom > Save as New Equation...

2. Name the equation > OK

3. Switch to the other document > click where you want to insert the equation

4. tab: Insert Equation v (click on the down-arrow!) > scroll to the bottom > click on your equation


To delete the equation from your list of frequently used equations when you no longer need it:

1. tab: Insert Equation v (click on the down-arrow!) > scroll to the bottom > right-click on your equation > Organize and Delete...

2. Building Blocks Organizer appears with your equation selected > DeleteYes Close.



Thursday, July 19, 2018

loudness with reaper - dB and RMS and LUFS

Found an interesting discussion on Reaper forums regarding RMS normalization to particular presets - https://forum.cockos.com/showthread.php?t=165331

In particular, the advice given by Michal is, "use actions from SWS.

SWS: Set RMS analysis/normalize options
Here you can set your RMS level target, it is one time operation..

SWS: Normalize items to overall peak RMS
You can select all items on the track and run this action for RMS normalization to predefined level.."

Of course, right now I'm not likely to try any of these...

Monday, July 09, 2018

troubleshooting streaming delay on Google Home device

While testing our Google Assistant action for our audio streams, SC reported that
 I'm still seeing ~100 second delays even on this stream on the Home device. On my phone/browser, it plays instantly.

I tried changing the burst-size but initially did not find any difference - 

64 kB  = 65535   = 100 sec delay - this is the default burst-size for icecast
128 kB = 131072  = 100 sec delay
256 kB = 262144  = 100 sec delay
512 kB = 524288  = 100 sec delay
1 MB   = 1048576 = 100 sec delay

Then it turned out that I was using a relay for testing, and on-demand was set to 1. After setting the relay's on-demand parameter to 0 (so that the relay is always ready and doesn't have to start after a new connection is made),  

128000 = started within 4 seconds!
64000  = 100 sec delay

Repeated this three times, waiting 100 sec + each time after restarting the server. Seems to work well with 128000. So, set this as the burst-size for all our streams. 

Sunday, July 08, 2018

Google Home Mini - a mini review

As long as you don't have inflated expectations, this device does a pretty good job. But my initial problem was that I had higher expectations from Google :)

Expectation - I thought "Google Home" should be able to do a google search, like
OK google, do a google search for callisthenics
Sorry, I don't understand.

Reality - the device needs the prompt "tell me about", or "what is" - like
OK google, tell me about callisthenics.
According to wikipedia, callisthenics is.... (the first sentence only.)

OK google, what is a meteorite?
etc.

OK google, tell me more about callisthenics.
Sorry, I don't know how to help with that yet.

So, it can't read more than the first sentence.

It can tell jokes and do trivia etc, as described in various posts elsewhere.

OK google, tell me a joke.
(it tells a different one-liner every time.)

It needs an exact match for playing radio stations. For example,
OK google, play all india radio on tunein
Sorry, artists aren't available on tunein.

OK google, play All India Radio Classical on tunein
Sure, here's All India Radio Classical on tunein - (plays immediately).

Unfortunately, the music player in the API seems to buffer for quite a while, so currently, if we do
OK google, ask Radiosai to play bhajans
Playing radiosai bhajanstream - (plays after 100 seconds!)
We will try to fix this. It appears this is fixed now, by increasing the burst-size to 128000 on our server.

The radiosai action is a work in progress, but currently, things like this work -
OK google, talk to Radiosai
Sairam, welcome to radiosai etc...
Search for Climate Change
It appears your current device does not have a screen, so here's the first result... etc
(plays immediately).

OK google, increase volume to 50%
works when radiosai or some other agent is not having context.

The touch interface on the device has recently been enabled. So, long touch on either side makes it pause or resume, a tap on the left side makes it reduce volume, and a tap on the right side makes it increase volume. This was not immediately obvious.

It can do more complicated things, but within a limited repertoire. For example,
OK google, tell me how to make idlis
(reads out ingredients and steps one by one, saying let me know when you want to continue, etc.)
OK google, continue
Nothing is playing at the moment
OK google, next ingredient
(reads out the next ingredient.)
OK google, next.
(reads out the next ingredient.)
OK google, next.
(Reads instructions one step at a time, we have to say next for the next step.)
OK google, previous step
(Reads the previous instruction)
(Asks if we want an alarm to be set for required time, etc.)

Apparently there's a 640 character limit for each interaction from the device. So, reading out a large page would need user interaction like the above series of steps for the recipe. Wikihow works in a similar way.

OK google, wikihow
Hi, how's it going?
Bake a cake.
Hi, how's it going?
Wiki how to bake a cake.
I didn't get that, can you tell me what you were looking to do one more time?
(never got it to work.)

It can play news, weather forecast etc. - OK google, how is my day?

And for those with home automation systems, it can be set up to put on lights, play something on the TV with Chromecast, and so on.

So, some people will like it, especially if they memorize the phrases needed for the device to do the required action. But others will be frustrated by it. Examples can be seen in the comments in the article below,


Edit - and here is a "comprehensive list which is periodically updated" from CNET, of all Google Home commands - https://www.cnet.com/how-to/google-home-complete-list-of-commands/

Tuesday, July 03, 2018

packet sniffing wifi

Packet sniffing on a wifi network is a bit more complicated than using a wired network and a hub. Promiscuous mode alone is not enough -

https://osqa-ask.wireshark.org/questions/61656/promiscuous-mode-not-working

https://wiki.wireshark.org/CaptureSetup/WLAN#Monitor_mode

Then the packets have to be decrypted.

https://wiki.wireshark.org/HowToDecrypt802.11

For that, if using WEP, the WEP password has to be converted to the Hexadecimal key -
http://corecoding.com/utilities/wep2hex.php

change Google Home mini wifi settings without Google Assistant app

Trying out a Google Home Mini device. For setup, it needs the Google Home App on an Android or iOS device. For changing certain settings, it needs Google Assistant to be enabled on your phone. Since my current phone runs an earlier Android version than 5.0 which is the least required for Google Assistant, I am unable to change language of the device, unable to change the voice, and so on. Even changing the wifi network needs a different procedure than the one listed on google support.

So, my procedure, found by trial and error, was:

1. Open the Google Home app
2. Tap on the devices icon on top right corner.
3. If there is a card which says "your speaker name" speaker needs setup, and a setup link, you can use that.
4. Else, click on your device name, if it is listed, and the three dots on top right.
5. Choose reboot.
6. From the list of linked devices, unlink the device for which wifi needs to be set up.
7. Tap the back button to go to the home screen of the Home app.
7. Then the app would say that it has found one device which is ready for setup.
8. Click through to set up, including linking to an account and wifi settings.
9. When using a wifi network which was previously configured, it does not ask for the wifi password again.


Friday, June 29, 2018

ITR2 - paying income tax

1. Using the java based ITR2 utility needs openjfx in addition to installing java etc - on Mint/Ubuntu, sudo apt-get install openjfx

2. PAN / TAN of deductor = PAN/TAN of employer

3. importing - pre-filling the form - takes longer than a minute on the Acer laptop, takes 10 seconds on the i7 machine.

4. The re-calculate button of the java utility is not the same as validation. On clicking Save, validation errors pop up. So, use 'Save' to validate, and 'Save draft' to save partially completed form.

5. For the first time, I needed to pay tax. Payment is via https://onlineservices.tin.egov-nsdl.com/etaxnew/tdsnontds.jsp , Challan 280 at the bottom of the page. Netbanking and Debit cards are accepted. The type of payment is Self Assessment Tax.

6. The Challan serial number and other details like date are available in the pdf made available to download from the SBI post-payment screen. These have to be entered in the ITR2 form under self assessment tax payment made, and then submitted.

5. The Aadhaar based verification of return did not work for me - said that service is not registered with UIDAI. The bank account based verification worked.

Friday, June 22, 2018

blender z axis flip

Just a quick recipe for flipping an object in Blender -

  • Select object
  • Ctrl A (for Apply)
  • Choose Scale
  • Enter Z scale as -1
  • Ensure that scale checkbox is ticked under apply.


Wednesday, May 30, 2018

unhelpful error message - google groups

While adding users to a google group, came across this error - An error (#847) occurred while communicating with the server.

Apparently this has nothing to do with internet connectivity issues. These forum posts point to a bad email id in the submitted batch. Sure enough, there was a "blogger.com" email id in the batch which was causing problems for me. Removed it, all well. 

Tuesday, May 29, 2018

Google Apps legacy documentation

Looks like legacy Google apps users can't purchase extra drive storage - Can't purchase Google Drive Storage in legacy Google Apps Free edition - https://productforums.google.com/forum/#!topic/apps/z0tUAkQl_rM

Friday, May 11, 2018

Linux Mint Live CD / DVD

Some notes for Linux Mint Live CD / DVD


  1. username is mint, and no password.
  2. sudo does not ask for password.
  3. to take a backup, can do sudo cp -R /source/folder /destination/folder
  4. to switch between screens, Ctrl+Alt+F2 or Ctrl+Alt+F7 etc - need to press Fn also on Mac keyboard.

web hosting on github

A useful option for small static websites -

https://help.github.com/articles/using-a-custom-domain-with-github-pages/

https://pages.github.com/

The limits are quite generous - https://help.github.com/articles/what-is-github-pages/

"GitHub Pages sites are subject to the following usage limits:

  • GitHub Pages source repositories have a recommended limit of 1GB .
  • Published GitHub Pages sites may be no larger than 1 GB.
  • GitHub Pages sites have a soft bandwidth limit of 100GB per month.
  • GitHub Pages sites have a soft limit of 10 builds per hour."

Sunday, May 06, 2018

C++ programming - using fstream in a cross-platform manner

Some notes about making use of fstream in cross-platform code - 

Some interesting methods are discussed at
https://stackoverflow.com/questions/9739948/write-a-file-in-a-specific-path-in-c/40980510#40980510

In Visual Studio,
disable deprecation, use _CRT_SECURE_NO_WARNINGS - 

Configuration Properties >> C/C++ >> Preporocessor >> Preprocessor Definitions >>  _CRT_SECURE_NO_WARNINGS

A working code snippet - 

    char path[80];
    char foldername[80];
    sprintf(path,"homeuser/file.txt");
    sprintf(foldername, "homeuser");
    CreateDirectoryA(foldername, NULL);
    std::ofstream file(path); //open in constructor
    std::string data("data to write to file");
    file << data;

Friday, May 04, 2018

making an alexa skill

The Amazon Echo Dot, Google Home Mini, etc are inexpensive ways to listen to streaming radio without the need for interacting with a screen. The Echo can be used with Skills to make it easy to accomplish a particular task. Though in theory, radiosai is available on tunein and it should be possible to listen via tunein, of late, it doesn't seem to work. Alexa says, "I can't listen by genre on Tunein". So, tried to make an official Radiosai skill.

There was already a Radio Sai skill, but that one was missing AfriStream and AsiaStream. So, decided to try to implement this skill, with some improvements, as an official radiosai skill.

Changes in the user interface - the screenshots given here are no longer similar to Amazon's AWS console or the Skills console. Instead of uploading the sample utterances as a text file, I manually created the utterances in the Skill console using the wizard. Also added some confirmation before playing each stream, like


var message = 'Playing Bhajan Stream.';
this.response.speak(message);
this.attributes['stream'] = 'BhajanStream';
controller.play.call(this);

and also added a stop call to the AudioPlayer -

'AMAZON.CancelIntent' : function () { 
// adding the line below to stop the audio player 
controller.stop.call(this); 
////////////// 
var message = 'Good bye.'; 
this.response.speak(message); 
this.emit(':responseReady'); 
}

It looks like only the playModeIntentHandlers are active - the others don't seem to be called. Have submitted for being made available to the public.

Edit: Update May 11 -
1. Bug fixes by the owner of this repository, looks like the SDK had some changes so the zip file needed to be changed.

2. How to build an Alexa audio streaming skill from a template - YouTube video - lots of similar resources available

3. Audio player skill sample from Amazon, for multiple streams. 

Wednesday, April 25, 2018

Tuesday, April 17, 2018

Notes on compiling software lockin amplifier

Abbreviated notes from the software lock-in amplifier at https://github.com/hn-88/SoftwareLockin/

French lockin works on USB stick. Lubuntu 12.04

edited the pro files to add
QT += widgets

vumeter.h:40:25: fatal error: QtGui/QWidget: No such file or directory
on Mint 18.1

edit h files to make QtGui/QWidget QWidget

make clean
qmake multi.pro
make


error: ‘const class QString’ has no member named ‘toAscii’ - solved using

(was solved by install of package qttools5-dev-tools
more info here...) not used

QByteArray QString::toAscii() const
Returns an 8-bit representation of the string as a QByteArray.

This function does the same as toLatin1().

So, replaced in lockin.cpp and dockoutput.cpp

output has NaN

Edit: 20 Apr
ui_lockingui.h:13:29: fatal error: QtWidgets/QAction: No such file or directory
compilation terminated.
Makefile:406: recipe for target 'lockingui.o' failed
make: *** [lockingui.o] Error 1

probably have to find replace again?

Also QWidgets/QApplication

changed to QApplication etc - find replace QWidgets/ with nothing.

sudo apt-get --reinstall install libqt4-opengl-dev

Maybe if I upload the makefile?



Friday, April 13, 2018

USB to TTL link dump

A collection of links about communicating with serial control lines over USB - Arduino etc - 

Tuesday, April 10, 2018

bouncing emails in google groups

Maintaining google group by deleting bounced emails. And if needed, re-adding them. 

https://support.google.com/a/answer/7552660?hl=en

Edit: Users can reset their bounce status by going to https://groups.google.com/bounced?pli=1 or https://groups.google.com/a/example.com/groups/bounced?pli=1
next to Bounce Status, email status -> Reset bounce status. (which appears only if it is bouncing.)

Monday, April 09, 2018

Arduino IDE on Linux Mint

From https://playground.arduino.cc/Linux/Mint/
we should probably not use
sudo apt install arduino
because it is outdated or non-standard, and we should instead use the 64 bit binary from 
https://www.arduino.cc/en/Main/Software

Saturday, April 07, 2018

email slowdown and possible fixes

From March 24 or 25, our mailing list started having a lot of delays in email sending, especially to gmail.com. Found the following issues:

1. For some gmail emails, the server was trying the ipv6 address, and not able to reach it - like

Mar 25 09:34:15 krishna postfix/smtp[19788]: connect to gmail-smtp-in.l.google.com[2404:6800:4003:c03::1b]:25: Network is unreachable

Mar 25 09:34:28 krishna postfix/smtp[20163]: connect to ASPMX.L.GOOGLE.COM[2404:6800:4003:c02::1b]:25: Network is unreachable

This was probably due to a router change at the Studio.

Did this -
https://support.plesk.com/hc/en-us/articles/213398289-Specifying-Postfix-configuration-of-IPv4-IPv6-protocol-support
ie
adding the option:

inet_protocols=ipv4

to the /etc/postfix/main.cf Postfix configuration file. And then as root,

# postfix reload
# service postfix restart

That worked, the emails went out. But the email sending rate was only around 1000 emails per hour, as reported by
# qshape incoming active deferred

2. A lot of mails were being deferred instead of bounced by gmail, OverQuotaTemp.
cat  /var/log/mail.log | grep OverQuotaTemp | wc -l
5878
PB unconfirmed those emails using
cat /var/log/mail.log | grep OverQuotaTemp | grep 'to=' | grep -o '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' | sort | uniq -i

Then also for bouncing emails, like
cat  /var/log/mail.log | grep "does not exist"
cat  /var/log/mail.log.1 | grep "does not exist"
cat  /var/log/mail.log.1 | grep "553 Mail from 111.93.16.162 not allowed"
cat  /var/log/mail.log | grep "status=bounced"
cat  /var/log/mail.log.1 | grep "status=bounced"

3. Mails were still going out slowly, with the usage on the internet port being like

Next try was to speed up sending to gmail.com domain, since the other emails were going out OK. Then, added these two lines to /etc/postfix/main.cf - 

maximal_queue_lifetime = 2d
default_destination_concurrency_limit = 100

decreasing lifetime from 5d to 2d and increasing concurrency limit from 20 to 100. That seemed to improve things - the outgoing rate went up to almost the peak rate - 

and from the next day, the emails were going out like









Thursday, April 05, 2018

notes on startup / shutdown times

On a machine with dual boot,

Time taken for Windows 7 to boot, open firefox and open youtube.com - 3:30 minutes.
Time taken for Linux Mint 18.3 to boot, open firefox and open youtube.com - 1:15 minutes.
Similarly, Windows takes 40 seconds to shut down, while Linux shuts down in less than ten seconds.
Equivalent of Hotspot Shield, if you want to watch something which is blocked - have installed PureVPN extension for both Chrome and Firefox...

Linux vs Windows 7 brief speed test

N's Lenovo B640 laptop had become old and slow. Tried dual booting with Linux Mint, found quite an improvement. 

Time taken for Windows 7 to boot, open firefox and open youtube.com - 3:30 minutes.

Time taken for Linux to boot, open firefox and open youtube.com - 1:15 minutes.

Similarly, Windows takes 40 seconds to shut down, while Linux shuts down in less than ten seconds.

Thursday, March 29, 2018

finding ip ranges via ASN

To obtain all the IP ranges of an ISP or large organization, got a procedure from this quora post -

https://www.quora.com/How-can-I-obtain-a-list-of-IP-addresses-owned-by-a-specific-company-I-would-like-to-provide-a-targeted-offer-to-site-visitors-if-they-work-at-a-certain-company-I-would-like-to-get-a-list-of-the-IP-addresses-that-this-organization-owns


https://www.peeringdb.com/net/1903 has Airtel's ASN.

Then, we can use that ASN in this whois query -

whois -h whois.radb.net -- '-i origin AS9498' | grep -Eo "([0-9.]+){4}/[0-9]+" > airtel.txt
whois -h whois.radb.net -- '-i origin AS9829' | grep -Eo "([0-9.]+){4}/[0-9]+" > bsnl.txt

Wednesday, March 28, 2018

boot from grub - link dump

https://www.linuxquestions.org/questions/linux-software-2/booting-windows-from-the-grub-prompt-275446/

root (hd0,0)
makeactive
chainloader --force +1
boot

But grub 2 is different.
https://www.linux.com/learn/how-rescue-non-booting-grub-2-Linux

grub> set root=(hd0,1)
grub> linux /vmlinuz root=/dev/sda1
grub> initrd /initrd.img
grub> boot

https://unix.stackexchange.com/questions/77263/use-grub-rescue-to-boot-from-windows-xp-partition-cd-or-usb

set prefix=(hd1,1)/grub
set root=(hd1,1)
insmod normal
normal

https://www.aioboot.com/en/boot-windows-grub2/

from grub rescue prompt,
search -s root -f /NTDETECT.COM
drivemap -s hd0 $root
ntldr /ntldr
boot

https://www.gnu.org/software/grub/manual/grub/grub.html#DOS_002fWindows

parttool (hd0,1) hidden-
parttool (hd0,2) hidden+
set root=(hd0,1)
chainloader +1
parttool ${root} boot+
boot

https://www.aioboot.com/en/boot-windows-grub2/

http://forums.justlinux.com/showthread.php?153121-Fun-with-GPT-partitioning

unable to make XP boot from a cloned volume on Intel Mac

Just a few lines of notes - trying making other partitions hidden to make XP boot - doesn't work, since partition is GPT, grub says hidden - unknown argument or whatever.

using dd to clone a usb drive

From
https://www.garron.me/en/bits/convert-store-copy-bootable-usb-iso-file-another-usb.html

Tuesday, March 27, 2018

Linux Mint 18.1 not booting - solved

Linux Mint was not booting into graphical mode. It was not even dropping me into an emergency shell - a dialog box about not being able to connect to upstart would appear, your session lasted only 10 seconds etc, and the window manager would restart. Initially I thought this was due to some problem related to booting as in my previous post. But then, saw this post on the Linux Mint forums. So, hit Ctrl Alt F2 to get a shell, (in my case, fn+Ctrl+Option, since this is a Macbook), did
  apt remove virtualbox-guest*
and rebooted OK. 

Monday, March 26, 2018

link dump - ALSA etc - for software lock-in amplifier

ALSA tutorial for beginners - 2004 - http://www.linuxjournal.com/article/6735?page=0,1


Checking the code and compiling from https://www.av8n.com/physics/lockin.htm

http://www.qtcentre.org/threads/53452-QtGui-QApplication-No-such-file-or-directorty

QApplication and Qwidgets derived classes are in widgets module in Qt 5 so to fix that you need to add QT += widgets in the .pro file and run qmake and also use #include <QApplication> instead of #include <QtGui/QApplication> (and the code becomes compatible with both Qt 4 and 5), you can read more here

Or download 10.04,
and
https://help.ubuntu.com/community/Installation/FromUSBStick#Install_and_run_Startup_Disk_Creator_alias_usb-creator