Saturday, December 23, 2017

Friday, December 22, 2017

some notes on rkhunter

A security tool to prevent rootkits, rkhunter - some notes, made for a server I help to administer -

1. I will now change the rkhunter configuration file so that the emails will come to me instead of coming to you. vim /etc/sysconfig/rkhunter

2. the hidden file warning message is about  /etc/.brand which just says hostgator - it is just a branding file from hostgator. Totally harmless.

3. I will prevent ssh login without keys. That is, password-based ssh login using terminal will be disabled. This is a good security feature, since the ssh is routinely hit with brute force attacks. 

4. It looks like rkhunter does not play nice with user-compiled or modified files. I will set up rkhunter to ignore all the currently available files, and only give warnings for new files. Basically by editing the whitelist, and running
sudo rkhunter --update
sudo rkhunter --propupd

https://www.linuxquestions.org/questions/linux-security-4/rkhunter-package-manager-fail-warnings-on-centos-5-running-whm-11-a-871791/

https://www.digitalocean.com/community/tutorials/how-to-use-rkhunter-to-guard-against-rootkits-on-an-ubuntu-vps

Sunday, December 17, 2017

AutoSSL feature of WHM

Found that WHM has an AutoSSL feature, which will automatically configure SSL for selected (or all) users. The AutoSSL feature can be used with LetsEncrypt.org also, by running the shell script  /scripts/install_lets_encrypt_autossl_provider
as root, as mentioned in the documentation.

So, no need of going through the painful process of WHM SSL certificate installation.

And if we want to redirect all users using http to https, we can use the htaccess file, as given here

Sunday, November 26, 2017

phplist bounce processing issue

Based on a complaint received on 19 Nov, checked the server logs and found that Gmail is starting to mark our mails as spam because we're daily sending mail to bouncing gmail accounts. 

PB went to the reconcile users page in phplist and looked at the process of unsubscribing users who have 15 and more bounces. (Found about 9,527 users) - but did not run it since this was not 15 consecutive bounces. Running the bounce processing manually, the bounce processing takes 3 hours, identifies the bounces, but does not unconfirm subscribers with 5 consecutive bounces. So, running bounce processing is not solving the problem. We needed to fix the bounce processing rules which are being applied.

PB found, checking for the location where the rules are defined and found that phplist is picking up rules from the database table. Table names: our_prefix_bounceregex and our_prefix_bounceregex_bounce. But those tables showed empty records. Did not find any web interface to add rules to these tables. Did not find a backup with entries. PB downloaded the sourcecode (version 2.10.10) from https://sourceforge.net/projects/phplist/files/phplist/ and checked the phplist.sql file that creates the database on a new installation. There too the records were empty.

(Edit: Found a discussion about this in the phplist manual here. )

Then, a quick and dirty fix implemented by PB on my request: in phplist web interface "view bounces" selected the message id 4189, got the list of email ids that had bounced for the message id 4189

mysql> select id,email,confirmed from our_prefix_user_user where id IN ( select user from our_prefix_user_message_bounce where message=4189);

- about 1147 records

Unconfirmed the users with the following sql update:

mysql> UPDATE our_prefix_user_user SET confirmed=0  WHERE id IN (SELECT user FROM our_prefix_user_message_bounce WHERE message=4189);

Query OK, 1146 rows affected (0.54 sec)

Rows matched: 1147  Changed: 1146  Warnings: 0


compiling siril

Following the dependencies listed at
https://free-astro.org/index.php/Siril:install#Dependencies
I did the following to install dependencies on Linux Mint 18.1 -

sudo apt-get install gtk3*
sudo apt-get install cfitsio*
sudo apt-get install fftw3*
sudo apt-get install gsl*
sudo apt-get install libconfig++*
sudo apt-get install libraw*
sudo apt-get install libffms2*
sudo apt-get install libtiff*
sudo apt-get install libjpeg*
sudo apt-get install libpng*


Then running autogen.sh complained -
./autogen.sh: intltoolize: not found


and for that I did
sudo apt-get install intltool
sudo apt-get install libgsl*


This was enough to build it using
./autogen.sh
 make
 sudo make install


Thought about doing a full-fledged fork and pull request as in
https://akrabat.com/the-beginners-guide-to-contributing-to-a-github-project/

For that, I needed to set the ssh key, as in this stackoverflow post,

cat ~/.ssh/id_rsa.pub
and copied the key to github -> settings -> ssh key

git clone git@github.com:my-account-name/Siril-0.9.git
cd Si*
git remote add upstream git@github.com:lock042/Siril-0.9.git
git checkout master
git pull upstream master && git push origin master
git checkout -b feature/stackallmedian


It turned out that this version had a bug where stackall would cause a segmentation fault. This was fixed in version v0.9.8-beta3 which also had a stackall median command, which did not do normalization by default, so my problem was solved and I did not have code it myself to do the git pull requests and so on.



Sunday, November 05, 2017

more on SER, FITS and Octave

Adding to my earlier post - Siril had a stackall command which stacks all the SER files in a folder to sum-stacked FITS files. That would have taken away the drudgery of having to open 830 SER files manually one by one and converting them though the creation of directories could be automated by

mkdir $(seq --format 's%03.0f' 1 830)

(from
https://unix.stackexchange.com/questions/48750/creating-numerous-directories-using-mkdir )

which would create
s001
s002
etc upto
s830.

Unfortunately, Siril's stackall does sum stacking, and (at least according to my understanding, in version 0.9.7) was integer overflowing or showing some such behaviour - though the developers mentioned that it is supposed to convert to 64 bit, and then normalized to 16 bit. Maybe the normalizing was what was causing the issue. My data set had numbers like 44,000 per pixel and 102 frames, resulting in sums like 4,400,000 - even signed 32 bit int would only overflow at 2,147,483,647. Anyway, using the stackall sum stacking, I was getting plots like this

instead of plots like this.
Possible solution may be to implement a median stacking function for siril, like stackallmedian.

Edit: The siril team has now implemented median stacking using the command stackall median - and current branch has no normalization applied, so it works well for me :)


Friday, November 03, 2017

compiling QHYCCD camera SDK sample application with OpenCV

Steps needed to cleanly compile the LiveFrameSample code from QHY camera SDK, once OpenCV is installed -

Tested the opencv installation, compiling and running webcam capture test code from http://henryhermawan.blogspot.in/2007/09/capturing-frames-from-usb-camera-using.html

Followed the INSTALL file and compiled + installed the QHYCCD SDK.

cmake -DCMAKE_INSTALL_PREFIX=/usr .
make
sudo make install

Tried the sample without modifications -
cd sample
mkdir build
cd build
cmake ..
make

LiveFrameSampletest, SingleFrameSampletest and ControlCFWtest compiled without errors, but for CaptureDarkFrametest errors were reported, like
CaptureDarkFrame.cpp:76:83: error: invalid conversion from ‘int*’ to ‘uint32_t* {aka unsigned int*}’ [-fpermissive]
         ret = GetQHYCCDChipInfo(camhandle,&chipw,&chiph,&w,&h,&pixelw,&pixelh,&bpp);

and so on.

Anyway, I was only interested in the frame capture tests, so I created LiveFrameSampleOCV.cpp from LiveFrameSample.cpp and made the following changes -

  1. Uncommented the #define for opencv support and made that line
    #define OPENCV_SUPPORT 1
  2. Changed the set resolution line to
    ret = SetQHYCCDResolution(camhandle,320,240, 320, 240);
    (first two arguments after camhandle are dimensions, next two are position)
  3. Defined an int key before the display loop, and changed the display loop to an infinite loop -
    //ret = QHYCCD_ERROR;
    //while(ret != QHYCCD_SUCCESS)
    while(1)
  4. Added a break on escape key,
    key=cvWaitKey(30);
    if (key == 27)
    break;
  5. Modified the CMakeLists.txt to uncomment
    find_package(OpenCV REQUIRED) and
    include_directories($(OpenCV_INCLUDE_DIR))

    and also changed the link libraries line to
    target_link_libraries(${FILENAME1} -lqhy ${LIBUSB_1_LIBRARIES} ${OpenCV_LIBS}
    where the OpenCV_LIBS have been added. 
  6. Ran cmake .. from the build directory again, and then
    make LiveFrameSampleOCVtest
So now ./LiveFrameSampleOCVtest shows a live display of the camera at 320x240 resolution, around 20-24 fps. 

While running cmake, it shows
 -- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: /usr/lib/x86_64-linux-gnu/libusb-1.0.so

But could not build LiveFrameSample without using cmake - the gcc command needs some more work - this does not work -

gcc -Wall LiveFrameSampleOCV.cpp -o LiveFrameSampleOCV -l/usr/lib/x86_64-linux-gnu/ `pkg-config --cflags --libs opencv usb-1.0`



installing the latest OpenCV with Python bindings on Linux Mint 18.1

Followed the Ubuntu 16.04 tutorial by Adrian Rosebrock with some changes. Since my installation had python using anaconda, I used conda install instead of pip install. And since my first attempt at creating a virtual environment failed, I went ahead with the installation without a virtual environment. Most of the requirements were already installed. My cmake string also had a different path to the python executable due to anaconda.

sudo apt-get update 
sudo apt-get upgrade
sudo apt-get install build-essential cmake pkg-config
sudo apt-get install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libxvidcore-dev libx264-dev 
sudo apt-get install libgtk-3-dev
sudo apt-get install libatlas-base-dev gfortran
sudo apt-get install python2.7-dev python3.5-dev

OpenCV stable version is now 3.3.1, so

wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.3.1.zip
unzip opencv.zip
wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.3.1.zip
unzip opencv_contrib.zip
conda install numpy
cd opencv-3.1.0/
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D INSTALL_PYTHON_EXAMPLES=ON \
    -D INSTALL_C_EXAMPLES=ON \
    -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.1/modules \
    -D PYTHON_EXECUTABLE=/home/mac/anaconda2/bin/python \
    -D BUILD_EXAMPLES=ON ..
cmake rapidly went through its checks, then I had to do the build,
make
which took around half an hour judging by the timestamps - I was doing other things.... and then finally 

sudo make install
sudo ldconfig
Verified by doing

ls -l /usr/local/lib/python2.7/site-packages/
which showed up cv2.so
and finally linked this cv2.so to the site-packages folder, in my case

cd ~/anaconda2/lib/python2.7/site-packages
ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so
Tested by opening a python shell, importing cv2 and checking its version,

python
 >>> import cv2
>>> cv2.__version__
'3.3.1'
>>>

Edit: August 2019 - updated instructions for installing on Ubuntu 18.04 - 
https://www.pyimagesearch.com/2018/05/28/ubuntu-18-04-how-to-install-opencv/
 


Monday, October 30, 2017

SER, FITS and Octave

While capturing a series of images in an autocorrelation experiment using a QHY5L-II and Sharpcap, instead of capturing as a series of PNG files, captured as SER files by mistake. From the experience of trying to use that data, found the following.

  1. SER capture is faster than PNG sequence capture - PNG was capturing at 20 fps or so, but dropping frames after 80 frames or so, and was taking the last 20 frames at around 5 fps. SER was not dropping frames at all. All this on the Menlo systems Lenovo laptop. 
  2. Octave and Matlab don't open SER files without conversion, the definitive site for SER files seems to be http://www.grischa-hahn.homepage.t-online.de/astro/ser/
  3. After some back and forth on this thread, found that Siril can export SER to a sequence of FITS images without losing the 16-bit resolution. 
  4. Imagemagick can be used to convert the FITS images to 16-bit TIFF using
    mogrify -format tif *.fits
  5. Alternately, the fits octave package can be used to read the data into Octave from the FITS files. Although Octave uses Imagemagick to implement imread, imread doesn't seem to work with the FITS files from Siril, complaining
    error: Magick++ exception: Magick: Unexpected end-of-file (/media/mac/SAM2TB/Autocorr/2017-10-16/Capture/14_10_49/Capture_00002.fit) reported by coders/fits.c:370 (ReadFITSImage)
  6. In order to install the fits package, had to install its dependency, with
    sudo apt-get install libcfitsio*
    and then run octave as root,
    sudo octave
    and within octave, run
    pkg install -forge fits
  7. Reading using the fits package and imread give different results.
    imread returns uint16 rows x columns
    read_fits_image returns double columns x rows, upside down.
    So, for equivalence with imread, we need to use flipud.
    b=read_fits_image('im.fits')
    b=b';
    b=flipud(b);
    imagesc(b)

    gives the same numbers as
    a=imread('im.tif')
  8. identify Capture_0035.png
    can be used to check whether the png is 8-bit or 16-bit. 
  9. Installing ISIS and SER Player turned out to be dead-ends, since they did not convert SER to PNG without converting to 8-bit.
Edit - more on siril's stackall here

Saturday, October 28, 2017

removing malware/adware from Intex phone - trois

Even after my earlier posts about removing malware from Intex phone, one issue persisted. Occasionally, Rs. 1.50 would be deducted as SMS charges. At first I thought it was some sort of location finding behaviour by some app - as I noted, this deduction was noticed after I installed Uber and PayTM apps. But even after uninstalling those apps, the issue remained - deduction of Rs. 1.50 once in a week or so.

Finally I contacted my carrier Airtel via email - which seems to be the only way to reach their customer service department. They advised that I could Dial *121*51# (Toll Free) or 12181 (Toll Free) to check last 5 deductions which have happened in the last 72 hours. Using this information, I found that the SMS charges were to a number 9582943043. Googling, found that this is an "activation feature" on Intex phones!

https://together.jolla.com/question/139190/intex-aqua-fish-re-activation-sms/

Now I seem to have removed the offending Intex services - using Kingroot and root uninstaller - searched for sms in system apps, found SmsRegister - com.android.smsregister - uninstalled it. This seems to have solved the issue - no sms sent for the last one month. 

Friday, October 27, 2017

a tale of redirects

I added a second domain to Godaddy's deluxe hosting, using My Products -> Web Hosting -> Manage All ->  Manage (under primary domain name)  -> More -> Hosted Domains. The root folder for this was configured like /seconddomain, but when trying to access the second domain, was getting a redirect to
http://firstdomain.org/seconddomain

Godaddy support, over the course of 3 days, told me that this was due to some redirects in the .htaccess file. But they could not fix it for me. Finally when I tried editing the .htaccess file, found that the issues were due to some redirects meant for the CodeIgniter framework, redirecting html files to their php equivalents. The original .htaccess was
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]

In order to make it work with the second domain, I added some conditions, and made it

# BEGIN WordPress

RewriteBase /
# END WordPress

RewriteCond %{HTTP_HOST} ^www.seconddomain.org$ [NC]
RewriteRule ^(.*)$ http://seconddomain.org/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^seconddomain.org$ [NC]
rewritecond %{REQUEST_FILENAME} !-f
rewritecond %{REQUEST_FILENAME} !-d
rewriterule ^(.*)$ /index.html [L]

RewriteCond %{HTTP_HOST} ^www.firstdomain.org$ [NC]
RewriteRule ^(.*)$ http://firstdomain.org/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^firstdomain.org$ [NC]
rewritecond %{REQUEST_FILENAME} !-f
rewritecond %{REQUEST_FILENAME} !-d
rewriterule ^(.*)$ /index.php?$1 [L]

Now both sites firstdomain.org and seconddomain.org seem to be working fine. www.firstdomain.org redirects to firstdomain.org and similarly www.seconddomain.org redirects to seconddomain.org.

Sunday, October 08, 2017

removing duplicates

Found some duplicate filename entries in our schedule page remote database. PB found that these were due to some files with filenames beginning with a carriage return - ASCII 13 -

and he found there were 144 such duplicated files.


I found that these had been added in the early days - double digit index numbers - and so could be deleted - did

SELECT * FROM `name_of_table` where LEFT (fileName, 1) = '\r'

and then deleted all those 141 records using the phpmyadmin interface.

Sunday, September 24, 2017

Intex Aqua 4G Strong and Airtel 4G - solved

Unfortunately, my Intex Aqua 4G Strong handset does not seem to work with Airtel 4G network. The issue could be that Airtel's 4G is on LTE band 40 (2300 MHz) which does not seem to be supported by this handset. So, currently, even when Airtel4G is seen as an available network using Settings -> More -> Cellular Networks -> Network operators, and when chosen, shows "Registered on network", the status shows 3G, and apps like Coverage and Phone tester show the connected cell to be WCDMA / HSPA and not LTE.

Phone tester was earlier indicating that this handset was not reporting GPS connections. Maybe it lacks antennae for GPS and LTE band 40? Using Phone tester with the Mi3 would take a couple of minutes for first connecting to a GPS satellite, and later, after closing and opening the app, would connect within seconds even indoors.

Edit: I emailed 121 at airtel dot com with my 4G connection issue. They called back in the evening, saying that it was an issue at their end, "we would like to inform you that due to some technical issue, internet service on your mobile was not working. However, we have reset the internet service for your mobile.
We request you to restart the handset before using the internet service."

I restarted after seeing their email, and the phone connected to 4G  :)

updated budget airline flying experience

I had posted in 2007 about flying Air Deccan. Since Air Deccan no longer exists, maybe I should write about my recent trip on Spicejet.

Ticket price was supposed to be Rs. 1600 or so for CCJ to BLR, hand-luggage-only fare. Somewhere in the online booking process, I was charged some more, so it became Rs. 1900. Somewhat comparable to the Rs. 1800 (Tatkal) II AC railway ticket price.

Ticket and ID is required while entering the airport. Security check was relatively hassle-free, no lines when I arrived one hour before my flight time. No tag needed for hand-luggage. CISF personnel insist on paper boarding pass so that they can rubber-stamp it - whether web check-in or normal check-in - so the mobile boarding pass is not of much use. They also asked me to take out electronic items from my bag and put them on a tray for X-ray. The waiting lounge was full of passengers - Air India flight to Mumbai was four hours late, those passengers were being provided with breakfast in the lounge when we were boarding. Low-floor buses to and from the aircraft at both airports, a Cobus 3000 at BLR.

As noted in my previous post, the flight attendants are a bit rushed for time, trying to manage the very short turnaround times. They were doing the safety drill when the aircraft was rolling towards the start of the runway, just completing when it started the takeoff run. The Bombardier Q400 managed the 350 km trip in just 35 to 40 minutes of flying time. Another five minutes for taxiing and so on. A bit of turbulence over the Western Ghats as usual - maybe for five minutes or so. Also a big downdraft just before landing. Otherwise quite smooth.  The pleasant-mannered cabin crew managed to serve pre-booked meals and free water for quite a few passengers during this short flight.

The flight seemed to be full - I had chosen the last row window seat, 20D, for the little bit extra legroom. At nearly six feet, I was reasonably comfortable, with an inch or two to spare between my knees and the seat ahead. But the seat reclines only a couple of inches.

Overall a good experience, with only the taxi fare from the airport being an extra cost as compared to the train journey. 

Monday, September 04, 2017

upgrading from Korg Nanokontrol to Nanokontrol2

I mapped the MIDI CC signals of the Nanokontrol2 to Reaper following the method given at
http://hnsws.blogspot.in/2010/08/korg-nanokontrol-and-reaper.html

with the important difference that the Nanokontrol2 had to be plugged in keeping the
Cycle and Set 
buttons pressed to make it go into the MIDI CC mode, as mentioned in the instruction booklet supplied along with the device.

I tried rebooting the computer, the setting seems to be remembered. So, probably for daily use, this pressing of buttons at startup may not be needed.

In case you have issues with it, you may need to disconnect the Nanokontrol2, and connect it back keeping Cycle and Set buttons pressed.

(Specific to our use - other functions are similar as before, except that there are 3 buttons for each row instead of 2 for the earlier Nanokontrol - the lower buttons are mapped to SOLO for the slider tracks, the upper buttons are mapped to SOLO for the knob tracks. The middle buttons are left unused for now.)

Thursday, August 31, 2017

splitting a multi-track wav file into separate channels in Reaper 3.5

Right-click on the track, choose Item processing -> Explode multichannel audio or midi items to new mono items 

Sunday, August 13, 2017

avoiding dead time on radio during live broadcasts

From an email sent to my colleagues.

It has been our practice to avoid dead time on the radio during mandir live broadcasts by playing the file BI.mp3 which can be found on the desktop of the mandir mac.

The procedure is -

  • drag and drop the BI.mp3 into the track corresponding is knob 4 (input 12) ahead of time, if you anticipate a period of silence

  • click on the record enable button - red button next to the fader on the onscreen mixer - to disable record enable (so that the mp3 gets played out instead of the input from that channel)

  • fade in the music within 2-3 seconds of silence, and fade out similarly. 

  • Once bhajans start (or some program starts where input 12 is needed) again click record enable to enable that input.
  • Another point to be noted is: Please DO NOT save the project when you quit. (If recorded, the wav file is saved automatically.)

Wednesday, May 17, 2017

converting a FAT32 volume to NTFS and backups

With WCry and other malware in the wild, I wanted to take a full system backup of the Acer laptop. Decided to go with Windows built in backup - Start -> Run -> ntbackup

Around half an hour later, ntbackup complained that the drive it was writing to was FAT32, and does not allow files larger than 2 GB (or 4GB? I forgot). Decided to convert it to NTFS, retaining the data on it.

Ran convert from command prompt. It failed, complaining that there was insufficient memory. Moved over the existing files to another hard disk and then tried convert again. It again complained of insufficient memory. Probably a 2 TB volume is too much for it on a 32 bit system. So, Control Panel -> Administrative Tools -> Computer Management -> Disk Management. Deleted the partition, created it again as NTFS.

While formatting the new volume, I wanted to see what would happen if I do not choose Quick Format. Format took 5 hours for the 2 TB drive!

And after that, the backup of C, D and E drives, creating a 239.4 GB single file, took around 12 hours. 

Sunday, May 14, 2017

stopping unwanted notifications on Android

Some apps bring up annoying notifications. Examples - the activation messages for Cloud Messaging on Xiaomi phones, Airtel's and Paytm's "offers" and so on. An easy solution was to pull down the notification bar, click and hold the notification till a box appears with "App Info" - may be seen as an exclamation mark icon. Click on that, which gives an option to block notifications from that app. 

preparing Mandir Live Files for Download

From an email by PA.

Steps to process live files

1. Open finder and click on ‘Mandir Live Recordings’, click date modified

2. The first few files will be that morning's and the previous days

3. Open ‘Magic Cutter’, drag and drop the file with yesterday’s date. Morning file will end with ‘_1’ and evening with ‘_2’

4. Double clicking on the wave will give you the split marker. Place one marker just when ‘Omkar’ of vedam starts and one before ‘Omkar’ of bhajans start. (You will need to connect the earphones to the mac mini's 3.5 jack to hear the file)

5. Then click ‘Split’

6. Now it will ask for where to save. Click the drop down on top of the dialogue box and select the folder ‘Split Files’

7. It will take 2 seconds to complete. Then repeat the same for Evening file.

8. After both files have been split, close Magic Cutter. In the finder go to the folder ‘Split Files’ in the sidebar.

9. Once there, again click date modified. You will see 6 files with names different from the rest. Date followed by ’_01_01’ and so on.

10. Now delete the 2 files that have the announcement. (They will be the 2 files with least size)

11. Now rename the files just like the other files in the folder. Morning vedam and bhajan files should have the date and end with '_AM_VEDAM' and '_AM_BHAJAN' respectively
Evening vedam and bhajan files should end with '_PM_VEDAM' and '_PM_BHAJAN' respectively

12. After renaming, close Finder and open 'Filezilla'

13. In the menu right on top of the monitor, click bookmarks and select the bookmark, 'Split Files'.

14. Once the connection is established, transfer the files that you just renamed. Double-click files one by one, or select, drag & drop.

Friday, April 28, 2017

Blender links

Some Blender links which I found useful:

https://blender.stackexchange.com/questions/124/how-to-emulate-a-number-pad-and-3-button-mouse

https://blender.stackexchange.com/questions/644/why-does-the-zoom-sometimes-stop-at-a-point

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

In this tutorial, there is a mention of how the output may look grainy if the object in blender is not scaled up. But I was not successful in improving my OCT renders though I scaled up the cube 2 or 3 times.


Tuesday, April 25, 2017

installing the latest blender on Linux Mint

I needed to install Blender 2.78 for compatibility with files created on Windows with 2.78. The Linux Mint repository (Ubuntu repository) carried the earlier version of Blender. So, followed this guide to install 2.78.

sudo add-apt-repository ppa:thomas-schiex/blender
sudo apt update 
sudo apt install blender

To go back to the default version, I need to do
sudo apt install ppa-purge 
sudo ppa-purge ppa:thomas-schiex/blender

Wednesday, April 19, 2017

updated live broadcast procedure

My old post on Mandir live broadcast procedure needs an update. A lot of steps have been removed.

  1. Power on procedure is:
    (a) UPS input on
    (b) UPS on
    (c) Tascam US-1641 power on
    (d) Compressor on
    (e) MacMini power on
    Power down procedure follows in the reverse order.
  2. In case they don't start automatically, start Reaper and BuTT. 
  3. The setup can be tested by playing the output of reaper. Reaper channels 1-8 are mapped to sliders 1-8 on the Korg NanoKontrol. Channels 9-14 are mapped to knobs 1-6. Channel 5 is also mapped to slider 9, since slider 5 has some issues.
    Channel 12 (knob 4) has instrumental music and 
    Channel 13 (knob 5) has the pre-live announcement pre-loaded.
    Channel 3 (slider 3) has the full mix output of PA mixer coming in.
    Pressing play on the Korg NanoKontrol allows you to test whether the BUTT gets signal when knob 5 is opened, as seen by the lit up LED-style indicators on BUTT.
  4. Start playback of pre-live Announcement in Reaper approximately 3 minutes before desired start of live broadcast.
  5. Press the 'Play' button in BUTT to start live broadcast on AsiaStream + TeluguStream.
  6. Fade out knob 5 and allow knob 6 to maintain around -12 dB at the output when the program starts. Playback can be stopped with the stop button on the NanoKontrol.
  7. Recording of programs is mapped to Channel 15 which is record enabled. The spacebar is the shortcut key.This recording is not necessary for daily bhajan and vedam - BuTT records those automatically.
  8. If recording is in progress, if a filler instrumental is to be added, BI.mp3 can be dragged from desktop to Channel 12 (knob 4) which has record enable DISABLED - the dull red ar button.
    Unless the track has record enable Disabled, playback will not occur from the track.
  9. The same procedure as above can be used to drag and drop the ANN_END_LIVE end announcement file for playout at the end of special program broadcasts.
  10. The ambient hall mic is connected to the XLR input Channel 8 on the Tascam, and this is opened for bhajan chorus etc.
  11. The live broadcast is stopped by hitting the stop button on BuTT, and answering 'Yes' when asked if the recording can be stopped. 

Sunday, April 09, 2017

enabled showing text for location in Nemo

and enabled textual location address in Nemo file browser, after installing dconf-editor, by checking show-location-entry in org nemo preferences.

Friday, April 07, 2017

removing old kernels

After a kernel update, found on Mint Linux that there were quite a few old kernels present, which must be using up quite a bit of disk space. As suggested by a post at
https://forums.linuxmint.com/viewtopic.php?t=234076

did

sudo apt-get install byobu
sudo purge-old-kernels


Seems to have cleared up nearly 700 MB.

Wednesday, April 05, 2017

removing malware/adware from Intex phone - deux

My earlier post about removing adware and malware from the Intex phone was too optimistic. The pop-ups asking to install UC Browser and so on had not stopped. So, I tried to delete files which I thought were causing the issue, by directly deleting files from /System/Apps. But then, when I tried to reboot the phone, it went into a loop, saying "Optimizing apps 1 of 72" or something like that, and would not start. So the phone was soft-bricked.

I thought it would be a good idea to reflash the firmware and use Root Uninstaller or some such tool instead. But after flashing using SP Tool, found that the phone was hard bricked. Hard-bricked meaning that the phone would not charge, would not go into recovery mode if switched on with volume down also.

After initial attempts to get it fixed by the local mobile repair guy - "Please try the Intex service centre" - and service centre - "Please bring the item, we will look at it and then tell you how much it will cost" - explored the ways to get it back to working condition. And found this guide. Warning - that page is not safe to open without an ad-blocker, and perhaps even with an ad-blocker!

So, the basic idea is - install the correct drivers, remove the battery, flash the boot loader first, then flash the rest of the firmware.

As mentioned on that page, the issue seemed to be wrong firmware. I thought I would install the latest firmware by using Intex_Aqua_4G_Strong_V06_Indian_SER_20160408-150449 but apparently my phone only accepts Intex_Aqua_4G_Strong_V03_1_8_Indian_SER_20160622_MT6735M

Another issue was that the driver was not installed properly on my WinXP machine. Installed the VCOM drivers properly on a Win7 machine, and then the firmware update went smoothly. Then uninstalled lots of bloatware, malware and adware, using Root Uninstaller which keeps a backup of the uninstalled apk, rebooting after every doubtful uninstall. Now at last the phone seems to be clean.

Some points which I noted were:

  • Kingroot seems to need a SIM installed in the phone to root.
  • Malwarebytes might be interfering in Kingroot's process, so I uninstalled it before trying to root again.
  • Also, prevented the screen from going to sleep. Not sure if this is important, though. 
  • Unfortunately I did not note down the names of the apps I removed. Everything with Intex in the name, also App Age Helper or something like that, and the three which malwarebytes pointed out. 
Edit - One issue remained. Resolved in this post

Monday, April 03, 2017

pkg install on octave

Octave has many Matlab compatible packages, but they need to be installed and loaded using
pkg Load pkgname
and similarly
pkg unLoad pkgname
This actually adds it to octave's path.

But before that, the packages have to be installed. On my Mint Linux 18 install, had install liboctave-dev first using apt-get and then inside octave,
pkg install -forge -verbose signal
pkg install -forge -verbose control
etc.


Saturday, April 01, 2017

line ending issue for Linux bash script - bad interpreter

Faced the issue of

/bin/bash^M: bad interpreter: No such file or directory

on Linux Mint, for a copy-pasted file from Windows. I knew that this was most probably due to a CR-Linefeed issue. The default text editor, xed, did not seem to fix it. Finally, as this page suggested, used
:set ff=unix
in vim and then saved the file with :wq - solved.

Edited: 1st April 2017 - :set ff=dos is for Windows style CR/LF .... 

Thursday, March 30, 2017

octave idiosyncracy

While operating a loop in GNU Octave, I wanted a counter to be displayed. In the script, this needed
disp(k);
fflush(stdout);

before other statements, and in the Octave command window,
more off;
to turn paging off.

Friday, March 17, 2017

dcraw speeds

It would be useful to be able to edit the dcraw code to make it convert only a region of interest - conversion times are quite long.

On Windows 8, running on an i7, 7.8 sec per image for 14 megapixel CR2 file from a Canon 1100D.
On Macbook i7 with Linux Mint 18, 4.4sec
On Windows XP, running on a 1.9 GHz Athlon, 12 sec.

Converted using
dcraw -v -4 -H 0 -W -w -q 3 -T

Sunday, March 12, 2017

removing adware from Intex Aqua 4G Strong mobile phone

The Intex Aqua 4G Strong mobile phone running Android 5.1 which I had purchased to try out Reliance Jio had annoying adware and bloatware in the firmware. I uninstalled as many as I could, but some of them could not be uninstalled. I tried preventing notifications from them by long press on the notification to pull up the app's notification settings, and unchecking notifications from those apps. But still, on every restart, some app would try to install UCNews etc from outside Google Play store, and would be blocked by the security setting to Not Allow Apps from outside the Play store.

Finally thought I should get rid of this malware / adware.


  1. Installed and ran Malwarebytes Anti-Malware app.
  2. It identified the Malware as two apps, with the path to the apks being in the /system/ folder.
  3. Since the apps were masquerading as System apps, they could not be uninstalled except as Root. So, installed Kingroot via the XDA developers forum to root the device. 
  4. Ran Root Checker Basic to check for root - done. 
  5. Installed Root Browser.
  6. When running Root Browser, it asks if it can install some utilities. Said yes, it installed busybox tools. These are necessary to remount the volume as rw, and remove from system folder.
  7. Navigated to /system/apps and removed the folders containing malware.
  8. Ran Malwarebytes again to check that those were removed.
  9. Removed Kingroot through its uninstall option.
  10. Checked that root is now disabled.
  11. Removed Root Checker.
  12. Checked again with Malwarebytes that all is well. Done. 
Edit - this saga continues in another post here

Monday, February 20, 2017

GPT partition - issues with re-partitioning new hard disk

http://knowledge.seagate.com/articles/en_US/FAQ/207837en?language=en_US

described my issues with partitioning a new hard disk. Solution, as given there, was to use the command prompt,
diskpart
list disk
select disk
clean
exit

and then initialize the disk with Disk Management. 

Monday, February 13, 2017

configuring a DLink DCS-942L camera

In May, I had struggled with port-forwarding, virtual server on router etc while setting up a DLink DCS-942L home network camera. Now, re-configuring it to use a JioFi 4G router, just had to remove the static ip using the Windows setup wizard, then WPS to connect to the wifi network, and that was it. No manual port-forwarding was needed. 

Thursday, February 09, 2017

some notes on download speeds

There was a planetarium show which was offered for a free download as a single 150 GB file from an FTP server. Some notes on my experience trying to download it.

I tested the download and found that FTP download is limited to 1 Mbps for us per connection over Tata internet 14 Mbps line.

With CuteFTP, max 4 connections = 4 Mbps.

With our server in the US, single connection on 1 Gbps line to backbone, 80 Mbps.

Downloading from our US server to Studio / Planetarium over SFTP - 8 Mbps, maybe will go up to the rated 14 Mbps at night.

So, if similar speeds are experienced, probably the best way would be to download to our US server, and then download to Studio/Planetarium in batches.

Tuesday, February 07, 2017

ode45 on octave

Trying the gnlse numerical solution for SCG from the Dudley book using GNU Octave - the Matlab clone. The Octave "port" needed some modifications.

  1. The report function doesn't work properly, so probably can be omitted. Instead of outputting a percentage for every step, it outputs at the end. Maybe it is a difference in the flags returned by the ode45 function.
  2. Had to add 'InitialStep', 0.001 to the odeset parameters - or else the error becomes too large and ode45 exits.
  3. Instead of Z which was linspace(0, flength, nsaves), gave [0, flength] as the parameter to ode45 - or else the ode45 in Octave ignores RelTol and AbsTol. 
  4. Then, spline to create a linearly spaced array of our desired spacing.
So, instead of 
[Z, AW]=ode45( @rhs, Z, ifft(A), options .... etc
called it as
[Zoctave, AWoctave]=ode45( @rhs, [0, flength], ifft(A), options .... etc
and then
Z     = linspace(0,flength, nsaves);
AW = spline(Zoctave, AWoctave,Z);


Then, running time - 

Octave modified ugnlse = 166 sec on i7
Matlab  = 281 sec on Athlon

Since python code got 9x speedup on the i7, I guess the Octave ode45 + spline is slower than the Matlab ode45. Still, running on the i7 gets the advantage of more RAM. Doesn't give the out of memory error so easily. 

Monday, February 06, 2017

pynlo on Linux Mint running on i7 Macbook Pro 4GB

Got a Macbook for doing some tests, computations etc.
OS X Snow Leopard 10.6.8
Intel Core i7
2.66 GHz
2 cores
4GB RAM

Made it dual boot with Linux Mint 18.1 Cinnamon using rEFInd, installed Anaconda 2.7 for pyNLO.

Anaconda installed with no issues. But pip install needed
apt-get install python-pip
apt-get install python-setuptools
apt-get install python-dev

pip install pyfftw
gave permission errors, so did
pip install pyfftw --user
needed
apt-get install libfftw3-dev

python SCG.py did not work - no module named matplotlib
pip install matplotlib --user

Then needed
apt-get install python-tk

Finally working. But colours were different in the pcolor plot.

Changed colormap of pcolor using
cmap=plt.get_cmap('viridis') inside pcolor function call.

On my Athlon 32 bit Windows XP laptop - SCG-Head-sc.py - runs for 15:33 = 933 sec and Mem Error
On the i7 - the same script runs for 1:42 = 102 sec, no Mem Error

So, more than 9x faster.


Sunday, February 05, 2017

status page from uptimerobot

Uptimerobot.com have created status pages now, which can be made public also. Our status page is at
radiosai.org/status

Had to make the custom url a redirect, could not make it a subdomain, since Cloudflare complained that two separate accounts cannot CNAME each other. 

Tuesday, January 31, 2017

trying vlc-warp build and other warping on Macbook

The vlc-warp code, when directly tried a build on Linux Mint 18.1 running on an i7 Macbook Pro, gave the error that
configure: error: libavcodec versions 56 and later are not supported yet.
http://stackoverflow.com/questions/18559322/configure-error-libavcodec-versions-55-and-later-are-not-s

When compiling on a Live DVD of Ubuntu 12.04, compiles OK. But that build will not run on the Linux Mint 18.1 with accelerated graphics. And the Live DVD will not boot with accelerated graphics! So, as of now, am pausing these efforts.

Trying the recommended way to compile on Mac OS - that needs the latest version of Xcode, and our Mac is running 10.8 Snow Leopard.

Tried the Quartz Composer patch from Paul Bourke - that also had some version compatibility issues, I guess, did not work on first few attempts.

Then directly tried the compiled warp-player from Paul Bourke - that itself was skipping frames when trying to warp and play a 50 Mbps 2K fulldome movie. So, pausing these efforts to make a realtime warping player work on this machine. 

Monday, January 30, 2017

Airtel SIM language selection loop

An occasional problem with Xiaomi Mi3 phone - Airtel sim language selection menu comes up again and again - seen for example after a change of SIM.

Solution seems to be to shut down the phone and start it again.

problem logging on to Nettigritty phpMyAdmin - likely cyberoam issue

PB reported, "I am not able to access phpMyAdmin through Nettigritty Plesk. Any specific steps I need to do to get access to it?"

hn: "What happens when you click on the databases tab on the left, and then on phpmyadmin?"

PB: "Had tried this. It does not give access to phpMyAdmin page. It takes me to the login prompt.
Tested this on Firefox 43.0.4 and Safari 9.0.3"

hn: "If you are in "incognito mode" or something like that, the authentication may not work? It is working fine for me. Or it may be some javascript problem? Maybe try after clearing cache? or is it a cyberoam caching issue?"

PB: "It worked on my home computer. So cyberoam could be the cause of this issue."



Wednesday, January 25, 2017

Fisheye to Equirectangular

Jason Fletcher has a post about converting footage from Fisheye to Equirectangular in After Effects. Similar to my Photoshop conversions to fisheye, but the other way around. Would be a useful reference for my conversions - by seeing where the images appear.

Wednesday, January 04, 2017

Airtel 3G speeds

To add to my Jio speed test posts, here are Airtel 3G speeds 3-4 pm at Puttaparthi - the times are visible in the top left corner. Not too shabby :) and definitely better than Jio during peak times.




And, a few days ago at 8.15 pm, with Airtel dongle,




Monday, January 02, 2017

offline fulldome option on Macbook pro - Gaia Sky

Since I had trouble compiling Stellarium360 to run on the Macbook Pro I have got as a loaner, tried out other options - Gaia Sky has a planetarium mode. But fisheye only, no support for mirror-dome. At high resolutions, my machine is unable to keep up refresh rates with Gaia Sky. But it could be used for offline rendering.

stellarium360 on Linux Mint 18.1

Linux Mint 18.1 Cinnamon works fine, dual booting with Mac OS 10.6.8 Snow Leopard, on an i7 Macbook Pro. Mageia Linux, the recommended option for Stellarium360, blanks the screen and / or crashes the system while trying to boot. So, tried compiling Stellarium360 on Linux Mint 18.1. But ran into problems.

ran the install dependencies for Ubuntu script, and ran ./configure. Configure complains that
checking for SDL2/SDL_image.h... yes
checking GL/glew.h usability... yes
checking GL/glew.h presence... yes
checking for GL/glew.h... yes
checking for ptrdiff_t... yes
checking for GraphicsMagick++-config... yes
checking for sdl2-config... yes
checking whether byte ordering is bigendian... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... no
checking for fabs in -lm... no
math library not found
checking for Mix_OpenAudio in -lSDL2_mixer... no
configure: error: *** SDL2_mixer library not found -  ***

But
libsdl2-mixer-dev is already the newest version (2.0.1+dfsg1-1).

I believe this has something to do with changing
-lSDL2_mixer to -lSDL2 or something like that at some point in the configure script, because the API call MixOpenAudio has shifted from one header to another or something? Not sure, just a guess.

But meanwhile, I thought Stellarium360 would work with spherical mirror systems also. Since it won't, then I will pause and rethink my efforts :)