Python Example Codes

Python Program to Automate Sending Messages on Telegram Groups: Here is the High Level Steps Description: Step 1: Telegram Group In Which You will send MessagesStep 2: Telegram Bot & add bot in the Telegram groupStep 3: Chat ID (-393992542)Step 4: https://api.telegram.org/bot1285167174:AAGrzty80DdyRnjnh7NrvXKjd4I4_26UKf4/getUpdatesStep 5: https://api.telegram.org/bot1285167174:AAGrzty80DdyRnjnh7NrvXKjd4I4_26UKf4/sendMessage?chat_id=-393992542&text=”This is a test Message” Here is Python Code: import requests import …

Python Example Codes Read More »

Youtube Views

Here is the complete Python Program Code: import timeimport randomfrom selenium import webdriver driver = webdriver.Chrome(‘D:\pythoninstaller\chromedriver_win32\chromedriver.exe’) videos = [‘https://www.youtube.com/watch?v=cCwnDBF23mQ&mute=1&list=PLVCgi5HZ0-YseS0QDC-Occ4ggHDYapo3h’,‘https://www.youtube.com/watch?v=wpzclgRPsTA&mute=1&list=PLVCgi5HZ0-YseS0QDC-Occ4ggHDYapo3h&index=2’,‘https://www.youtube.com/watch?v=Okrs5tJG2qk&mute=1&list=PLVCgi5HZ0-YseS0QDC-Occ4ggHDYapo3h&index=3’,‘https://www.youtube.com/watch?v=IOch1-r7-lg&mute=1&list=PLVCgi5HZ0-YseS0QDC-Occ4ggHDYapo3h&index=4’,‘https://www.youtube.com/watch?v=kbr6A6MKJpQ&mute=1&list=PLVCgi5HZ0-YseS0QDC-Occ4ggHDYapo3h&index=5’,‘https://www.youtube.com/watch?v=xx78kGVVRJQ&mute=1&list=PLVCgi5HZ0-YseS0QDC-Occ4ggHDYapo3h&index=6’,‘https://www.youtube.com/watch?v=xkQ7AgBwGq0&mute=1&list=PLVCgi5HZ0-Yt5UGLObhh6rHHtye0xKKFp’,‘https://www.youtube.com/watch?v=6jYKn5ULJX0&mute=1&list=PLVCgi5HZ0-Yt5UGLObhh6rHHtye0xKKFp&index=2’,‘https://www.youtube.com/watch?v=i40LjnKwEaw&mute=1&list=PLVCgi5HZ0-Yt5UGLObhh6rHHtye0xKKFp&index=3’] sleep_time = 0 for i in range(1000):print(“Watching for {} time”.format(i))random_video = random.randint(0,5)driver.get(videos[random_video])time.sleep(sleep_time) # Let the user actually see something!sleep_time = random.randint(60, 130) time.sleep(5) # Let the user actually see something!driver.quit()

Upgrading from Grafana 6 to Grafana 7

Install Latest version of Grafana RPM on top of existing version (6) , in order to Upgrade Grafana. wget https://dl.grafana.com/oss/release/grafana-7.0.1-1.x86_64.rpmsudo yum install grafana-7.0.1-1.x86_64.rpm Ensure to backup everything before proceeding with the Upgrade: Backup the database. If you’re using SQLite Db then the Default Location would be as below: [grafanaadmin@itpanther02 ~]$ ll /var/lib/grafana/total 460-rw-r–r–. 1 grafana grafana 471040 …

Upgrading from Grafana 6 to Grafana 7 Read More »

Setting up Redis Clustering

Create Redis Configuration File with below directive for each node: port 7000 cluster-enabled yes cluster-config-file nodes.conf cluster-node-timeout 5000 appendonly yes Move each configuration file to it’s folder: mkdir 700{1..6} Run redis-cli –cluster create command redis-cli –cluster create 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006 –cluster-replicas 1

Redis Sets Datatype and Commands

Redis SADD – Creating and Adding Members to Redis Sets. sadd users_ip 10.0.0.1 sadd users_ip 10.0.0.2 10.0.0.3 192.168.0 Redis SCARD – Checking total numbers of members available in a list also known as checking cardinality. scard users_ip Redis SMEMBERS – Checking Total Numbers of Members in a set: smembers users_ip Redis SDIFF – Checking Members …

Redis Sets Datatype and Commands Read More »

Installing Apache NiFi Cluster on Linux

Step 1: Update hosts file entry with below 10.128.0.4 nifi0110.128.0.7 nifi0310.128.0.5 nifi02 Step 2: Update zookeeper.properties File on all the serversserver.1=nifi01:2888:3888;2181server.2=nifi02:2888:3888;2181server.3=nifi03:2888:3888;2181 Step 3: Create myid File Create ./state/zookeeper/myid file on all the 3 instances Step 4: Update content of myid file Update the value of myid file to 1 on instance 1, 2 on instance 2 …

Installing Apache NiFi Cluster on Linux Read More »

Installing NiFi Cluster on Windows Server

Step 1: Update hosts file entry with below  127.0.0.1 node1127.0.0.1 node2127.0.0.1 node3 Step 2: Update zookeeper.properties File on all the 3 instances server.1=node1:2888:3888;2181server.2=node2:2889:3889;2182server.3=node3:2890:3890;2183 Step 3: Create myid File Create ./state/zookeeper/myid file on all the 3 instances Step 4: Update content of myid file Update the value of myid file to 1 on instance 1, 2 …

Installing NiFi Cluster on Windows Server Read More »