Skip to content

Instantly share code, notes, and snippets.

View upretip's full-sized avatar
🏠
Writing some code

upretip

🏠
Writing some code
View GitHub Profile
@upretip
upretip / 1. Working with LDAP.md
Last active May 13, 2020 21:24
blog materials

I recently worked on a project where I had to get data from our Identity and Access Management Server using LDAP and I did not know where to start. Therefore, I have created this use case for future refernce and use case reminder.

Background

Active Directories that I had to query through used LDAP servers. We needed to get the list of users along with their id and email. For that we created a python script. The major aspects are listed below.

{
"workbench.colorTheme": "Predawn",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.testing.autoTestDiscoverOnSaveEnabled": true,
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [],
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"window.zoomLevel": 0,
"explorer.confirmDragAndDrop": false,
# https://leetcode.com/problems/trapping-rain-water/
# Construct a function that, given a list of integers representing a
# two-dimensional height map, returns the maximum amount of rainfall
# that could be held by that landscape.
#
# For example, let's consider the following input:
#
# heights = [1, 2, 1, 0, 3, 2, 1, 2]
#
@upretip
upretip / email_send.py
Created July 31, 2019 00:21
AWS-lambda
"""Save this function as lambda_function.py
call this lambda email_send
give discription
write email + passwords in environments and use os.environ to invoke them
"""
import json
import boto3
import os
aws cli helps run aws api from command line. Some of the aws clients i will need to use are as follows:
1. aws_s3: for storage
2. aws_lambda: for serverless compute
3. aws_ec2: compute engine
4. aws_iam: for security and management
in linux:
install aws cli by `sudo install aws`
then `aws configure`
it will ask to add access_token
@upretip
upretip / Windows+Linux+Notes.md
Last active April 23, 2020 15:31
noting down steps taken to effectively using Linux subsystem on windows

Windows Subsystem for Linux (WSL Docs)

To start the WSL:

  • turn windows features on or off (I usually search that on windows menu)
  • Then find windows subsystem for linux and click checkbox
  • It may require restart the computer
  • Go to Microsoft store and download and install Ubuntu

Corey Schafer has an excellent video on how to install

@upretip
upretip / Git and SSH error.md
Last active July 23, 2019 06:22 — forked from hofmannsven/README.md
My simply Git Cheatsheet

I am encountering public key error frequently. Here is what is happening

If ssh-agent cannot be turned on found here

  • search for services app on start menu
  • look for OpenSSH. It is disabled by default. Turn it to automatic
  • check if it on by running ssh-agent on terminal

Private key -make ssh-agent run it Public key -share with client (eg. github)

@upretip
upretip / AWSconnectoR.r
Last active September 19, 2019 21:12
showing friend how to write gist
#opening data from s3 bucket directly
#author: Parash Upreti
#install aws.s3 library and load it
install.packages("aws.s3", repos = c("cloudyr" = "http://cloudyr.github.io/drat"))
library("aws.s3")
@upretip
upretip / jupyter_shortcuts.md
Created February 3, 2019 18:21
reference for how to effectively use jupyter lab notebooks. I will add more contents as I learn more

Resources from dataquest

merge two cells shift + m while highlighting cell

break cells fro cursor ctrl + shift + - on selected cell

@upretip
upretip / python3_windows.md
Last active April 17, 2019 19:48
Python3|Windows10