Skip to content

Instantly share code, notes, and snippets.

@geeky-sh
geeky-sh / cmd.sh
Created September 24, 2021 10:37
change default shell
chsh -s /bin/bash username # https://serverfault.com/questions/106722/choosing-the-shell-that-ssh-uses
@geeky-sh
geeky-sh / diamonds.py
Created July 18, 2021 13:07
Display diamonds
0:
*
1:
*
***
*
2:
*
@geeky-sh
geeky-sh / docusign-email.py
Created January 31, 2020 07:28
Docusign request signatures via email
# Python3 Quick start example: send an envelope to be signed. The signer is notified by email
# Copyright (c) 2018 by DocuSign, Inc.
# License: The MIT License -- https://opensource.org/licenses/MIT
import base64, os
from docusign_esign import (
ApiClient, EnvelopesApi, EnvelopeDefinition,
Signer, SignHere, Tabs, Recipients, Document,
Checkbox, FirstName, Text, RecipientEvent, EventNotification)
@geeky-sh
geeky-sh / error.sh
Created January 25, 2020 09:09
Error RPCO blockchain
> fsevents@1.2.9 install /Users/aash/projects/rpco-blockchain/node_modules/ganache-core/node_modules/fsevents
> node install
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.9/fse-v1.2.9-node-v79-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for fsevents@1.2.9 and node@13.7.0 (node-v79 ABI, unknown) (falling back to source compile with node-gyp)
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
@geeky-sh
geeky-sh / squash-migrations-error.txt
Created January 6, 2020 11:40
Django Squash Migrations Error.
Applying investors.0001_squashed_0032_auto_20200103_0035...Traceback (most recent call last):
File "/Users/aash/projects/rpco-backoffice-api/backend/venv/bin/django-admin", line 8, in <module>
sys.exit(execute_from_command_line())
File "/Users/aash/projects/rpco-backoffice-api/backend/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/Users/aash/projects/rpco-backoffice-api/backend/venv/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/aash/projects/rpco-backoffice-api/backend/venv/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/aash/projects/rpco-backoffice-api/backend/venv/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
@geeky-sh
geeky-sh / query-dict-issue.py
Created January 1, 2020 09:57
Query Dict issue in serialisers
from rest_framework import serializers
class T(serializers.Serializer):
a = serializers.BooleanField()
b = serializers.BooleanField(required=False)
c = serializers.BooleanField(required=False)
d = serializers.CharField()
@geeky-sh
geeky-sh / goodies.py
Last active December 30, 2019 06:18
python function goodies
# below functions are used to create authenticated requests that is
# helpful for testing rest api endpoints, the example usage
# is provided in the description of the function
def get_auth_header(access):
"""
This is primarily used in tests to create authenticated request
using the access token provided
"""
return {'HTTP_AUTHORIZATION': 'Bearer {}'.format(access)}
@geeky-sh
geeky-sh / goodies.sh
Last active December 30, 2019 05:59
Python command line goodies
# the below command will start the ipdb debugger as soon as the test fails. this will be really helpful in the cases
# where we want to inspect the variables before returning the exception
pytest tests/test_views.py::test_user_registration_view -s --pdbcls=IPython.terminal.debugger:TerminalPdb --pdb
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/opt/icu4c/include -DPSYCOPG_VERSION=2.8.4 (dt dec pq3 ext lo64) -DPG_VERSION_NUM=120001 -DHAVE_LO64=1 -I/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I. -I/usr/local/include -I/usr/local/include/postgresql/server -c psycopg/xid_type.c -o build/temp.macosx-10.15-x86_64-3.7/psycopg/xid_type.o
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacO
@geeky-sh
geeky-sh / dapp.md
Last active November 27, 2019 13:21

To use the specific version of solidity compiler, add this in the truffle-config.js inside module.exports

compilers: {
  solc: {
    version: "0.4.2"
  }
},