1 November 2020

NETLINK HG323RGW latest firmware/software update 1.0.35-200929

Old version 1.0.29-200319 
* Modem randomly auto reboots/restarts 4-6 times a day. 

New version 1.0.35-200929 
* Very stable, no more auto restarts. 
* Significant speed improvement compared to old. 

 There was discrepancy in the firmware version published on BSNL Website and NETLINK ICT Website, i got latest one from customer support via Email. Hope this helps someone who experienced same issue as me.

10 April 2020

Convert all MyISAM tables into InnoDB

InnoDB has become the default Storage Engine for mysql tables, which offers more features and better performance than MyISAM.

If you have website created in or around the year 2009-2010 then your website still be using MyISAM based tables even if you have already upgraded your mysql server version to the superior or latest, like i had one.


Here are the steps to convert all MyISAM tables into InnoDB.

login into SSH terminal and run the commands and queries.
step 1:
mysql -u root -p database_name

you will be asked to enter password, then you will see mysql console where you can execute queries.

step 2:
SELECT CONCAT('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;')
FROM INFORMATION_SCHEMA.TABLES
WHERE ENGINE='MyISAM'
AND table_schema = 'database_name';


now you will all table names that has MyISAM as storage engine with query format to convert into InnoDB.
example
ALTER TABLE table_name ENGINE=InnoDB;


step 3: now copy all the alter queries and paste in the mysql console. you can copy paste one by one or all at once.
be aware of | and +------------------------------------------------------+ around the list. you can use text/code editor like notepad, notepad++ , vs code to remove those characters.


Thanks & Credits to https://computingforgeeks.com/how-to-convert-all-mysql-tables-from-myisam-into-innodb-storage-engine/


28 March 2020

get access token from google oauth2 service account json file using jwt token

Here is a simple code snippet that takes google service account .json file as input and gives you access token with the specified scope.



Hope it helps somebody who is in need of , or been searching for it.

22 January 2020

Install latest linux kernel on Ubuntu server

Sometimes upgrading linux kernel may increase overall performance of your server (including network and task processing).

You can download any version of kernel from here
https://kernel.ubuntu.com/~kernel-ppa/mainline/

Latest Stable Kernel: 5.4.13 https://kernel.org

so we install kernel 5.4.13

cd /tmp/

wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.4.13/linux-headers-5.4.13-050413_5.4.13-050413.202001171431_all.deb

wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.4.13/linux-headers-5.4.13-050413-generic_5.4.13-050413.202001171431_amd64.deb

wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.4.13/linux-image-unsigned-5.4.13-050413-generic_5.4.13-050413.202001171431_amd64.deb

wget -c https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.4.13/linux-modules-5.4.13-050413-generic_5.4.13-050413.202001171431_amd64.deb

sudo dpkg -i *.deb


if your Ubuntu version is old you may need to install additional dependency packages

You can search any missing packages here https://packages.ubuntu.com/search and get their download links and install using dpkg -i .deb

3 November 2019

Telegram bot file_id parser

function base64url_decode($data) {
  return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
 function rle_decode($string)
    {
        $new = '';
        $last = '';
        $null = chr(0);
        foreach (str_split($string) as $cur) {
            if ($last === $null) {
                $new .= str_repeat($last, ord($cur));
                $last = '';
            } else {
                $new .= $last;
                $last = $cur;
            }
        }
        $string = $new.$last;
        return $string;
    }
function parse($s)
{
$s = base64url_decode($s);
$s=rle_decode($s);
   $r=unpack("ifile_type/idc_id/qfile_id/qaccess_hash",$s);
    return $r;
}

var_dump(parse('AgADBAADZbMxG7cJAVGXAeNiLWOiH5lPqBsABAEAAwIAA3kAAzcYAwABFgQ'));

possbible file_type list

0 = thumbnail
2 = photo
3 = voice
4 = video
5 = document
8 = sticker
9 = audio
10 = gif
13 = video_note (round video)

Setup Network File System(NFS) Client and Server on Ubuntu

server side run the following commands.


apt install nfs-kernel-server

vi /etc/exports

add /path/you/want/to/share/with/client 10.0.0.0/16(rw,sync,no_root_squash,no_subtree_check)

save it

run exportfs -v
run exportfs -ra


client side commands


apt install nfs-common

mount -t nfs -o vers=3 10.0.0.4:/remote/path /local/path

for persistent mount, add entry in fstab.
vi /etc/fstab

10.0.0.4:/remote/path /local/path nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0

4 February 2019

TANGEDCO TNEB AE 2018 Results, Cut-off, Question papers and Answers

TANGEDCO TNEB AE 2018 exam which was conducted on 30/12/2018 its result was released today 04/02/2019 around 7pm-8pm.

i have collected question papers from their unstable website for all department with answers.

You can view or download questions and answer from google drive link https://drive.google.com/drive/folders/1cGjvM3tdMk0AaDKbS5fVTSVR9TC3Xx_B

Check your marks here  https://drive.google.com/open?id=1i40-NM-Pt4TxJc7sW-wakJzpG3yLsK5M
Cutt-off marks https://drive.google.com/open?id=1rLtPFxX9UTL76pljY8ehs1Qp-H0AavM-

better luck next time.