Skip to content

Instantly share code, notes, and snippets.

@peeyush113
peeyush113 / new_redis_server.sh
Last active April 4, 2022 07:05
script to crerate a new service to run redis on different porn on same ubuntu machine
#!/bin/bash
read -p "Enter the port: " port
install -o redis -g redis -d /var/lib/redis-$port
cp -p /etc/redis/redis.conf /etc/redis/redis-$port.conf
config_file=/etc/redis/redis-$port.conf
sed -i "s|port 6379|port $port|g" $config_file
sed -i "s|pidfile /run/redis/redis-server.pid|pidfile /run/redis-$port/redis-server-$port.pid|g" $config_file
sed -i "s|ogfile /var/log/redis/redis-server.log|ogfile /var/log/redis/redis-server-$port.log|g" $config_file
sed -i "s|dir /var/lib/redis|dir /var/lib/redis-$port|g" $config_file
from goose3 import Goose
import nltk
g = Goose()
article = g.extract("https://www.analyticsinsight.net/made-in-india-top-indian-robots-recognized-in-the-global-tech-market/")
doc = article.cleaned_text
doc = "Top Indian Robots Recognized in the Global Tech Market. Analytics Insight features top Indian robots in the global tech market with ‘made in India’ tag."
words = nltk.word_tokenize(doc)
new_words= [word.lower() for word in words if word.isalnum()]
@peeyush113
peeyush113 / how-to-use-aws-elasticsearch.md
Created February 13, 2020 05:09 — forked from simonw/how-to-use-aws-elasticsearch.md
How to use Amazon AWS Elasticsearch

How to use Amazon AWS Elasticsearch

The good news: you can get it running on the free tier (with a tiny instance).

The bad news: it's stuck on Elasticsearch 1.5.2 and dynamic scripting (Groovy) is disabled.

http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/aes-limits.html

Authentication: the safest option is to create a brand new IAM user (using the tool at https://console.aws.amazon.com/iam/home?region=us-east-1 ) with its own access key and secret key. Then when you create the Elasticsearch instance you can paste in the following IAM string:

@peeyush113
peeyush113 / Install NVIDIA Driver and CUDA.md
Created August 31, 2019 18:52 — forked from wangruohui/Install NVIDIA Driver and CUDA.md
Install NVIDIA Driver and CUDA on Ubuntu / CentOS / Fedora Linux OS
from cb_email.cb_invites import *
send_cb_invite(scheduled_invite_id)
@peeyush113
peeyush113 / logstash.conf
Created March 4, 2018 23:09 — forked from markwalkom/logstash.conf
Reindexing Elasticsearch with Logstash 2.0
input {
elasticsearch {
hosts => [ "HOSTNAME_HERE" ]
port => "9200"
index => "INDEXNAME_HERE"
size => 1000
scroll => "5m"
docinfo => true
scan => true
}
14diksirQRWi4mbYczsFvnR57QuNBjYEQs
# coding=utf-8
import csv
import urllib
csv_file = raw_input("Please enter csv file name: ")
with open(csv_file, 'rb') as csvfile:
spamreader = csv.reader(csvfile)
for row in list(spamreader)[1:]:
url = row[2]
print url
@peeyush113
peeyush113 / conf_core-site.xml
Created September 1, 2016 10:40 — forked from chicagobuss/conf_core-site.xml
How to get spark 1.6.0 with hadoop 2.6 working with s3
<configuration>
<property>
<name>fs.s3a.access.key</name>
<description>AWS access key ID. Omit for Role-based authentication.</description>
<value>YOUR_ACCESS_KEY</value>
</property>
<property>
<name>fs.s3a.secret.key</name>
<description>AWS secret key. Omit for Role-based authentication.</description>
# .config/i3/config
set $mod Mod4
set $alt Mod1
font pango:Segoe UI 8
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
# class border backgr. text