Skip to content

Instantly share code, notes, and snippets.

View sudipidus's full-sized avatar
:bowtie:
clueless

Sudip Bhandari sudipidus

:bowtie:
clueless
View GitHub Profile
@sudipidus
sudipidus / RSA.c
Created September 20, 2015 17:36
//rsa algorithm for encryption
#include<stdio.h>
int modulo(int,int,int);
int main()
{
int p,q,m;
printf("\nEnter p and q values (Prime Numbers)");
scanf("%d%d",&p,&q);
printf("\nEnter the message:");
@sudipidus
sudipidus / gitignore-android-studio-list
Created December 5, 2016 10:33 — forked from vtanathip/gitignore-android-studio-list
Git Ignore files list that should use in Android Studio Projects
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
@sudipidus
sudipidus / country_iso_code.html
Created May 22, 2017 11:26
Drop down selector for country_iso codes
<option value="zw">"Zimbabwe"</option>
<option value="ad">"Andorra"</option>
<option value="ae">"United Arab Emirates"</option>
<option value="af">"Afghanistan"</option>
<option value="ag">"Antigua and Barbuda"</option>
<option value="ai">"Anguilla"</option>
<option value="al">"Albania"</option>
<option value="am">"Armenia"</option>
<option value="an">"Netherlands Antilles"</option>
<option value="ao">"Angola"</option>
@sudipidus
sudipidus / pre-request.js
Last active November 27, 2021 12:46
Pre-request script to get current timestamp and echotoken value for API call (for Postman)
//create a current timestamp in javascript
timestamp = new Date();
pm.environment.set(“timestamp”, timestamp);
//function to get a unique identifier to be used as echo token
function guid() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
import json
import os
from PIL import Image
from urllib.request import urlopen
import csv
min_width = 800
min_height = 500
min_quality = 3
#!/bin/bash
echo "removing evaluation key"
rm ~/.IntelliJIdea2017.3/config/eval/idea173.evaluation.key
echo "resetting evalsprt in options.xml"
sed -i '/evlsprt/d' ~/.IntelliJIdea2017.3/config/options/options.xml
echo "resetting evalsprt in prefs.xml"
sed -i '/evlsprt/d' ~/.java/.userPrefs/prefs.xml
@sudipidus
sudipidus / The Technical Interview Cheat Sheet.md
Created January 22, 2018 09:21 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
#!/bin/bash
server="$1"
lines=100
echo server is $server
if [ "$#" -eq 2 ]; then
lines="$2"
fi
echo lines are $lines
logfile=/root/logs/staging$server/logfile.log
echo Opening $logfile
wget -r -P ./pdfs -A pdf /web_url_containing_links/
@sudipidus
sudipidus / filenameappender.sh
Created October 16, 2018 12:32
To append a serial number to all the files contained in a directory
files=$(ls | awk '{print $1}')
serial=1
for fn in $files; do
echo "the next file is $fn"
extension="${fn##*.}"
filename="${fn%.*}"
echo "serial is $serial"
echo "filename is $filename and extension is $extension"
newfilename=$filename$serial
echo "mv $filename.$extension $newfilename.$extension"