Skip to content

Instantly share code, notes, and snippets.

from django.forms import EmailField
from django.core.exceptions import ValidationError
def isEmailAddressValid( email ):
try:
EmailField().clean(email)
return True
except ValidationError:
return False
@suhailvs
suhailvs / angularjs.md
Last active January 12, 2017 08:47
Angularjs Task add/edit example

First create backend endpoints using Django Rest Framework:

task/models

from django.db import models
class Task(models.Model):
    completed = models.BooleanField(default=False)
    title = models.CharField(max_length=100)
    description = models.TextField()
@suhailvs
suhailvs / python_socialauth.md
Last active January 23, 2017 10:55
Social authentication on django

install django,python-social-auth

pip install django
pip install python-social-auth

./manage.py startproject mysite

update mysite/mysite/settings.py

@suhailvs
suhailvs / bitcoin.md
Last active September 21, 2017 14:32
Bitcoin Work

Installation

$ sudo apt-add-repository ppa:bitcoin/bitcoin
$ sudo apt-get update  

To install the Bitcoin Core Graphical User Interface (GUI):

$ sudo apt-get install bitcoin-qt

@suhailvs
suhailvs / sublime_ssh.md
Created September 25, 2017 03:38
How to use Sublime over SSH

How to use Sublime over SSH

Installation(SFTP)

Download Package Control and use the Package Control: Install Package command from the command palette. The command palette is opened via ctrl+shift+p.

Once you run the Package Control: Install Package command, a list of packages will appear. Type in SFTP and hit enter.

Mapping a Local Folder to a Remote Folder

@suhailvs
suhailvs / digitalocean.md
Last active September 25, 2017 05:55
How to Run Django with mod_wsgi and Apache with a virtualenv

guide

0. ssh into digitalocean

ssh root@104.131.108.244

1. update and install

install apache, git,mod-wsgi,mysql and some python packages such as pip,virtualenv and python-dev

@suhailvs
suhailvs / wrap_wallet_cracker.py
Last active October 3, 2017 11:53
Wrap wallet cracker
""" Usage:
$ wget http://suhailvs.mooo.com/media/images/t1.sqlite3
>>> import cracker as main
>>> main.save_a_pp() #"Generate Random Passphrase with salt a@b.c"
>>> main.show() # Show 10 items from Databse 'db.sqlite3'
>>> main.show(['l0Jl47s5',''])
>>> main.show(['','1MkupVKiCik9iyfnLrJoZLx9RH4rkF3hnA']) # warp wallet challenge2
>>> main.manual() # manually input passphrase and salt
"""
@suhailvs
suhailvs / ethereum.md
Created September 24, 2017 07:26
pyethapp tutorial

Pyethapp example

Installation

Virtualenv: $ apt-get install virtualenv

Create an env and activate it:

$ virtualenv venv
$ source venv/bin/activate

Keybase proof

I hereby claim:

  • I am suhailvs on github.
  • I am suhailvs (https://keybase.io/suhailvs) on keybase.
  • I have a public key ASCDu5Ylk0S8bAGXikM80wdKyQl4mmi9oRHdJGxpKKDVVQo

To claim this, I am signing this object:

@suhailvs
suhailvs / digitalocean_apache.md
Last active April 7, 2018 06:04
Digital ocean apache django
$ apt-get update
$ apt-get install python3-pip apache2 libapache2-mod-wsgi-py3


<VirtualHost *:8002>

    <Directory /var/www/djangorest_angular/dj_backend/dj_backend>
        <Files wsgi.py>
            Require all granted