Skip to content

Instantly share code, notes, and snippets.

View saisyam's full-sized avatar
🎯
Focusing

Saisyam saisyam

🎯
Focusing
View GitHub Profile
@saisyam
saisyam / nginx.sh
Created June 21, 2021 13:36
Nginx docker
$ docker run -p 80:80 nginx
Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx
bb79b6b2107f: Pull complete
111447d5894d: Pull complete
a95689b8e6cb: Pull complete
1a0022e444c2: Pull complete
32b7488a3833: Pull complete
Digest: sha256:ed7f815851b5299f616220a63edac69a4cc200e7f536a56e421988da82e44ed8
Status: Downloaded newer image for nginx:latest
@saisyam
saisyam / analyze.py
Created June 21, 2021 13:34
Analyze sentiment
if compound >= 0.05:
print("Positive")
elif compound <= -0.05:
print("Negative")
else:
print("Neutral")
@saisyam
saisyam / sresult2.sh
Created June 21, 2021 13:33
Sentiment result
>>> {'neg': 0.277, 'neu': 0.493, 'pos': 0.23, 'compound': -0.1901}
@saisyam
saisyam / sresult.sh
Created June 21, 2021 13:32
Sentiment result
>>> {'neg': 0.0, 'neu': 0.369, 'pos': 0.631, 'compound': 0.963}
@saisyam
saisyam / sentiment.py
Created June 21, 2021 13:30
Calculate sentiment
from nltk.sentiment.vader import SentimentIntensityAnalyzer
sia = SentimentIntensityAnalyzer()
text = "Pretty pricey but the lamb burger ($25) is beyond amazing. Definitely worth it. So, so good."
sia.polarity_scores(text)
@saisyam
saisyam / vader.sh
Created June 21, 2021 13:28
Install vader
$ python3
Python 3.8.5 (default, Sep 5 2020, 10:50:12)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nltk
>>> nltk.download('vader_lexicon')
[nltk_data] Downloading package vader_lexicon to
[nltk_data] /home/saisyam/nltk_data...
True
>>>
@saisyam
saisyam / nltk.sh
Created June 21, 2021 13:27
Install nltk
$ pip3 install nltk
@saisyam
saisyam / fsstatus.sh
Created June 21, 2021 13:17
Freeswitch status
$ sudo systemctl status freeswitch.service
@saisyam
saisyam / fsboot.sh
Created June 21, 2021 13:16
Freeswitch on boot
$ sudo chmod ugo+x freeswitch.service
$ sudo systemctl start freeswitch.service
$ sudo systemctl enable freeswitch.service
@saisyam
saisyam / freeswitch.service
Created June 21, 2021 13:15
Freeswitch Service
[Unit]
Description=freeswitch
Wants=network-online.target
Requires=syslog.socket network.target local-fs.target
After=syslog.socket network.target network-online.target local-fs.target
[Service]
Type=forking
Environment="DAEMON_OPTS=-nonat"
EnvironmentFile=-/etc/default/freeswitch