This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To activate virtualenv environment | |
workon playground | |
# To create virtualenv env | |
# python2.7 | |
mkvirtualenv -p python2.7 playground | |
# python3 | |
mkvirtualenv -p python playground |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To run webserver | |
airflow webserver -p 8080 | |
# To run airflow scheduler | |
airflow scheduler | |
# To initiate database | |
airflow initdb | |
# To reset db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Desktop Entry] | |
Encoding=UTF-8 | |
Name=Postman | |
Exec=postman | |
Icon=/opt/Postman/resources/app/assets/icon.png | |
Terminal=false | |
Type=Application | |
Categories=Development; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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 |