adhocshare Blog

0

Download m3u8 URL video to local

Follow below steps to download video from a webpage Step 1: Finding m3u8 URL from webpage Open Chrome Developer tools and click the Network tab Navigate to the page with the video and get it to start playing Filter the...

0

Automate ports connectivity check using telnet and timeout

Check ports connectivity using automation with telnet and timeout commands. Timeout will help us not get blocked for a long time. Adjust the timeout value on case to case basis, # vi ~/check_my_server_hostname.sh timeout 2 bash -c “echo ‘exit’ |...

0

Connecting to msaccess database from Python

Connect to msaccess file from Python and tweak it to emit desired format. import pyodbc conn = pyodbc.connect(r’Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=path where you stored the Access file\file name.accdb;’) cursor = conn.cursor() cursor.execute(‘select * from table name’) for row in...

0

Process JSON data in SQL Server 2012

Source: http://mtkcode.blogspot.com/2014/08/parse-json-string-by-sql-script.html SQL Server 2016 and above support JSON_VALUE function to parse JSONs. To process JSONs in older versions add this function to database – https://github.com/khanhmai/Parse-JSON-String-by-SQL-script/blob/master/ParseJSON-FUNCTION.sql Then we can write queries such as below, — Query sample 1 select *...

0

VirtualBox tips

Increase size of VDI file (Windows) Go to Virtualbox folder > cd “C:\Program Files\Oracle\VirtualBox” Run resize command (unit size is MB) Below command will make the disk size grow up to 16GB > VBoxManage modifyhd “C:\Users\robin\C:\Users\v737050\VirtualBox VMs\Centos 6\Centos 6.vdi” –resize...

0

Extract query time from hiveserver2 Interactive log

Got in a situation where you were asked to extract hive queries and the time they took to execute? Steps On log files run below 2 extracts awk ‘match($0, “^([^ ]+).*Completed executing command\\(queryId=([0-9a-z_-]+)\\); Time taken: (.*)”, a) {print “COMPLETE\t” a[1]...

0

HDFS data sizing

Below is data storage estimator based on message size and throughput. Input HDFS replication and the amount of data end users will generate over time using raw data. Hope this helps you. Data calculator Message size in bytes Message per...

0

Create many files with random content

Source: https://unix.stackexchange.com/questions/199863/create-many-files-with-random-content   For example, Name size file1.01 2K file2.02 3K file3.03 5K etc.   Strategy – 1 #! /bin/bash for n in {1..1000}; do dd if=/dev/urandom of=file$( printf %03d “$n” ).bin bs=1 count=$(( RANDOM + 1024 )) done  ...