Skip to content

Instantly share code, notes, and snippets.

View jagamts1's full-sized avatar
🎯
Focusing

Jagadish jagamts1

🎯
Focusing
  • Bangalore
View GitHub Profile
@jagamts1
jagamts1 / create_cert.sh
Created May 2, 2021 10:22
Bash shell script for generating self-signed certs.
#!/bin/bash
# Bash shell script for generating self-signed certs.
# usage: ./gen_ssl_cert.sh superset.com
# Ref: https://gist.githubusercontent.com/adamrunner/285746ca0f22b0f2e10192427e0b703c/raw/23ec7544d0377aea3df06e4e9a684935c68bd397/gen_cert.sh
# Script accepts a single argument, the fqdn for the cert
DOMAIN="$1"
if [ -z "$DOMAIN" ]; then
echo "Usage: $(basename $0) <domain>"
exit 11
@jagamts1
jagamts1 / Cheat code for Virtualenvwrapper packages
Last active December 17, 2019 09:58
Virtualenvwrapper_cheatsheet.md
# To activate virtualenv environment
workon playground
# To create virtualenv env
# python2.7
mkvirtualenv -p python2.7 playground
# python3
mkvirtualenv -p python playground
@jagamts1
jagamts1 / Airflow_cheat_sheet
Created December 9, 2019 10:11
Airflow releated commands
# To run webserver
airflow webserver -p 8080
# To run airflow scheduler
airflow scheduler
# To initiate database
airflow initdb
# To reset db
TO create swap space
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=2048 # count is swap space in mb 2048 mean 2GB ram
sudo /sbin/mkswap /var/swap.1
sudo chmod 600 /var/swap.1
sudo /sbin/swapon /var/swap.1
To make them as permanent in serer or in system add into the /etc/fstab
/var/swap.1 swap swap defaults 0 0
For install rabbitmq
https://tecadmin.net/install-rabbitmq-server-on-ubuntu/
For install VirtualWrapper
http://www.indjango.com/python-install-virtualenv-and-virtualenvwrapper/
For install celery
http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html
for install Elasticsearch
1.To install Wine on Arch Linux, you first need to enable the multilib repository, which makes it possible to run and build 32-bit applications on 64-bit installations of Arch Linux, by uncommenting the following two lines in /etc/pacman.conf:
[multilib]
Include = /etc/pacman.d/mirrorlist
2.add mirrorslist
sudo pacman -Sy lib32-libpulse
3.To install wine
sudo pacman -S wine
refer
https://linuxhint.com/wine-arch-linux/
@jagamts1
jagamts1 / installAtom.txt
Last active June 10, 2018 08:57
method for installing aur package and install atom-editer
1.download file from arch repo
https://aur.archlinux.org/packages/atom-editor-bin/
2.unzip the file
tar -xvzf atom-editor-bin.tar.gz
3.change into the dirctory
cd atom-editor-bin
4.for complie the package
makepkg -s
5.to install the package
sudo pacman -U filename end with .xz
@jagamts1
jagamts1 / Postman.desktop
Created June 10, 2018 06:26 — forked from aviskase/Postman.desktop
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@jagamts1
jagamts1 / views.py
Created January 11, 2018 08:54
sqlalchmey image upload method for django project
@permission_classes((IsAuthenticated,))
@authentication_classes([JSONWebTokenAuthentication, ])
class ImageUploadAPI(APIView):
def post(self, request):
serializer = ImageSerilaizer(data=request.data)
if serializer.is_valid():
try:
company = UserCompany.objects.get(user=request.user).company
db_name = company.db_name