Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Sanyam Bansal Sanyambansal76

🎯
Focusing
Block or report user

Report or block Sanyambansal76

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View install_psql_client_11.1.sh
sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
sudo apt-get update
sudp apt-get install postgresql-client-11
@Sanyambansal76
Sanyambansal76 / local_settings.py
Created Oct 8, 2018 — forked from rochacbruno/local_settings.py
Django Profiling Middleware with hotshot or Cprofile
View local_settings.py
MIDDLEWARE_CLASSES = MIDDLEWARE_CLASSES + (
'yourapp.middleware.ProfileMiddleware',
'yourapp.middleware.CProfileMiddleware'
)
View file_system_error.txt
https://ccm.net/faq/3505-repair-file-system-errors-on-ubuntu
@Sanyambansal76
Sanyambansal76 / speed_test.py
Created Sep 2, 2018
Linux Speed Test command line
View speed_test.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2012-2018 Matt Martz
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@Sanyambansal76
Sanyambansal76 / install_docker.sh
Last active Mar 7, 2019
Install docker and docker compose ubuntu16.04
View install_docker.sh
#!/usr/bin/env bash
# install docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce
sudo usermod -aG docker ${USER}
su - ${USER}
id -nG
echo "Now Enter you password"
@Sanyambansal76
Sanyambansal76 / sql_replace_in_django_orm.py
Created May 1, 2018 — forked from simonw/sql_replace_in_django_orm.py
How to use the SQL replace function in a Django ORM query
View sql_replace_in_django_orm.py
from django.db.models import F, Func, Value
from myapp.models import MyModel
# Annotation
MyModel.objects.filter(description__icontains='\r\n').annotate(
fixed_description=Func(
F('description'),
Value('\r\n'), Value('\n'),
function='replace',
)
@Sanyambansal76
Sanyambansal76 / Order Book Gdax
Created Aug 9, 2017
List contains 3 index [ price, size, num-orders ]
View Order Book Gdax
{
u'bids': [
[
u'3272.07',
u'0.10051789',
1
],
[
u'3270.8',
u'3.55364293',
View Financial Time API
{
u'title': {
u'title': u'SPORT NEWS IN BRIEF'
},
u'modelVersion': u'1',
u'apiUrl': u'http://api.ft.com/content/items/v1/b0cb0082-97aa-11db-a680-0000779e2340',
u'location': {
u'uri': u'http://www.ft.com/cms/b0cb0082-97aa-11db-a680-0000779e2340.html'
},
u'id': u'b0cb0082-97aa-11db-a680-0000779e2340',
View Guardian Api Response
{
"response": {
"status": "ok",
"userTier": "developer",
"total": 60576,
"startIndex": 1,
"pageSize": 8,
"currentPage": 1,
"pages": 7572,
"orderBy": "relevance",
View Tor Setup link
You can’t perform that action at this time.