Skip to content

Instantly share code, notes, and snippets.

View rajivmehtaflex's full-sized avatar
🚀
smile

Rajiv Mehta rajivmehtaflex

🚀
smile
  • Bacancy Technology
  • Ahmedabad
View GitHub Profile
@rajivmehtaflex
rajivmehtaflex / remove_swap.sh
Created June 26, 2020 13:28 — forked from garystafford/remove_swap.sh
From my blog post, Scripting Linux Swap Space: Scripting Linux Swap Space
#!/bin/sh
# does the swap file exist?
grep -q "swapfile" /etc/fstab
# if it does then remove it
if [ $? -eq 0 ]; then
echo 'swapfile found. Removing swapfile.'
sed -i '/swapfile/d' /etc/fstab
echo "3" > /proc/sys/vm/drop_caches
@rajivmehtaflex
rajivmehtaflex / Compile_python.txt
Created June 26, 2020 13:38
Complie python version
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
cd /opt
sudo wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
sudo tar xzf Python-3.6.9.tgz
cd Python-3.6.9/
sudo ./configure --enable-optimizations
sudo make altinstall
@rajivmehtaflex
rajivmehtaflex / node_nginx_ssl.md
Created June 28, 2020 07:56 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

list of some Linux command at time of cloud-native development for gather environment information
cat /etc/*-release -->Get Distro information
du -sh "/content/drive/My Drive/Colab Notebooks" -->Folder list Size wise
lscpu -->Hardware Info
free -m --> Memory Info
cat /proc/cpuinfo -->Hardware Info
cat /proc/meminfo --> Memory Info
apt install net-tools --> install network utility(In case not install)
netstat -tulpn | grep LISTEN -->Current port in use
netstat -tn src :80 or src :443 --> cross-check based on port #
Create Network
Create two container with same network
Client
sudo apt-get install ssh
sudo systemctl ssh start
sudo systemctl ssh enable
service ssh status
1.
curl --silent --request POST 'http://localhost:9200/movies/_analyze?pretty' \
--data-raw '{
"tokenizer" : "standard",
"filter": [{"type":"edge_ngram", "min_gram": 1, "max_gram": 4}],
"text" : "Star"
}'
//Get Repo List
GET /_cat/repositories
//Get Snapshot info
GET /_snapshot/gProviderbackup/_all
//Start Snapshot info
PUT _snapshot/gProviderbackup/snapshot-v1
//Set the status
As long as the license is no longer in use on the old computer, you can transfer the license to the new one. There is no actual deactivation process, but what you can do is simply format the machine or uninstall the key.
In order to upgrade the new PC running Windows 10 Home to Pro, you must be running the November Update:
How to verify if you downloaded or installed the Windows 10 November Update
once you have that installed, just perform an Easy Upgrade using your Windows 8 Pro product key:
How to Perform an Easy Upgrade in Windows 10
adduser sammy -->Creating a New User
usermod -aG sudo sammy-->Granting Administrative Privileges
If the Root Account Uses SSH Key Authentication(Optional)
rsync --archive --chown=sammy:sammy ~/.ssh /home/sammy
ssh sammy@your_server_ip -->Access Machine
docker run -v "$PWD":/home/Experiments -d -e JUPYTER_ENABLE_LAB=yes -p 8888:8888 jupyter/pyspark-notebook
Notes:got the token from docker log and apply
Reference-Link:https://jupyter-docker-stacks.readthedocs.io/en/latest/index.html
docker run -v "$PWD":/home/gajraj -d -e NB_USER=gajraj -e CHOWN_HOME=yes -e JUPYTER_ENABLE_LAB=yes -p 8888:8888 --user root -w /home/$NB_USER jupyter/pyspark-notebook start-notebook.sh --NotebookApp.base_url=/home/gajraj
with spark UI
docker run -v "$PWD":/home/gajraj -d -e NB_USER=gajraj -e CHOWN_HOME=yes -e JUPYTER_ENABLE_LAB=yes -p 4040:4040 -p 8888:8888 --user root -w /home/$NB_USER jupyter/pyspark-notebook start-notebook.sh --NotebookApp.base_url=/home/gajraj